Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a0b2898f authored by Subhash Jadavani's avatar Subhash Jadavani Committed by Venkat Gopalakrishnan
Browse files

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: default avatarSubhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
parent b979f780
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment