All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [APPLIED] Overo broken after recent mainline merge
Date: Fri, 20 Mar 2009 15:33:24 -0700	[thread overview]
Message-ID: <200903201533.24620.david-b@pacbell.net> (raw)
In-Reply-To: <notify-1237576717@atomide.com>

On Friday 20 March 2009, Tony Lindgren wrote:
> This patch has been applied to the linux-omap
> by youw fwiendly patch wobot.
> 
> Commit: f4223ec219313d631c3f620220ed23670c158a34
> 
> PatchWorks
> http://patchwork.kernel.org/patch/12140/
> 

To avoid needless divergence from mainline, the appended
patch would probably work better ... it doesn't actually
fix the bug in the regulator core, but it's a workaround
that could go to mainline until that core gets fixed.

(Oh, and it includes a real, albeit minor, bugfix.)

- Dave

=============
From: David Brownell <dbrownell@users.sourceforge.net>

Updates to the mmc-twl4030 code:

 - Partial workaround for the bug fixed more comprehensively
   by f4223ec219313d631c3f620220ed23670c158a34 ... workaround
   applies only to MMC devs using this code.

 - Fix a cut'n'paste bug as noted by Adrian Hunter:  the intent
   was to "disable" not (re)"enable".

The reason to want this workaround is lack of faith that any
sane fix for that regulator framework bug will ever merge,
while still wanting to see things work in mainline.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
I suggest reverting f4223ec219313d631c3f620220ed23670c158a34
after applying this ...

 arch/arm/mach-omap2/mmc-twl4030.c |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -128,6 +128,27 @@ static int twl_mmc_late_init(struct devi
 			reg = regulator_get(dev, "vmmc_aux");
 			hsmmc[i].vcc_aux = IS_ERR(reg) ? NULL : reg;
 
+			/* UGLY HACK:  workaround regulator framework bugs.
+			 * When the bootloader leaves a supply active, it's
+			 * initialized with zero usecount ... and we can't
+			 * disable it without first disabling it.  Until the
+			 * framework is fixed, we need a workaround like this
+			 * (which is safe for MMC, but not in general).
+			 */
+			if (regulator_is_enabled(hsmmc[i].vcc) > 0) {
+				dev_warn(dev, "APPLY REGULATOR HACK for vmmc\n");
+				regulator_enable(hsmmc[i].vcc);
+				regulator_disable(hsmmc[i].vcc);
+			}
+			if (hsmmc[i].vcc_aux) {
+				if (regulator_is_enabled(reg) > 0) {
+					dev_warn(dev, "APPLY REGULATOR HACK "
+						"for vmmc_aux\n");
+					regulator_enable(reg);
+					regulator_disable(reg);
+				}
+			}
+
 			break;
 		}
 	}
@@ -285,7 +306,7 @@ static int twl_mmc23_set_power(struct de
 		}
 	} else {
 		if (c->vcc_aux)
-			ret = regulator_enable(c->vcc_aux);
+			ret = regulator_disable(c->vcc_aux);
 		if (ret == 0)
 			ret = mmc_regulator_set_ocr(c->vcc, 0);
 	}


  reply	other threads:[~2009-03-20 22:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-14 13:24 Overo broken after recent mainline merge Steve Sakoman
2009-03-14 16:12 ` Tony Lindgren
2009-03-14 19:08   ` David Brownell
2009-03-14 20:22     ` Mark Brown
2009-03-14 21:14       ` David Brownell
2009-03-14 22:34         ` Mark Brown
2009-03-15  3:18           ` David Brownell
2009-03-15  3:36           ` David Brownell
2009-03-14 23:47     ` Steve Sakoman
2009-03-15  2:00       ` David Brownell
2009-03-15  3:56         ` Steve Sakoman
2009-03-15 19:56         ` Steve Sakoman
2009-03-15 22:15           ` Steve Sakoman
2009-03-15 22:32             ` Steve Sakoman
2009-03-15 23:16           ` David Brownell
2009-03-20 19:18     ` [APPLIED] " Tony Lindgren
2009-03-20 22:33       ` David Brownell [this message]
2009-03-23 16:00         ` Mark Brown
2009-03-23 19:27         ` [APPLIED] " Tony Lindgren

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=200903201533.24620.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /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.