All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: set host_byte to DID_REQUEUE when ocs = OCS_ABORTED
@ 2017-06-24 10:27 Zang Leigang
  2017-06-28  1:34 ` Martin K. Petersen
  2017-06-28 23:42 ` Subhash Jadavani
  0 siblings, 2 replies; 5+ messages in thread
From: Zang Leigang @ 2017-06-24 10:27 UTC (permalink / raw)
  To: vinholikatti, jejb, martin.petersen; +Cc: linux-scsi

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.

Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index ffe8d8608818..e050dcea1bea 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -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;
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: ufs: set host_byte to DID_REQUEUE when ocs = OCS_ABORTED
  2017-06-24 10:27 [PATCH] scsi: ufs: set host_byte to DID_REQUEUE when ocs = OCS_ABORTED Zang Leigang
@ 2017-06-28  1:34 ` Martin K. Petersen
  2017-06-28 23:42 ` Subhash Jadavani
  1 sibling, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2017-06-28  1:34 UTC (permalink / raw)
  To: Subhash Jadavani
  Cc: vinholikatti, jejb, martin.petersen, linux-scsi, Zang Leigang


> 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.

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/

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: ufs: set host_byte to DID_REQUEUE when ocs = OCS_ABORTED
  2017-06-24 10:27 [PATCH] scsi: ufs: set host_byte to DID_REQUEUE when ocs = OCS_ABORTED Zang Leigang
  2017-06-28  1:34 ` Martin K. Petersen
@ 2017-06-28 23:42 ` Subhash Jadavani
  2017-06-29  2:25   ` Zang Leigang
  1 sibling, 1 reply; 5+ messages in thread
From: Subhash Jadavani @ 2017-06-28 23:42 UTC (permalink / raw)
  To: Zang Leigang
  Cc: vinholikatti, jejb, martin.petersen, linux-scsi, linux-scsi-owner

On 2017-06-24 03:27, Zang Leigang wrote:
> Host set ocs to OCS_ABORTED when 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?

> Then scsi_decide_disposition return 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.


> 
> Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index ffe8d8608818..e050dcea1bea 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -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;

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: ufs: set host_byte to DID_REQUEUE when ocs = OCS_ABORTED
  2017-06-28 23:42 ` Subhash Jadavani
@ 2017-06-29  2:25   ` Zang Leigang
  2017-07-03 21:28     ` Subhash Jadavani
  0 siblings, 1 reply; 5+ messages in thread
From: Zang Leigang @ 2017-06-29  2:25 UTC (permalink / raw)
  To: Subhash Jadavani
  Cc: vinholikatti, jejb, martin.petersen, linux-scsi, linux-scsi-owner

On Wed, Jun 28, 2017 at 04:42:36PM -0700, Subhash Jadavani wrote:
> On 2017-06-24 03:27, Zang Leigang wrote:
> >Host set ocs to OCS_ABORTED when 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.
> 
> >Then scsi_decide_disposition return 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.
> 
> >
> >Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>
> >
> >diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> >index ffe8d8608818..e050dcea1bea 100644
> >--- a/drivers/scsi/ufs/ufshcd.c
> >+++ b/drivers/scsi/ufs/ufshcd.c
> >@@ -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;
> 
> -- 
> The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project

-- 
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!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: ufs: set host_byte to DID_REQUEUE when ocs = OCS_ABORTED
  2017-06-29  2:25   ` Zang Leigang
@ 2017-07-03 21:28     ` Subhash Jadavani
  0 siblings, 0 replies; 5+ messages in thread
From: Subhash Jadavani @ 2017-07-03 21:28 UTC (permalink / raw)
  To: Zang Leigang
  Cc: vinholikatti, jejb, martin.petersen, linux-scsi, linux-scsi-owner

On 2017-06-28 19:25, Zang Leigang wrote:
> On Wed, Jun 28, 2017 at 04:42:36PM -0700, Subhash Jadavani wrote:
>> On 2017-06-24 03:27, Zang Leigang wrote:
>> >Host set ocs to OCS_ABORTED when 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.

> better to let these request retry, because an err handler may fix
> the err condition.
>> 
>> >Then scsi_decide_disposition return 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.
>> 
>> >
>> >Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>
>> >
>> >diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
>> >index ffe8d8608818..e050dcea1bea 100644
>> >--- a/drivers/scsi/ufs/ufshcd.c
>> >+++ b/drivers/scsi/ufs/ufshcd.c
>> >@@ -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;
>> 
>> --
>> The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
>> a Linux Foundation Collaborative Project

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-03 21:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-24 10:27 [PATCH] scsi: ufs: set host_byte to DID_REQUEUE when ocs = OCS_ABORTED Zang Leigang
2017-06-28  1:34 ` Martin K. Petersen
2017-06-28 23:42 ` Subhash Jadavani
2017-06-29  2:25   ` Zang Leigang
2017-07-03 21:28     ` Subhash Jadavani

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.