Re: [PATCH v2 2/4] mmc: sdhci_am654: Reset command and data lines on failed tuning
"Mendez, Judith" <[email protected]> Mon, 3 Aug 2026 14:28:19 -0500
| Newsgroups | org.kernel.vger.linux-mmc,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <[email protected]> |
Hi Diogo,
On 8/3/2026 8:47 AM, Diogo Ivo (Schneider Electric) wrote:
> The CMD/DATA reset after tuning should be performed regardless of
> whether tuning succeeded or failed, since tuning data may remain in
> the buffer in either case. Move the error return after the reset so
> that the controller is always cleaned up.
>
> Fixes: de31f6ab68a3 ("mmc: sdhci_am654: Reset Command and Data line after tuning")
> Cc: <[email protected]>
> Signed-off-by: Diogo Ivo (Schneider Electric) <[email protected]>
Reviewed-by: Judith Mendez <[email protected]>
> ---
> Changes in v2:
> - No changes
> ---
> drivers/mmc/host/sdhci_am654.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c
> index 35c3efd92112..0db587e702ac 100644
> --- a/drivers/mmc/host/sdhci_am654.c
> +++ b/drivers/mmc/host/sdhci_am654.c
> @@ -442,15 +442,13 @@ static int sdhci_am654_execute_tuning(struct mmc_host *mmc, u32 opcode)
> struct sdhci_host *host = mmc_priv(mmc);
> int err = sdhci_execute_tuning(mmc, opcode);
>
> - if (err)
> - return err;
> /*
> * Tuning data remains in the buffer after tuning.
> * Do a command and data reset to get rid of it
> */
> sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
>
> - return 0;
> + return err;
> }
>
> static u32 sdhci_am654_cqhci_irq(struct sdhci_host *host, u32 intmask)
>