diff mbox

powerpc/corenet: enable eSDHC

Message ID BY1PR0301MB119286F6B8EBD6EED07C8B15F2BF0@BY1PR0301MB1192.namprd03.prod.outlook.com (mailing list archive)
State Not Applicable
Delegated to: Scott Wood
Headers show

Commit Message

Yangbo Lu June 8, 2015, 10:12 a.m. UTC
Thanks a lot, Scott.
And now a patch was merged on git://git.linaro.org/people/ulf.hansson/mmc.git next branch to fix this issue.
It should be no problem.


From 5fd26c7ecb32082745b0bd33c8e35badd1cb5a91 Mon Sep 17 00:00:00 2001
From: Ulf Hansson <ulf.hansson@linaro.org>
Date: Fri, 5 Jun 2015 11:40:08 +0200
Subject: [PATCH] mmc: sdhci: Restore behavior while creating OCR mask

Commit 3a48edc4bd68 ("mmc: sdhci: Use mmc core regulator infrastucture")
changed the behavior for how to assign the ocr_avail mask for the mmc
host. More precisely it started to mask the bits instead of assigning
them.

Restore the behavior, but also make it clear that an OCR mask created
from an external regulator overrides the other ones. The OCR mask is
determined by one of the following with this priority:

1. Supported ranges of external regulator if one supplies VDD
2. Host OCR mask if set by the driver (based on DT properties)
3. The capabilities reported by the controller itself

Fixes: 3a48edc4bd68 ("mmc: sdhci: Use mmc core regulator infrastucture")
Cc: Tim Kryger <tim.kryger@gmail.com>
Reported-by: Yangbo Lu <yangbo.lu@freescale.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Tim Kryger <tim.kryger@gmail.com>
---
 drivers/mmc/host/sdhci.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Scott Wood June 8, 2015, 8:30 p.m. UTC | #1
On Mon, 2015-06-08 at 05:12 -0500, Lu Yangbo-B47093 wrote:
> Thanks a lot, Scott.
> And now a patch was merged on 
> git://git.linaro.org/people/ulf.hansson/mmc.git next branch to fix 
> this issue.
> It should be no problem.

Assuming that patch fixes it and gets pulled for 4.2, this config 
patch can go in for 4.3.

That said, it would be nice if, apart from fixing the problem itself, 
the MMC code failed more gracefully instead of endlessly repeating and 
filling up the log/console.

-Scott
Yangbo Lu July 16, 2015, 2:37 a.m. UTC | #2
Hi Scott,

Now the patch below has been merged on git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git.
This issue should have been resolved. 
Thanks.


commit 5fd26c7ecb32082745b0bd33c8e35badd1cb5a91
Author: Ulf Hansson <ulf.hansson@linaro.org>
Date:   Fri Jun 5 11:40:08 2015 +0200

    mmc: sdhci: Restore behavior while creating OCR mask


> -----Original Message-----

> From: Wood Scott-B07421

> Sent: Tuesday, June 09, 2015 4:31 AM

> To: Lu Yangbo-B47093

> Cc: linuxppc-dev@lists.ozlabs.org; linux-mmc@vger.kernel.org

> Subject: Re: powerpc/corenet: enable eSDHC

> 

> On Mon, 2015-06-08 at 05:12 -0500, Lu Yangbo-B47093 wrote:

> > Thanks a lot, Scott.

> > And now a patch was merged on

> > git://git.linaro.org/people/ulf.hansson/mmc.git next branch to fix

> > this issue.

> > It should be no problem.

> 

> Assuming that patch fixes it and gets pulled for 4.2, this config patch

> can go in for 4.3.

> 

> That said, it would be nice if, apart from fixing the problem itself, the

> MMC code failed more gracefully instead of endlessly repeating and

> filling up the log/console.

> 

> -Scott
Scott Wood July 16, 2015, 8:30 p.m. UTC | #3
OK, thanks.  Assuming no similar issues when testing, I'll apply this patch 
the next time I do a batch of patch application.

Any thoughts regarding better error handling?

-Scott

