From patchwork Mon Jun 8 10:12:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangbo Lu X-Patchwork-Id: 481814 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E62321401AB for ; Mon, 8 Jun 2015 20:14:03 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id C869F1A0E24 for ; Mon, 8 Jun 2015 20:14:03 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0115.outbound.protection.outlook.com [157.56.110.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48A3B1A0414 for ; Mon, 8 Jun 2015 20:13:00 +1000 (AEST) Received: from BY1PR0301MB1192.namprd03.prod.outlook.com (10.160.195.150) by CY1PR03MB1488.namprd03.prod.outlook.com (10.163.17.18) with Microsoft SMTP Server (TLS) id 15.1.184.17; Mon, 8 Jun 2015 10:12:53 +0000 Received: from BY1PR0301MB1192.namprd03.prod.outlook.com ([10.160.195.150]) by BY1PR0301MB1192.namprd03.prod.outlook.com ([10.160.195.150]) with mapi id 15.01.0172.012; Mon, 8 Jun 2015 10:12:53 +0000 From: Lu Y.B. To: Scott Wood Subject: RE: powerpc/corenet: enable eSDHC Thread-Topic: powerpc/corenet: enable eSDHC Thread-Index: AQHQmmwWaTpCsjazM0qov5Ih+YFHe52icZ/Q Date: Mon, 8 Jun 2015 10:12:52 +0000 Message-ID: References: <1430893748-38821-1-git-send-email-yangbo.lu@freescale.com> <20150530000331.GA9143@home.buserror.net> In-Reply-To: <20150530000331.GA9143@home.buserror.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: freescale.com; dkim=none (message not signed) header.d=none; x-originating-ip: [199.59.231.64] x-microsoft-exchange-diagnostics: 1; CY1PR03MB1488; 3:YJfMSHj+SF5BculSKxdmbZt8sWpkfTEE7HlrTVtfrRpSBQlyY1e90JeUvnC0yQhb4ORg6PVug8+BWBOyvgfSforC2otrnldccwixtWHgCv9sUGt1ULl0Iveo8dH+koDXbmDYmbKez9Zs3gcJOP3tRw==; 10:5ku8CoQ4igdN+tH4kl+9SfS1NYNuOf5YquGQxNA6W8kwCwTBXYnNpu3q8kWzwM4RidN4DzNygwEkrhFjQzvBrt5RyfXm8XJIkQo+37uiHH0=; 6:BTTMU3gRQmnr61+FdvLsRAUKM4WGRimgXqPO+DyMiNtKcmb7HVTbAtoNhn6ClxtB x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1488; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(520003)(5005006)(3002001); SRVR:CY1PR03MB1488; BCL:0; PCL:0; RULEID:; SRVR:CY1PR03MB1488; x-forefront-prvs: 060166847D x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(51704005)(13464003)(377454003)(24454002)(66066001)(189998001)(2656002)(50986999)(2900100001)(92566002)(2950100001)(76176999)(54356999)(102836002)(19580395003)(46102003)(86362001)(99286002)(77096005)(19580405001)(575784001)(5002640100001)(106116001)(62966003)(77156002)(33656002)(122556002)(40100003)(76576001)(87936001)(5001960100002)(110136002)(74316001)(4001450100001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR03MB1488; H:BY1PR0301MB1192.namprd03.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2015 10:12:53.0147 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1488 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-mmc@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 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 Reported-by: Yangbo Lu Signed-off-by: Ulf Hansson Reviewed-by: Tim Kryger --- drivers/mmc/host/sdhci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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)