diff mbox series

[linux,dev-5.2,3/5] mmc: sdhci-of-aspeed: Uphold clocks-on post-condition of set_clock()

Message ID 20190830090244.13566-4-andrew@aj.id.au
State Superseded, archived
Headers show
Series mmc: sdhci-of-aspeed: Fixes for AST2600 eMMC | expand

Commit Message

Andrew Jeffery Aug. 30, 2019, 9:02 a.m. UTC
The early-exit didn't seem to matter on the AST2500, but on the AST2600
the SD clock genuinely may not be running on entry to
aspeed_sdhci_set_clock(). Remove the early exit to ensure we always run
sdhci_enable_clk().

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 drivers/mmc/host/sdhci-of-aspeed.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Joel Stanley Sept. 2, 2019, 12:38 a.m. UTC | #1
On Fri, 30 Aug 2019 at 09:02, Andrew Jeffery <andrew@aj.id.au> wrote:
>
> The early-exit didn't seem to matter on the AST2500, but on the AST2600
> the SD clock genuinely may not be running on entry to
> aspeed_sdhci_set_clock(). Remove the early exit to ensure we always run
> sdhci_enable_clk().
>
> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

I don't quite understand what this was doing in the original patch.
The fix is good though, I tested it.

Tested-by: Joel Stanley <joel@jms.id.au>


> ---
>  drivers/mmc/host/sdhci-of-aspeed.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c
> index 6ae81c8af431..0b75806ed69d 100644
> --- a/drivers/mmc/host/sdhci-of-aspeed.c
> +++ b/drivers/mmc/host/sdhci-of-aspeed.c
> @@ -55,9 +55,6 @@ static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
>         int div;
>         u16 clk;
>
> -       if (clock == host->clock)
> -               return;
> -
>         sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
>
>         if (clock == 0)
> --
> 2.20.1
>
Andrew Jeffery Sept. 2, 2019, 12:43 a.m. UTC | #2
On Mon, 2 Sep 2019, at 10:08, Joel Stanley wrote:
> On Fri, 30 Aug 2019 at 09:02, Andrew Jeffery <andrew@aj.id.au> wrote:
> >
> > The early-exit didn't seem to matter on the AST2500, but on the AST2600
> > the SD clock genuinely may not be running on entry to
> > aspeed_sdhci_set_clock(). Remove the early exit to ensure we always run
> > sdhci_enable_clk().
> >
> > Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
> 
> I don't quite understand what this was doing in the original patch.
> The fix is good though, I tested it.

What do you mean? You already had questions about it?  Would have been nice
to pipe up at the time if so :D

> 
> Tested-by: Joel Stanley <joel@jms.id.au>

Thanks,

Andrew
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c
index 6ae81c8af431..0b75806ed69d 100644
--- a/drivers/mmc/host/sdhci-of-aspeed.c
+++ b/drivers/mmc/host/sdhci-of-aspeed.c
@@ -55,9 +55,6 @@  static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
 	int div;
 	u16 clk;
 
-	if (clock == host->clock)
-		return;
-
 	sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
 
 	if (clock == 0)