* [PATCH] Revert "mmc: sdhci: Disable SD card clock before changing parameters"
@ 2025-06-24 11:09 Ulf Hansson
2025-06-24 11:29 ` Adrian Hunter
0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2025-06-24 11:09 UTC (permalink / raw)
To: linux-mmc, Ulf Hansson
Cc: linux-kernel, Erick Shepherd, stable, Adrian Hunter, Jonathan Liu,
Salvatore Bonaccorso
It has turned out the trying to strictly conform to the SDHCI specification
is causing problems. Let's revert and start over.
This reverts commit fb3bbc46c94f261b6156ee863c1b06c84cf157dc.
Cc: Erick Shepherd <erick.shepherd@ni.com>
Cc: stable@vger.kernel.org
Fixes: fb3bbc46c94f ("mmc: sdhci: Disable SD card clock before changing parameters")
Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Reported-by: Jonathan Liu <net147@gmail.com>
Reported-by: Salvatore Bonaccorso <carnil@debian.org>
Closes: https://bugs.debian.org/1108065
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/mmc/host/sdhci.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 4c6c2cc93c41..3a17821efa5c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2065,15 +2065,10 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
host->mmc->actual_clock = 0;
- clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
- if (clk & SDHCI_CLOCK_CARD_EN)
- sdhci_writew(host, clk & ~SDHCI_CLOCK_CARD_EN,
- SDHCI_CLOCK_CONTROL);
+ sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
- if (clock == 0) {
- sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
+ if (clock == 0)
return;
- }
clk = sdhci_calc_clk(host, clock, &host->mmc->actual_clock);
sdhci_enable_clk(host, clk);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Revert "mmc: sdhci: Disable SD card clock before changing parameters"
2025-06-24 11:09 [PATCH] Revert "mmc: sdhci: Disable SD card clock before changing parameters" Ulf Hansson
@ 2025-06-24 11:29 ` Adrian Hunter
2025-06-24 12:19 ` Ulf Hansson
0 siblings, 1 reply; 3+ messages in thread
From: Adrian Hunter @ 2025-06-24 11:29 UTC (permalink / raw)
To: Ulf Hansson, linux-mmc
Cc: linux-kernel, Erick Shepherd, stable, Jonathan Liu,
Salvatore Bonaccorso
On 24/06/2025 14:09, Ulf Hansson wrote:
> It has turned out the trying to strictly conform to the SDHCI specification
> is causing problems. Let's revert and start over.
>
> This reverts commit fb3bbc46c94f261b6156ee863c1b06c84cf157dc.
>
> Cc: Erick Shepherd <erick.shepherd@ni.com>
> Cc: stable@vger.kernel.org
> Fixes: fb3bbc46c94f ("mmc: sdhci: Disable SD card clock before changing parameters")
> Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
> Reported-by: Jonathan Liu <net147@gmail.com>
> Reported-by: Salvatore Bonaccorso <carnil@debian.org>
> Closes: https://bugs.debian.org/1108065
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/mmc/host/sdhci.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 4c6c2cc93c41..3a17821efa5c 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2065,15 +2065,10 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
>
> host->mmc->actual_clock = 0;
>
> - clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
> - if (clk & SDHCI_CLOCK_CARD_EN)
> - sdhci_writew(host, clk & ~SDHCI_CLOCK_CARD_EN,
> - SDHCI_CLOCK_CONTROL);
> + sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
>
> - if (clock == 0) {
> - sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
> + if (clock == 0)
> return;
> - }
>
> clk = sdhci_calc_clk(host, clock, &host->mmc->actual_clock);
> sdhci_enable_clk(host, clk);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Revert "mmc: sdhci: Disable SD card clock before changing parameters"
2025-06-24 11:29 ` Adrian Hunter
@ 2025-06-24 12:19 ` Ulf Hansson
0 siblings, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2025-06-24 12:19 UTC (permalink / raw)
To: Adrian Hunter
Cc: linux-mmc, linux-kernel, Erick Shepherd, stable, Jonathan Liu,
Salvatore Bonaccorso
On Tue, 24 Jun 2025 at 13:30, Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> On 24/06/2025 14:09, Ulf Hansson wrote:
> > It has turned out the trying to strictly conform to the SDHCI specification
> > is causing problems. Let's revert and start over.
> >
> > This reverts commit fb3bbc46c94f261b6156ee863c1b06c84cf157dc.
> >
> > Cc: Erick Shepherd <erick.shepherd@ni.com>
> > Cc: stable@vger.kernel.org
> > Fixes: fb3bbc46c94f ("mmc: sdhci: Disable SD card clock before changing parameters")
> > Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
> > Reported-by: Jonathan Liu <net147@gmail.com>
> > Reported-by: Salvatore Bonaccorso <carnil@debian.org>
> > Closes: https://bugs.debian.org/1108065
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>
> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
>
Thanks, applied for fixes!
Kind regards
Uffe
> > ---
> > drivers/mmc/host/sdhci.c | 9 ++-------
> > 1 file changed, 2 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> > index 4c6c2cc93c41..3a17821efa5c 100644
> > --- a/drivers/mmc/host/sdhci.c
> > +++ b/drivers/mmc/host/sdhci.c
> > @@ -2065,15 +2065,10 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
> >
> > host->mmc->actual_clock = 0;
> >
> > - clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
> > - if (clk & SDHCI_CLOCK_CARD_EN)
> > - sdhci_writew(host, clk & ~SDHCI_CLOCK_CARD_EN,
> > - SDHCI_CLOCK_CONTROL);
> > + sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
> >
> > - if (clock == 0) {
> > - sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
> > + if (clock == 0)
> > return;
> > - }
> >
> > clk = sdhci_calc_clk(host, clock, &host->mmc->actual_clock);
> > sdhci_enable_clk(host, clk);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-24 12:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 11:09 [PATCH] Revert "mmc: sdhci: Disable SD card clock before changing parameters" Ulf Hansson
2025-06-24 11:29 ` Adrian Hunter
2025-06-24 12:19 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox