From patchwork Sun Feb 17 22:14:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 10817217 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9074013B5 for ; Sun, 17 Feb 2019 22:14:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AE9E2A055 for ; Sun, 17 Feb 2019 22:14:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CF902A05A; Sun, 17 Feb 2019 22:14:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 83F322A055 for ; Sun, 17 Feb 2019 22:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=eAkp8AL9h+1UiesohEBqRsX1uKOMn37DOmwMp9y1+40=; b=R+6BdU9O6KhqTm UDn8pLvHzRbC1zQN6vSgZCIZqkLJ3utWzMRsOQSnEDxwdsupI7uzSZtQ4Ka/hV1Jyefyz+CzHK5Dv CTzHqBfv26jNB6VBWOALD18O6zT4XWMl98XwJ5BHoShpOzbgcq21lUBl24vM7FSg7bs85P7PoojjW AFIS1jTeauxy9jYMF2qyeaHlahYecV9i8EPa72qc1cGuHTK3SmDupsiTiaCRY7f/j2dDfYSdfjx8J Vmg15GYzW1b190jgoPRnFFuyNaSGIWQ/BD/ausDVz9058AJJMDxuvAJRrHNr7BkvcE+ohSF3VpQ9b frLj4PMlZLJ4Zqu2PMnA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gvUi1-0006aY-7V; Sun, 17 Feb 2019 22:14:49 +0000 Received: from mail-oln040092067073.outbound.protection.outlook.com ([40.92.67.73] helo=EUR02-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gvUhx-0006PR-Jy for linux-rockchip@lists.infradead.org; Sun, 17 Feb 2019 22:14:47 +0000 Received: from HE1EUR02FT063.eop-EUR02.prod.protection.outlook.com (10.152.10.55) by HE1EUR02HT232.eop-EUR02.prod.protection.outlook.com (10.152.11.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1580.10; Sun, 17 Feb 2019 22:14:38 +0000 Received: from AM3PR03MB0966.eurprd03.prod.outlook.com (10.152.10.60) by HE1EUR02FT063.mail.protection.outlook.com (10.152.11.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1580.10 via Frontend Transport; Sun, 17 Feb 2019 22:14:38 +0000 Received: from AM3PR03MB0966.eurprd03.prod.outlook.com ([fe80::8011:1f4d:3804:e5f3]) by AM3PR03MB0966.eurprd03.prod.outlook.com ([fe80::8011:1f4d:3804:e5f3%10]) with mapi id 15.20.1622.018; Sun, 17 Feb 2019 22:14:38 +0000 From: Jonas Karlman To: "linux-mmc@vger.kernel.org" Subject: [RFC] mmc: core: set initial signal voltage on power off Thread-Topic: [RFC] mmc: core: set initial signal voltage on power off Thread-Index: AQHUxw4rZHGZ+I4M/UOPYSLK705O2A== Date: Sun, 17 Feb 2019 22:14:38 +0000 Message-ID: Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR10CA0006.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:89::19) To AM3PR03MB0966.eurprd03.prod.outlook.com (2a01:111:e400:884c::23) x-incomingtopheadermarker: OriginalChecksum:7751DD7E7F5B08A87EFCF2069D730855C1980A00CB0EF05C300549E842533B18; UpperCasedChecksum:5EF4E6B2C88C5D8153413C8C621C4B3B7C2E7BC64A87B18E4E4611030788907E; SizeAsReceived:8358; Count:62 x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-tmn: [Z5CHWSSYcwoDBSJj2Z+oJuOC2jRGuNvi] x-microsoft-original-message-id: <20190217221340.25036-1-jonas@kwiboo.se> x-ms-publictraffictype: Email x-incomingheadercount: 62 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(20181119070)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045); SRVR:HE1EUR02HT232; x-ms-traffictypediagnostic: HE1EUR02HT232: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(4566010)(82015058); SRVR:HE1EUR02HT232; BCL:0; PCL:0; RULEID:; SRVR:HE1EUR02HT232; x-microsoft-antispam-message-info: dIgUujNY4kj0x4LPINkWKNCI+m4ntwjyC9nHFjDbEyNxlxwboPrsC1moZGbt3Dn+ MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 54485d23-c432-40fe-8436-6091d627118c X-MS-Exchange-CrossTenant-Network-Message-Id: 6bc311be-f09d-456f-230a-08d695254df2 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 54485d23-c432-40fe-8436-6091d627118c X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Feb 2019 22:14:37.2375 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR02HT232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190217_141445_658651_5A140E49 X-CRM114-Status: UNSURE ( 8.75 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-rockchip@lists.infradead.org" , Jonas Karlman Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Some boards have SD card connectors where the power rail cannot be switched off by the driver. If the card has not been power cycled, it may still be using 1.8V signaling after a warm re-boot. Bootroms expecting 3.3V signaling will fail to boot from a UHS card that continue to use 1.8V signaling. Set initial signal voltage in mmc_power_off() to allow re-boot to function. This fixes re-boot with UHS cards on Asus Tinker Board (Rockchip RK3288), same issue have been seen on some Rockchip RK3399 boards. I am sending this as a RFC because I have no insights into SD/MMC subsystem, this change fix a re-boot issue on my boards and does not break emmc/sdio. Is this an acceptable workaround? Any advice is appreciated. Signed-off-by: Jonas Karlman --- drivers/mmc/core/core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 5bd58b95d318..69d7021916ae 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1684,6 +1684,14 @@ void mmc_power_off(struct mmc_host *host) if (host->ios.power_mode == MMC_POWER_OFF) return; + mmc_set_initial_signal_voltage(host); + + /* + * This delay should be sufficient to allow the power supply + * to reach the minimum voltage. + */ + mmc_delay(host->ios.power_delay_ms); + mmc_pwrseq_power_off(host); host->ios.clock = 0;