Re: [PATCH v7 17/23] scsi: ufs: mediatek: Rework ufs_mtk_wait_idle_state

From: Peter Wang (王信友)

Date: Wed Feb 25 2026 - 22:43:27 EST


On Wed, 2026-02-25 at 13:33 +0100, AngeloGioacchino Del Regno wrote:
> The logic is practically the same, except it's proper now.
>
> There's no need to wait for `sm = VS_HCE_BASE` if `sm ==
> VS_HCE_BASE`.
>
> In other words, just read the comment that Nicolas has put in the
> code:
> /* If the device is already in the base state after 10us, don't wait.
> */
>
> ...because there's no need to wait for the device to get to BASE
> state,
> if the device is *already* in BASE state. It's pretty obvious stuff
> here.
>
> Regards,
> Angelo

Hi AngeloGioacchino,

You missed my point.
Yes, it's true that if the device is already in the base
state after 10 μs, you don't need to wait.
But if the device is in another state after 10 μs, such
as VS_HCE_DME_RESET, you also don't need to wait.

Besides, if after 10 μs the read state is between
VS_HIB_EXIT and VS_HIB_ENTER, then you should wait until
it reaches VS_HCE_BASE, not another state like VS_HCE_DME_RESET.

Thanks.
Peter