RE: [PATCH] mmc: renesas_sdhi: fix regression with hard reset on old SDHIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram,

On my RZ/G2L board, if I configure card detection irq from SDHI, instead of card detection using gpio interrupt, then it is missing card detection interrupt after reset. 

Just wondering, does it work on R-Car with CD irq from SDHI instead of card detection using gpio interrupt?

With the below changes, I am getting cd interrupts from SDHI after reset.

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index a4407f391f66..32f34de1a2a6 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -561,6 +561,8 @@ static void renesas_sdhi_reset(struct tmio_mmc_host *host)
                /* Unknown why but without polling reset status, it will hang */
                read_poll_timeout(reset_control_status, ret, ret == 0, 1, 100,
                                  false, priv->rstc);
+
+               tmio_mmc_enable_mmc_irqs(host, TMIO_MASK_CMD);
                /* At least SDHI_VER_GEN2_SDR50 needs manual release of reset */


Regards,
Biju


> -----Original Message-----
> From: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> Sent: 26 August 2021 09:21
> To: linux-mmc@xxxxxxxxxxxxxxx
> Cc: linux-renesas-soc@xxxxxxxxxxxxxxx; Geert Uytterhoeven
> <geert+renesas@xxxxxxxxx>; Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@xxxxxxxxxxx>; Wolfram Sang <wsa+renesas@sang-
> engineering.com>
> Subject: [PATCH] mmc: renesas_sdhi: fix regression with hard reset on old
> SDHIs
> 
> Old SDHI instances have a default value for the reset register which keeps
> it in reset state by default. So, when applying a hard reset we need to
> manually leave the soft reset state as well. Later SDHI instances have a
> different default value, the one we write manually now.
> 
> Fixes: b4d86f37eacb ("mmc: renesas_sdhi: do hard reset if possible")
> Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> ---
> 
> Geez, typical SDHI nastiness here...
> 
> Geert: I think this fixes the issue you saw on Koelsch. It works fine on
> my Lager now at least. Can you please test and tag if all goes well?
> It would be great to have this in 5.14 but it definately needs Geert's
> confirmation first.
> 
>  drivers/mmc/host/renesas_sdhi_core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c
> b/drivers/mmc/host/renesas_sdhi_core.c
> index 6fc4cf3c9dce..a4407f391f66 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -561,6 +561,8 @@ static void renesas_sdhi_reset(struct tmio_mmc_host
> *host)
>  		/* Unknown why but without polling reset status, it will hang
> */
>  		read_poll_timeout(reset_control_status, ret, ret == 0, 1, 100,
>  				  false, priv->rstc);
> +		/* At least SDHI_VER_GEN2_SDR50 needs manual release of reset
> */
> +		sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
>  		priv->needs_adjust_hs400 = false;
>  		renesas_sdhi_set_clock(host, host->clk_cache);
>  	} else if (priv->scc_ctl) {
> --
> 2.30.2





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux