Re: [PATCH v8 17/23] scsi: ufs: mediatek: Rework ufs_mtk_wait_idle_state
From: Peter Wang (王信友)
Date: Thu Mar 05 2026 - 04:38:40 EST
On Wed, 2026-03-04 at 15:53 +0100, Nicolas Frattaroli wrote:
> While ufs_mtk_wait_idle state has some code smells for me (the
> VS_HCE_BASE early exit seems racey at best), it can still benefit
> from
> some general cleanup to make the code flow less convoluted.
>
> Use the iopoll helpers, for one, and specifically the one that sleeps
> and does not busy delay, as it's being done for up to 5ms.
>
> The register read is split out to a helper function that branches
> between new and old style flow.
>
> Every called uses the same 5ms timeout value, so there is no point in
> making this a parameter. Just assume a 5ms timeout in the function.
>
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@xxxxxxxxxxxxx>
Reviewed-by: Peter Wang <peter.wang@xxxxxxxxxxxx>