From patchwork Fri Mar 20 22:33:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Brownell X-Patchwork-Id: 13403 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2KMXvme010065 for ; Fri, 20 Mar 2009 22:33:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752947AbZCTWd2 (ORCPT ); Fri, 20 Mar 2009 18:33:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752758AbZCTWd2 (ORCPT ); Fri, 20 Mar 2009 18:33:28 -0400 Received: from smtp120.sbc.mail.sp1.yahoo.com ([69.147.64.93]:29015 "HELO smtp120.sbc.mail.sp1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752947AbZCTWd1 (ORCPT ); Fri, 20 Mar 2009 18:33:27 -0400 Received: (qmail 8089 invoked from network); 20 Mar 2009 22:33:26 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=pacbell.net; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:User-Agent:Cc:References:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id; b=tAwfB/dawvMV7fZZi+uXcH/FqhJHG3Q18R8Eik7gwiRVeGv4ixbsNnqlAgeJI2nS+dMtJsXvUZZE6ydTo1t0B2W5kxS7+Yui5GAHC6rlYLoESYOYiGsKkKCZJL/hfMFlWn6IiN0crBnyunawDz3sJy10Xq/3D1Ds58nYYxpuibg= ; Received: from unknown (HELO pogo) (david-b@69.226.224.20 with plain) by smtp120.sbc.mail.sp1.yahoo.com with SMTP; 20 Mar 2009 22:33:25 -0000 X-YMail-OSG: wLIMA_QVM1nxalEtp5Q3k628_lZDF7yQqn4qRx2qPLlWJAY2LKXImSYlmLHAM_nDmUYaa8CvI2szFmTRZnMdWo0k.vL5cqpc6CJetCUPu0are1.36r3B5_LFbMj2MHfLK1zhOFw1iQb3U0YImMlLytehh5nyWEn6mm2NYnILQJJK3baSYSuG5f4OOwjmYnYfrBXLW02szGMVSOtnR9A6I7cEaz7.pWvunzHqLg-- X-Yahoo-Newman-Property: ymail-3 From: David Brownell To: Tony Lindgren Subject: Re: [APPLIED] Overo broken after recent mainline merge Date: Fri, 20 Mar 2009 15:33:24 -0700 User-Agent: KMail/1.9.10 Cc: linux-omap@vger.kernel.org References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200903201533.24620.david-b@pacbell.net> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ============= From: David Brownell 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 --- 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); }