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

Peter Wang (王信友) peter.wang at mediatek.com
Fri Sep 13 00:10:05 PDT 2024


On Thu, 2024-09-12 at 14:17 -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/12/24 6:31 AM, Peter Wang (王信友) wrote:
> > in SDB mode:
> > ufshcd_utrl_clear set UTRLC, Mediatek host controller
> > (may not all host controller) will post response with OCS ABORTED.
> > 
> > In both cases, we have an interrupt sent to the host, and there
> > may be a race condition before we set this flag for requeue.
> > So I need to set this flag before ufshcd_clear_cmd.
> 
> If a completion interrupt is sent to the host if a command has been
> cleared in SDB mode (I doubt this is what happens), I think that's a
> severe controller bug. A UFSHCI controller is not allowed to send a
> completion interrupt to the host if a command is cleared by writing
> into
> the UTRLCLR register.
> 
> Thanks,
> 
> Bart.

Hi Bart,

Because the MediaTek UFS controller uses UTRLCLR to clear 
commands and fills OCS with ABORTED. 

Regarding the specification of UTRCS:
This bit is set to '1' by the host controller upon one of the
following:
	Overall command Status (OCS) of the completed command is not 
	equal to 'SUCCESS' even if its UTRD Interrupt bit set to '0'

So, MediaTek host controller will send interrupt in this case.

Thanks.
Peter


More information about the Linux-mediatek mailing list