scsi: ufs: set host_byte to DID_REQUEUE when ocs = OCS_ABORTED
PATCH 1/1 scsi: ufs: set host_byte to DID_REQUEUE when ocs = OCS_ABORTED
Host set ocs to OCS_ABORTED when clear a doorbell in err handler. Then scsi_decide_disposition return SUCCESS. This may cause some filesystem panic because a FAILED REQUESET. Requeue and complete is better.
drivers/scsi/ufs/ufshcd.c +0 -2
@@ -4545,8 +4545,6 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) }break ;case OCS_ABORTED : - result |=DID_ABORT <<16 ; -break ;case OCS_INVALID_COMMAND_STATUS : result |=DID_REQUEUE <<16 ;break ;
Signature · 1 line
2.13.0
Quoted 5 lines
Host set ocs to
OCS_ABORTEDwhen clear a doorbell in err handler. Thenscsi_decide_dispositionreturn SUCCESS. This may cause some filesystem panic because a FAILED REQUESET. Requeue and complete is better.
Subhash: Please review the three ufs patches from Zang.
https://patchwork.kernel.org/patch/9807763/
https://patchwork.kernel.org/patch/9807759/
https://patchwork.kernel.org/patch/9807755/
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Quoted 1 line · Zang Leigang
Host set ocs to
OCS_ABORTEDwhen clear a doorbell in err handler.
OCS field is valid after host controller has cleared the corresponding doorbell (UTRLDBR) bit to zero. And here HW would be clearing the doorbell bit, not the SW. So I am not sure what do you mean in sentence above? Can you please elaborate more on this?
Quoted 3 lines
Then
scsi_decide_dispositionreturn SUCCESS. This may cause some filesystem panic because a FAILED REQUESET. Requeue and complete is better.
Why do you think retrying this HW aborted request will succeed next time? Are we going to fix some request parameters before retrying? If not, it will most likely fail again.
Quoted 17 lines
Signed-off-by Zang Leigang <[email protected]>drivers/scsi/ufs/ufshcd.c +0
-2@@ -4545,8 +4545,6 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) }break ;case OCS_ABORTED : - result |=DID_ABORT <<16 ; -break ;case OCS_INVALID_COMMAND_STATUS : result |=DID_REQUEUE <<16 ;break;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Quoted 8 lines · Subhash Jadavani
Quoted 1 line · Zang Leigang
Host set ocs to
OCS_ABORTEDwhen clear a doorbell in err handler.OCS field is valid after host controller has cleared the corresponding doorbell (UTRLDBR) bit to zero. And here HW would be clearing the doorbell bit, not the SW. So I am not sure what do you mean in sentence above? Can you please elaborate more on this?
Err handler clear PENDING transfer requests with ufshcd_clear_cmd, and host set these requests's ocs to 6(OCS_ABORTED). I think it's better to let these request retry, because an err handler may fix the err condition.
Quoted 9 lines
Quoted 4 lines
Then
scsi_decide_dispositionreturn SUCCESS. This may cause some filesystem panic because a FAILED REQUESET. Requeue and complete is better.Why do you think retrying this HW aborted request will succeed next time? Are we going to fix some request parameters before retrying? If not, it will most likely fail again.
HW aborted request commonly comes from err handler with "ufshcd_clear_cmd", In fact, I never seen that host aborted a request on host's own initiative. If err handler successfully re-link and fix the host or device, retry will most likely success.
Quoted 22 lines
Quoted 18 lines
Signed-off-by Zang Leigang <[email protected]>drivers/scsi/ufs/ufshcd.c +0
-2@@ -4545,8 +4545,6 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) }break ;case OCS_ABORTED : - result |=DID_ABORT <<16 ; -break ;case OCS_INVALID_COMMAND_STATUS : result |=DID_REQUEUE <<16 ;break;Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Signature · 6 lines
Thanks, Zang Leigang ________________________________________________________________________________ 本邮件及其附件含有华为公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
Quoted 11 lines · Zang Leigang
Quoted 8 lines · Subhash Jadavani
Quoted 1 line · Zang Leigang
Host set ocs to
OCS_ABORTEDwhen clear a doorbell in err handler.OCS field is valid after host controller has cleared the corresponding doorbell (UTRLDBR) bit to zero. And here HW would be clearing the doorbell bit, not the SW. So I am not sure what do you mean in sentence above? Can you please elaborate more on this?
Err handler clear PENDING transfer requests with
ufshcd_clear_cmd, and host set these requests's ocs to 6(OCS_ABORTED). I think it's
If we are saying that "Host controller setting the OCS to 6 when SW clears a tag in UTRLCLR" then it isn't a UFSHCI standard defined behavior instead this seems to be very specific to your UFS controller specific behavior. Ideally OCS shouldn't be modified by host in this case and as SW has set the OCS to OCS_INVALID_COMMAND_STATUS before the transfer, request will be re-queued. If you want to handle the OCS_ABORTED differently for your host controllers, you may have to add the host controller quirk and enable it for your controllers.
Quoted 37 lines
better to let these request retry, because an err handler may fix the err condition.
Quoted 9 lines
Quoted 4 lines
Then
scsi_decide_dispositionreturn SUCCESS. This may cause some filesystem panic because a FAILED REQUESET. Requeue and complete is better.Why do you think retrying this HW aborted request will succeed next time? Are we going to fix some request parameters before retrying? If not, it will most likely fail again.
HW aborted request commonly comes from err handler with "
ufshcd_clear_cmd", In fact, I never seen that host aborted a request on host's own initiative. If err handler successfully re-link and fix the host or device, retry will most likely success.Quoted 22 lines
Quoted 17 lines
Signed-off-by Zang Leigang <[email protected]>drivers/scsi/ufs/ufshcd.c +0
-2@@ -4545,8 +4545,6 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) }break ;case OCS_ABORTED : - result |=DID_ABORT <<16 ; -break ;case OCS_INVALID_COMMAND_STATUS : result |=DID_REQUEUE <<16 ;Quoted 1 line
break;--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project