On Wed, 2015-07-15 at 21:37 -0500, Lu Yangbo-B47093 wrote:
> Hi Scott,
> 
> Now the patch below has been merged on 
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git.
> This issue should have been resolved. 
> Thanks.
> 
> 
> commit 5fd26c7ecb32082745b0bd33c8e35badd1cb5a91
> Author: Ulf Hansson <ulf.hansson@linaro.org>
> Date:   Fri Jun 5 11:40:08 2015 +0200
> 
>     mmc: sdhci: Restore behavior while creating OCR mask
> 
> 
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Tuesday, June 09, 2015 4:31 AM
> > To: Lu Yangbo-B47093
> > Cc: linuxppc-dev@lists.ozlabs.org; linux-mmc@vger.kernel.org
> > Subject: Re: powerpc/corenet: enable eSDHC
> > 
> > On Mon, 2015-06-08 at 05:12 -0500, Lu Yangbo-B47093 wrote:
> > > Thanks a lot, Scott.
> > > And now a patch was merged on
> > > git://git.linaro.org/people/ulf.hansson/mmc.git next branch to fix
> > > this issue.
> > > It should be no problem.
> > 
> > Assuming that patch fixes it and gets pulled for 4.2, this config patch
> > can go in for 4.3.
> > 
> > That said, it would be nice if, apart from fixing the problem itself, the
> > MMC code failed more gracefully instead of endlessly repeating and
> > filling up the log/console.
> > 
> > -Scott
>
Yangbo Lu July 20, 2015, 6:43 a.m. UTC | #4
> OK, thanks.  Assuming no similar issues when testing, I'll apply this

> patch the next time I do a batch of patch application.

> 

> Any thoughts regarding better error handling?

> 

> -Scott


Do you mean SD test?
Actually SD patches needing to sent to upstream are tested on Li Yang's Linux tree.
And the JIRA ticket is QORIQLU-19.


> 

> On Wed, 2015-07-15 at 21:37 -0500, Lu Yangbo-B47093 wrote:

> > Hi Scott,

> >

> > Now the patch below has been merged on

> > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git.

> > This issue should have been resolved.

> > Thanks.

> >

> >

> > commit 5fd26c7ecb32082745b0bd33c8e35badd1cb5a91

> > Author: Ulf Hansson <ulf.hansson@linaro.org>

> > Date:   Fri Jun 5 11:40:08 2015 +0200

> >

> >     mmc: sdhci: Restore behavior while creating OCR mask

> >

> >

> > > -----Original Message-----

> > > From: Wood Scott-B07421

> > > Sent: Tuesday, June 09, 2015 4:31 AM

> > > To: Lu Yangbo-B47093

> > > Cc: linuxppc-dev@lists.ozlabs.org; linux-mmc@vger.kernel.org

> > > Subject: Re: powerpc/corenet: enable eSDHC

> > >

> > > On Mon, 2015-06-08 at 05:12 -0500, Lu Yangbo-B47093 wrote:

> > > > Thanks a lot, Scott.

> > > > And now a patch was merged on

> > > > git://git.linaro.org/people/ulf.hansson/mmc.git next branch to fix

> > > > this issue.

> > > > It should be no problem.

> > >

> > > Assuming that patch fixes it and gets pulled for 4.2, this config

> > > patch can go in for 4.3.

> > >

> > > That said, it would be nice if, apart from fixing the problem

> > > itself, the MMC code failed more gracefully instead of endlessly

> > > repeating and filling up the log/console.

> > >

> > > -Scott

> >
Scott Wood July 24, 2015, 3:09 p.m. UTC | #5
On Mon, 2015-07-20 at 01:43 -0500, Lu Yangbo-B47093 wrote:
> > OK, thanks.  Assuming no similar issues when testing, I'll apply this
> > patch the next time I do a batch of patch application.
> > 
> > Any thoughts regarding better error handling?
> > 
> > -Scott
> 
> Do you mean SD test?

I just mean that I will verify that enabling the option doesn't make things 
worse.

> Actually SD patches needing to sent to upstream are tested on Li Yang's 
> Linux tree.

I thought you said the patch was already merged.

> And the JIRA ticket is QORIQLU-19.

Don't reference internal tickets on upstream lists.

-Scott
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 1b4861d..706bb60 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3256,13 +3256,14 @@  int sdhci_add_host(struct sdhci_host *host)
 				   SDHCI_MAX_CURRENT_MULTIPLIER;
 	}
 
-	/* If OCR set by external regulators, use it instead */
+	/* If OCR set by host, use it instead. */
+	if (host->ocr_mask)
+		ocr_avail = host->ocr_mask;
+
+	/* If OCR set by external regulators, give it highest prio. */
 	if (mmc->ocr_avail)
 		ocr_avail = mmc->ocr_avail;
 
-	if (host->ocr_mask)
-		ocr_avail &= host->ocr_mask;
-
 	mmc->ocr_avail = ocr_avail;
 	mmc->ocr_avail_sdio = ocr_avail;
 	if (host->ocr_avail_sdio)