All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Reimer <mreimer@sdgsystems.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Possible bug in sdhci.c
Date: Thu, 19 Feb 2015 11:33:24 -0700	[thread overview]
Message-ID: <1FC05FA2-CB70-4338-98D0-30E9BDA245F7@sdgsystems.com> (raw)

In sdhci_init() a writel() is used on a byte-sized register, which would clobber the adjacent registers. Below is my suggested fix. If it looks correct, I can submit a proper patch.

Matt


diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 82d7984..1f8917b 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -412,7 +412,7 @@ static int sdhci_init(struct mmc *mmc)
        if (host->quirks & SDHCI_QUIRK_NO_CD) {
                unsigned int status;
 
-               sdhci_writel(host, SDHCI_CTRL_CD_TEST_INS | SDHCI_CTRL_CD_TEST,
+               sdhci_writeb(host, SDHCI_CTRL_CD_TEST_INS | SDHCI_CTRL_CD_TEST,
                        SDHCI_HOST_CONTROL);
 
                status = sdhci_readl(host, SDHCI_PRESENT_STATE);

             reply	other threads:[~2015-02-19 18:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-19 18:33 Matt Reimer [this message]
2015-02-23 17:57 ` [U-Boot] Possible bug in sdhci.c Pantelis Antoniou
2015-02-23 21:56   ` [U-Boot] [PATCH] mmc: sdhci: don't clobber adjacent registers Matt Reimer
2015-03-02 18:31     ` Matt Reimer
2015-03-02 18:31     ` Pantelis Antoniou
2015-03-18  7:53     ` Pantelis Antoniou

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=1FC05FA2-CB70-4338-98D0-30E9BDA245F7@sdgsystems.com \
    --to=mreimer@sdgsystems.com \
    --cc=u-boot@lists.denx.de \
    /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.