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: 10817215 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 D013113A4 for ; Sun, 17 Feb 2019 22:14:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC0532A055 for ; Sun, 17 Feb 2019 22:14:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD8902A05A; Sun, 17 Feb 2019 22:14:45 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E59B62A055 for ; Sun, 17 Feb 2019 22:14:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726349AbfBQWOm convert rfc822-to-8bit (ORCPT ); Sun, 17 Feb 2019 17:14:42 -0500 Received: from mail-oln040092067074.outbound.protection.outlook.com ([40.92.67.74]:19039 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726124AbfBQWOm (ORCPT ); Sun, 17 Feb 2019 17:14:42 -0500 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" CC: "linux-rockchip@lists.infradead.org" , Jonas Karlman 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 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.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;