All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Courbot <acourbot@nvidia.com>
To: Tim Kryger <tim.kryger@gmail.com>,
	Sachin Kamat <spk.linux@gmail.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Alexandre Courbot <gnurou@gmail.com>
Subject: Possible regression with commit 52221610d
Date: Tue, 4 Nov 2014 12:05:04 +0900	[thread overview]
Message-ID: <54584260.8030602@nvidia.com> (raw)

Hi guys,

On the NVIDIA shield (tegra114-roth) platform, I have noticed that MMC 
stopped working completely on recent kernels. MMC devices will not show 
up and the message "mmc1: Controller never released inhibit bit(s)." 
shows up repeatedly in the console.

After bisecting I tracked commit 
52221610dd84dc3e9196554f0292ca9e8ab3541d ("mmc: sdhci: Improve external 
VDD regulator support") as the one that introduced this issue, which 
seems somehow surprising to me since it has been around for a while and 
nobody else complained about this AFAICT.

The following diff solves the issue for me, however I don't know whether 
it also reverts the intended purpose of the initial patch:

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index ada1a3ea3a87..615701bb8ea3 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1235,13 +1235,6 @@ static void sdhci_set_power(struct sdhci_host 
*host, unsigned char mode,
         struct mmc_host *mmc = host->mmc;
         u8 pwr = 0;

-       if (!IS_ERR(mmc->supply.vmmc)) {
-               spin_unlock_irq(&host->lock);
-               mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
-               spin_lock_irq(&host->lock);
-               return;
-       }
-
         if (mode != MMC_POWER_OFF) {
                 switch (1 << vdd) {
                 case MMC_VDD_165_195:
@@ -1300,6 +1293,12 @@ static void sdhci_set_power(struct sdhci_host 
*host, unsigned char mode,
                 if (host->quirks & SDHCI_QUIRK_DELAY_AFTER_POWER)
                         mdelay(10);
         }
+
+       if (!IS_ERR(mmc->supply.vmmc)) {
+               spin_unlock_irq(&host->lock);
+               mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
+               spin_lock_irq(&host->lock);
+       }
  }

Does this look like the right approach? If not, would you have any 
suggestion as to how to solve this problem?

Thanks,
Alex.

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Courbot <acourbot@nvidia.com>
To: Tim Kryger <tim.kryger@gmail.com>,
	Sachin Kamat <spk.linux@gmail.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Alexandre Courbot <gnurou@gmail.com>
Subject: Possible regression with commit 52221610d
Date: Tue, 4 Nov 2014 12:05:04 +0900	[thread overview]
Message-ID: <54584260.8030602@nvidia.com> (raw)

Hi guys,

On the NVIDIA shield (tegra114-roth) platform, I have noticed that MMC 
stopped working completely on recent kernels. MMC devices will not show 
up and the message "mmc1: Controller never released inhibit bit(s)." 
shows up repeatedly in the console.

After bisecting I tracked commit 
52221610dd84dc3e9196554f0292ca9e8ab3541d ("mmc: sdhci: Improve external 
VDD regulator support") as the one that introduced this issue, which 
seems somehow surprising to me since it has been around for a while and 
nobody else complained about this AFAICT.

The following diff solves the issue for me, however I don't know whether 
it also reverts the intended purpose of the initial patch:

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index ada1a3ea3a87..615701bb8ea3 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1235,13 +1235,6 @@ static void sdhci_set_power(struct sdhci_host 
*host, unsigned char mode,
         struct mmc_host *mmc = host->mmc;
         u8 pwr = 0;

-       if (!IS_ERR(mmc->supply.vmmc)) {
-               spin_unlock_irq(&host->lock);
-               mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
-               spin_lock_irq(&host->lock);
-               return;
-       }
-
         if (mode != MMC_POWER_OFF) {
                 switch (1 << vdd) {
                 case MMC_VDD_165_195:
@@ -1300,6 +1293,12 @@ static void sdhci_set_power(struct sdhci_host 
*host, unsigned char mode,
                 if (host->quirks & SDHCI_QUIRK_DELAY_AFTER_POWER)
                         mdelay(10);
         }
+
+       if (!IS_ERR(mmc->supply.vmmc)) {
+               spin_unlock_irq(&host->lock);
+               mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
+               spin_lock_irq(&host->lock);
+       }
  }

Does this look like the right approach? If not, would you have any 
suggestion as to how to solve this problem?

Thanks,
Alex.

             reply	other threads:[~2014-11-04  3:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04  3:05 Alexandre Courbot [this message]
2014-11-04  3:05 ` Possible regression with commit 52221610d Alexandre Courbot
2014-11-04  5:28 ` Tim Kryger
2014-11-04  9:00   ` Alexandre Courbot
2014-11-04 15:31     ` Tim Kryger
2014-11-05  8:10       ` Alexandre Courbot
2014-11-05 15:27         ` Tim Kryger
2014-11-06  2:15           ` Alexandre Courbot
2014-12-14  7:22       ` Bjorn Andersson
2014-12-15  4:48         ` Tim Kryger
2014-12-16  6:27           ` Bjorn Andersson
2014-12-16 18:18             ` Bjorn Andersson
2014-12-17  6:20               ` Tim Kryger
2014-12-17 19:57                 ` Bjorn Andersson
2014-12-22  3:01                   ` Tim Kryger
2015-01-05 19:52                     ` Bjorn Andersson
2015-01-12 10:31                       ` Ulf Hansson
2015-01-13 16:00                         ` Tim Kryger
2015-01-13 15:59                       ` Tim Kryger
2015-01-14  5:00                     ` Tim Kryger
2014-12-16 18:46           ` Stephen Warren

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=54584260.8030602@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=gnurou@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=spk.linux@gmail.com \
    --cc=tim.kryger@gmail.com \
    --cc=ulf.hansson@linaro.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.