[PATCH v3 2/2] ufs: core: requeue aborted request

Peter Wang (王信友) peter.wang at mediatek.com
Mon Sep 9 22:40:34 PDT 2024


On Mon, 2024-09-09 at 09:34 -0700, Bart Van Assche wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On 9/9/24 1:21 AM, peter.wang at mediatek.com wrote:
> > diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-
> mcq.c
> > index 3903947dbed1..1f57ebf24a39 100644
> > --- a/drivers/ufs/core/ufs-mcq.c
> > +++ b/drivers/ufs/core/ufs-mcq.c
> > @@ -642,6 +642,7 @@ static bool ufshcd_mcq_sqe_search(struct
> ufs_hba *hba,
> >   match = le64_to_cpu(utrd->command_desc_base_addr) & CQE_UCD_BA;
> >   if (addr == match) {
> >   ufshcd_mcq_nullify_sqe(utrd);
> > +lrbp->abort_initiated_by_err = true;
> >   ret = true;
> >   goto out;
> >   }
> 
> As mentioned before, I think that this change is wrong. Setting
> lrbp->abort_initiated_by_err affects the value of scsi_cmnd::result.
> This member variable is ignored for aborted commands. Although the
> above change does not affect the SCSI error handler, I think it
> should
> be left out because it will confuse anyone who reads the UFS driver
> code
> and who has not followed this discussion.
> 

Hi Bart,

Since this is unlikely to happen and the code is not expected 
to reach here, I think it's better to wait and see if it occurs.
And open a discussion on how to deal with this case if occurs.
I will remove it in the next version.


> > @@ -7561,6 +7552,16 @@ int ufshcd_try_to_abort_task(struct ufs_hba
> *hba, int tag)
> >   goto out;
> >   }
> >   
> > +/*
> > + * When the host software receives a "FUNCTION COMPLETE", set flag
> > + * to requeue command after receive response with OCS_ABORTED
> > + * SDB mode: UTRLCLR Task Management response which means a
> Transfer
> > + *           Request was aborted.
> > + * MCQ mode: Host will post to CQ with OCS_ABORTED after SQ
> cleanup
> > + */
> > +if (!err)
> > +lrbp->abort_initiated_by_err = true;
> 
> Please add a comment that explains that the purpose of this code is
> to 
> requeue commands aborted by ufshcd_abort_all().
> 

Okay, I will add more comment.

> > + * @abort_initiated_by_err: abort initiated by error
> 
> The member variable name and also the explanation of this member
> variable are incomprehensible to me.
> 

I will add more flag description too.

Thanks.
Peter


> Thanks,
> 
> Bart.


More information about the Linux-mediatek mailing list