From: Eddie James <eajames@linux.ibm.com>
To: openbmc@lists.ozlabs.org
Cc: joel@jms.id.au, andrew@aj.id.au, Eddie James <eajames@linux.ibm.com>
Subject: [PATCH linux dev-5.7 v2 2/2] mmc: sdhci-of-aspeed: Fix clock divider calculation
Date: Thu, 9 Jul 2020 14:41:13 -0500 [thread overview]
Message-ID: <20200709194113.12119-3-eajames@linux.ibm.com> (raw)
In-Reply-To: <20200709194113.12119-1-eajames@linux.ibm.com>
When calculating the clock divider, start dividing at 2 instead of 1.
The divider is divided by two at the end of the calculation, so starting
at 1 may result in a divider of 0, which shouldn't happen.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
drivers/mmc/host/sdhci-of-aspeed.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c
index 56912e30c47e..a1bcc0f4ba9e 100644
--- a/drivers/mmc/host/sdhci-of-aspeed.c
+++ b/drivers/mmc/host/sdhci-of-aspeed.c
@@ -68,7 +68,7 @@ static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
if (WARN_ON(clock > host->max_clk))
clock = host->max_clk;
- for (div = 1; div < 256; div *= 2) {
+ for (div = 2; div < 256; div *= 2) {
if ((parent / div) <= clock)
break;
}
--
2.24.0
next prev parent reply other threads:[~2020-07-09 19:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-09 19:41 [PATCH linux dev-5.7 v2 0/2] clk: Aspeed: Fix eMMC clock speeds Eddie James
2020-07-09 19:41 ` [PATCH linux dev-5.7 v2 1/2] clk: AST2600: Add mux for EMMC clock Eddie James
2020-07-09 19:41 ` Eddie James [this message]
2020-07-10 1:14 ` [PATCH linux dev-5.7 v2 2/2] mmc: sdhci-of-aspeed: Fix clock divider calculation Andrew Jeffery
2020-07-10 13:13 ` [PATCH linux dev-5.7 v2 0/2] clk: Aspeed: Fix eMMC clock speeds Patrick Williams
2020-07-10 13:33 ` Andrew Jeffery
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200709194113.12119-3-eajames@linux.ibm.com \
--to=eajames@linux.ibm.com \
--cc=andrew@aj.id.au \
--cc=joel@jms.id.au \
--cc=openbmc@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.