scsi: ufs: fix shutdown race condition
New requests coming after/in parallel to shutdown are being returned with DID_ERROR, but this causes the request to be requeued and retried. These requests are getting pulled by the shutdown context since the PON request is inserted at the head of the queue and the queue is run for processing. The queuecommand in ufs driver allows requests in the context of shutdown as PON has to be sent to the device, but this retried regular request also ends up getting submitted after PON which fails and causes issues in err handling. Fix this by not relying on the context but looking for the target lun of the request. Allow only requests directed towards well known device lun (where PON will be sent) and block all other requests. Also make sure we mark the shutdown processing first before taking the write lock so that we can appropriately fail the regular request. Change-Id: Iaa442e8e92310ea0761c27af8fda57ffcadadb3d Signed-off-by:Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by:
Venkat Gopalakrishnan <venkatg@codeaurora.org>
Loading
Please register or sign in to comment