scsi: ufs: fix exception event handling
authorMaya Erez <merez@codeaurora.org>
Thu, 3 May 2018 11:07:16 +0000 (16:37 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 18 May 2018 16:20:48 +0000 (12:20 -0400)
commit2e3611e9546c2ed4def152a51dfd34e8dddae7a5
tree4301ed71150c78dba4eb4bd26ff225b54cd6d5e4
parent60d6d22d85a79d194e9e1a13b831ffafa741cd6e
scsi: ufs: fix exception event handling

The device can set the exception event bit in one of the response UPIU,
for example to notify the need for urgent BKOPs operation.  In such a
case, the host driver calls ufshcd_exception_event_handler to handle
this notification.  When trying to check the exception event status (for
finding the cause for the exception event), the device may be busy with
additional SCSI commands handling and may not respond within the 100ms
timeout.

To prevent that, we need to block SCSI commands during handling of
exception events and allow retransmissions of the query requests, in
case of timeout.

Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c