[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OS0PR01MB59222DB7B5BE666FE8774F308630A@OS0PR01MB5922.jpnprd01.prod.outlook.com>
Date: Mon, 10 Jul 2023 14:35:31 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>,
"linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>
CC: Ulf Hansson <ulf.hansson@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH RFT] mmc: renesas_sdhi: register irqs before registering
controller
Hi Wolfram Sang,
Thanks for the patch.
> -----Original Message-----
> From: Wolfram Sang <wsa+renesas@...g-engineering.com>
> Sent: Monday, July 10, 2023 3:08 PM
> To: linux-renesas-soc@...r.kernel.org; linux-mmc@...r.kernel.org
> Cc: Wolfram Sang <wsa+renesas@...g-engineering.com>; Ulf Hansson
> <ulf.hansson@...aro.org>; linux-kernel@...r.kernel.org
> Subject: [PATCH RFT] mmc: renesas_sdhi: register irqs before registering
> controller
>
> IRQs should be ready to serve when we call mmc_add_host() via
> tmio_mmc_host_probe(). To achieve that, ensure that all irqs are masked
> before registering the handlers.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
Tested-by: Biju Das <biju.das.jz@...renesas.com>
> ---
>
> Based on 6.5-rc1 with bf54dec9e953 ("Revert "mmc: Revert "mmc: core:
> Allow mmc_start_host() synchronously detect a card") reverted. That base
> alone shows the regression. This patch works fine on a Salvator-X with a
> M3-W. I'll test more boards. Yet, I send it out so people can tests with
> boards I don't have.
Tested on RZ/V2L SMARC EVK, after Revert "mmc: Revert "mmc: core: Allow mmc_start_host() synchronously detect a card""
Cheers,
Biju
>
> drivers/mmc/host/renesas_sdhi_core.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c
> b/drivers/mmc/host/renesas_sdhi_core.c
> index 345934e4f59e..499d043f034f 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -1004,10 +1004,11 @@ int renesas_sdhi_probe(struct platform_device
> *pdev,
> host->ops.start_signal_voltage_switch =
> renesas_sdhi_start_signal_voltage_switch;
> host->sdcard_irq_setbit_mask = TMIO_STAT_ALWAYS_SET_27;
> - host->sdcard_irq_mask_all = TMIO_MASK_ALL_RCAR2;
> host->reset = renesas_sdhi_reset;
> }
>
> + host->sdcard_irq_mask_all = TMIO_MMC_MIN_RCAR2 ?
> TMIO_MASK_ALL_RCAR2 :
> +TMIO_MASK_ALL;
> +
> /* Orginally registers were 16 bit apart, could be 32 or 64
> nowadays */
> if (!host->bus_shift && resource_size(res) > 0x100) /* old way to
> determine the shift */
> host->bus_shift = 1;
> @@ -1100,9 +1101,7 @@ int renesas_sdhi_probe(struct platform_device
> *pdev,
> host->ops.hs400_complete = renesas_sdhi_hs400_complete;
> }
>
> - ret = tmio_mmc_host_probe(host);
> - if (ret < 0)
> - goto edisclk;
> + sd_ctrl_write32_as_16_and_16(host, CTL_IRQ_MASK,
> +host->sdcard_irq_mask_all);
>
> num_irqs = platform_irq_count(pdev);
> if (num_irqs < 0) {
> @@ -1129,6 +1128,10 @@ int renesas_sdhi_probe(struct platform_device
> *pdev,
> goto eirq;
> }
>
> + ret = tmio_mmc_host_probe(host);
> + if (ret < 0)
> + goto edisclk;
> +
> dev_info(&pdev->dev, "%s base at %pa, max clock rate %u MHz\n",
> mmc_hostname(host->mmc), &res->start, host->mmc->f_max /
> 1000000);
>
> --
> 2.35.1
Powered by blists - more mailing lists