* [PATCH] ufs:mcq:Fixing Error Output for ufshcd_try_to_abort_task in ufshcd_mcq_abort
[not found] <CGME20240523002322epcas1p2a63dfc646a2b2dd8fcadad2a8807bcee@epcas1p2.samsung.com>
@ 2024-05-23 0:22 ` Chanwoo Lee
2024-05-23 22:43 ` Bart Van Assche
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Chanwoo Lee @ 2024-05-23 0:22 UTC (permalink / raw)
To: alim.akhtar, avri.altman, bvanassche, James.Bottomley,
martin.petersen, stanley.chu, quic_nguyenb, quic_cang, powen.kao,
yang.lee, linux-scsi, linux-kernel
Cc: Chanwoo Lee
An error unrelated to ufshcd_try_to_abort_task is being output and
can cause confusion. So, I modified it to output the result of abort
fail. This modification was similarly revised by referring to the
ufshcd_abort function.
Signed-off-by: Chanwoo Lee <cw9316.lee@samsung.com>
---
drivers/ufs/core/ufs-mcq.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
index 005d63ab1f44..fc24d1af1fe8 100644
--- a/drivers/ufs/core/ufs-mcq.c
+++ b/drivers/ufs/core/ufs-mcq.c
@@ -667,9 +667,11 @@ int ufshcd_mcq_abort(struct scsi_cmnd *cmd)
* in the completion queue either. Query the device to see if
* the command is being processed in the device.
*/
- if (ufshcd_try_to_abort_task(hba, tag)) {
+ err = ufshcd_try_to_abort_task(hba, tag);
+ if (err) {
dev_err(hba->dev, "%s: device abort failed %d\n", __func__, err);
lrbp->req_abort_skip = true;
+ err = FAILED;
goto out;
}
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ufs:mcq:Fixing Error Output for ufshcd_try_to_abort_task in ufshcd_mcq_abort
2024-05-23 0:22 ` [PATCH] ufs:mcq:Fixing Error Output for ufshcd_try_to_abort_task in ufshcd_mcq_abort Chanwoo Lee
@ 2024-05-23 22:43 ` Bart Van Assche
[not found] ` <CGME20240523235615epcas1p282b2405bed41b94ef8a40633066f1d4c@epcas1p2.samsung.com>
[not found] ` <CGME20240524001842epcas1p3a66b301f7aad3a8da28869db634221d1@epcas1p3.samsung.com>
2 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2024-05-23 22:43 UTC (permalink / raw)
To: Chanwoo Lee, alim.akhtar, avri.altman, James.Bottomley,
martin.petersen, stanley.chu, quic_nguyenb, quic_cang, powen.kao,
yang.lee, linux-scsi, linux-kernel
On 5/22/24 17:22, Chanwoo Lee wrote:
> An error unrelated to ufshcd_try_to_abort_task is being output and
> can cause confusion. So, I modified it to output the result of abort
> fail. This modification was similarly revised by referring to the
> ufshcd_abort function.
>
> Signed-off-by: Chanwoo Lee <cw9316.lee@samsung.com>
> ---
> drivers/ufs/core/ufs-mcq.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
> index 005d63ab1f44..fc24d1af1fe8 100644
> --- a/drivers/ufs/core/ufs-mcq.c
> +++ b/drivers/ufs/core/ufs-mcq.c
> @@ -667,9 +667,11 @@ int ufshcd_mcq_abort(struct scsi_cmnd *cmd)
> * in the completion queue either. Query the device to see if
> * the command is being processed in the device.
> */
> - if (ufshcd_try_to_abort_task(hba, tag)) {
> + err = ufshcd_try_to_abort_task(hba, tag);
> + if (err) {
> dev_err(hba->dev, "%s: device abort failed %d\n", __func__, err);
> lrbp->req_abort_skip = true;
> + err = FAILED;
> goto out;
> }
Why does the word "Fixing" occur in the title of this patch? I think
that this patch does not affect the value returned by
ufshcd_mcq_abort(). From the start of that function:
int err = FAILED;
Thanks,
Bart.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: [PATCH] ufs:mcq:Fixing Error Output for ufshcd_try_to_abort_task in ufshcd_mcq_abort
[not found] ` <CGME20240523235615epcas1p282b2405bed41b94ef8a40633066f1d4c@epcas1p2.samsung.com>
@ 2024-05-23 23:56 ` Chanwoo Lee
2024-05-24 0:08 ` Bart Van Assche
0 siblings, 1 reply; 5+ messages in thread
From: Chanwoo Lee @ 2024-05-23 23:56 UTC (permalink / raw)
To: cw9316.lee
Cc: James.Bottomley, alim.akhtar, avri.altman, bvanassche,
linux-kernel, linux-scsi, martin.petersen, powen.kao, quic_cang,
quic_nguyenb, stanley.chu, yang.lee
On 5/23/24 22:43, Bart Van Assche wrote:
>On 5/22/24 17:22, Chanwoo Lee wrote:
>> An error unrelated to ufshcd_try_to_abort_task is being output and
>> can cause confusion. So, I modified it to output the result of abort
>> fail. This modification was similarly revised by referring to the
>> ufshcd_abort function.
>>
>> Signed-off-by: Chanwoo Lee <cw9316.lee@samsung.com>
>> ---
>> drivers/ufs/core/ufs-mcq.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
>> index 005d63ab1f44..fc24d1af1fe8 100644
>> --- a/drivers/ufs/core/ufs-mcq.c
>> +++ b/drivers/ufs/core/ufs-mcq.c
>> @@ -667,9 +667,11 @@ int ufshcd_mcq_abort(struct scsi_cmnd *cmd)
>> * in the completion queue either. Query the device to see if
>> * the command is being processed in the device.
>> */
>> - if (ufshcd_try_to_abort_task(hba, tag)) {
>> + err = ufshcd_try_to_abort_task(hba, tag);
>> + if (err) {
>> dev_err(hba->dev, "%s: device abort failed %d\n", __func__, err);
>> lrbp->req_abort_skip = true;
>> + err = FAILED;
>> goto out;
>> }
>
>Why does the word "Fixing" occur in the title of this patch? I think
>that this patch does not affect the value returned by
>ufshcd_mcq_abort(). From the start of that function:
>
>int err = FAILED;
>
>Thanks,
>
>Bart.
I thought this patch would be appropriate to "fix" the following log.
* dev_err(hba->dev, "%s: device abort failed %d\n", __func__, err);
If "Fixing" is not appropriate, could you suggest another word?
Thanks,
Chanwoo Lee.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ufs:mcq:Fixing Error Output for ufshcd_try_to_abort_task in ufshcd_mcq_abort
2024-05-23 23:56 ` Chanwoo Lee
@ 2024-05-24 0:08 ` Bart Van Assche
0 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2024-05-24 0:08 UTC (permalink / raw)
To: Chanwoo Lee
Cc: James.Bottomley, alim.akhtar, avri.altman, linux-kernel,
linux-scsi, martin.petersen, powen.kao, quic_cang, quic_nguyenb,
stanley.chu, yang.lee
On 5/23/24 16:56, Chanwoo Lee wrote:
> I thought this patch would be appropriate to "fix" the following log.
> * dev_err(hba->dev, "%s: device abort failed %d\n", __func__, err);
> If "Fixing" is not appropriate, could you suggest another word?
That's something I had not noticed. This is indeed a bug fix. Please add
a "Fixes:" tag as is expected for bug fixes.
BTW, I think that ufshcd_mcq_abort() can be improved significantly. How
about reworking that function as follows before the bug reported in this
patch is fixed?
- Remove the local variable 'err' (and reintroduce that variable in your
patch).
- Change all 'goto out' statements into 'return FAILED'.
- Add 'return SUCCESS' at the end.
I expect that this change will make that function easier to read and to
maintain.
Thanks,
Bart.
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] ufs:mcq:Fixing Error Output for ufshcd_try_to_abort_task in ufshcd_mcq_abort
[not found] ` <CGME20240524001842epcas1p3a66b301f7aad3a8da28869db634221d1@epcas1p3.samsung.com>
@ 2024-05-24 0:18 ` Chanwoo Lee
0 siblings, 0 replies; 5+ messages in thread
From: Chanwoo Lee @ 2024-05-24 0:18 UTC (permalink / raw)
To: cw9316.lee
Cc: James.Bottomley, alim.akhtar, avri.altman, bvanassche,
linux-kernel, linux-scsi, martin.petersen, powen.kao, quic_cang,
quic_nguyenb, stanley.chu, yang.lee
On 5/24/24 12:08, Bart Van Assche wrote:
>On 5/23/24 16:56, Chanwoo Lee wrote:
>> I thought this patch would be appropriate to "fix" the following log.
>> * dev_err(hba->dev, "%s: device abort failed %d\n", __func__, err);
>> If "Fixing" is not appropriate, could you suggest another word?
>
>That's something I had not noticed. This is indeed a bug fix. Please add
>a "Fixes:" tag as is expected for bug fixes.
>
>BTW, I think that ufshcd_mcq_abort() can be improved significantly. How
>about reworking that function as follows before the bug reported in this
>patch is fixed?
>- Remove the local variable 'err' (and reintroduce that variable in your
>patch).
>- Change all 'goto out' statements into 'return FAILED'.
>- Add 'return SUCCESS' at the end.
>
>I expect that this change will make that function easier to read and to
>maintain.
>
>Thanks,
>
>Bart.
Thank you for the good suggestion.
I will create a new patch and reply with v2.
Thanks,
Chanwoo Lee.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-05-24 0:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20240523002322epcas1p2a63dfc646a2b2dd8fcadad2a8807bcee@epcas1p2.samsung.com>
2024-05-23 0:22 ` [PATCH] ufs:mcq:Fixing Error Output for ufshcd_try_to_abort_task in ufshcd_mcq_abort Chanwoo Lee
2024-05-23 22:43 ` Bart Van Assche
[not found] ` <CGME20240523235615epcas1p282b2405bed41b94ef8a40633066f1d4c@epcas1p2.samsung.com>
2024-05-23 23:56 ` Chanwoo Lee
2024-05-24 0:08 ` Bart Van Assche
[not found] ` <CGME20240524001842epcas1p3a66b301f7aad3a8da28869db634221d1@epcas1p3.samsung.com>
2024-05-24 0:18 ` Chanwoo Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®