Skip to contentSkip to conversation

scsi: ufs: Unbreak the reset handler

PATCH Superseded Bart Van Assche 1 participant 1 message Sep 16, 2021 SCSI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: ufs: Unbreak the reset handler

A command tag is passed as the second argument of the __ufshcd_transfer_req_compl() call in ufshcd_eh_device_reset_handler() instead of a bitmask. Fix this as follows:
- Pass a bitmask as argument instead of a command tag.
- Report the command as aborted instead of requeuing it.
- Instead of giving up if clearing a command fails, iterate over all commands.

Cc Can Guo <[email protected]>
Fixes a45f937110fa ("scsi: ufs: Optimize host lock on transfer requests send/compl paths")
---
 drivers/scsi/ufs/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +1 -1
index 3841ab49f556..d1dc52c76847 100644
@@ -6876,7 +6876,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
 			err = ufshcd_clear_cmd(hba, pos);
 			if (err)
 				break;
-			__ufshcd_transfer_req_compl(hba, pos, /*retry_requests=*/true);
+			__ufshcd_transfer_req_compl(hba, 1U << pos, false);
 		}
 	}