summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMaya Erez <merez@codeaurora.org>2018-05-03 07:07:16 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2018-05-18 12:20:48 -0400
commit2e3611e9546c2ed4def152a51dfd34e8dddae7a5 (patch)
tree4301ed71150c78dba4eb4bd26ff225b54cd6d5e4 /drivers/scsi
parent60d6d22d85a79d194e9e1a13b831ffafa741cd6e (diff)
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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/ufs/ufshcd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 892ad43dac9a..4dc48804c17b 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5073,6 +5073,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work)
5073 hba = container_of(work, struct ufs_hba, eeh_work); 5073 hba = container_of(work, struct ufs_hba, eeh_work);
5074 5074
5075 pm_runtime_get_sync(hba->dev); 5075 pm_runtime_get_sync(hba->dev);
5076 scsi_block_requests(hba->host);
5076 err = ufshcd_get_ee_status(hba, &status); 5077 err = ufshcd_get_ee_status(hba, &status);
5077 if (err) { 5078 if (err) {
5078 dev_err(hba->dev, "%s: failed to get exception status %d\n", 5079 dev_err(hba->dev, "%s: failed to get exception status %d\n",
@@ -5086,6 +5087,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work)
5086 ufshcd_bkops_exception_event_handler(hba); 5087 ufshcd_bkops_exception_event_handler(hba);
5087 5088
5088out: 5089out:
5090 scsi_unblock_requests(hba->host);
5089 pm_runtime_put_sync(hba->dev); 5091 pm_runtime_put_sync(hba->dev);
5090 return; 5092 return;
5091} 5093}