Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp472421imw; Thu, 14 Jul 2022 05:08:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1usQOGnLlEZUvmxEhGs6TVw+R9RwH/WZVLdlrxZwcLrKS30Z9A6gTdjE8K2gOqB640LlPhb X-Received: by 2002:a17:906:8a6c:b0:72b:3b4f:13b with SMTP id hy12-20020a1709068a6c00b0072b3b4f013bmr9005852ejc.14.1657800530989; Thu, 14 Jul 2022 05:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657800530; cv=none; d=google.com; s=arc-20160816; b=d2Z5B2u20iGdu5bY/2+CWd4YeehViCTIL/upwMYss/hSTQFzUQrf085UBK0a2XAaOI UtgrFr6pvcKHw4RWVJCreEg/ppy8XgasG+IW0+KM3/UEY8L3A3E0cUKl70TegHZ4NScw Kv624cADkD3QF/xHu7KcWhFdhslhcWS67V6OKPXK40tueXVFiMESvaFbo8Ce/AfbAdRs w29KOeWhqeQyPNkpcls31hKVHCAxLIC5OyhiRUH4l9KhzTleUN0eef5PU8XKR7J6Okh1 xA/8GUiib16mbiJa6XHXu57zJ6RNRWgwAZUC//LVzODGqZNd8Vg6oeXtIfxr8dxuedPz +qQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=9qHxcdz1YjA2Xctgtuq6OwMptuLeNeZQuMNFZcjNauI=; b=IeIZY35OAT64evILtSPg+NhmAtcOTgskNroFe2aqOSeGMNl5jHCD4EzjnY7VkXC1VY gCsAP8E3X3MuxpIsy9UlchiPHVOAxnwZckLRs+rNEMVb9I41h+BLerpKgt7IVt3jFWDE M5gd9Kg54kto+s46ZeuYEXEImfh31suUDJAtlksLzkD06GUjGMXcyi1efkIli0YY0JNn qP31aw5Vf78Z35N7I8X6INqWYijvD05kEUyGltTkFzwALpC2toQd44CvS9tkQPZMDUgy gdUBE00d2qGgFAfO+kMF1e2USyYueCfgZEFuI4URycwimyW8URjB522IzF/q18kgIU60 /sbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r12-20020a056402034c00b00439e2ae6f7csi1594501edw.316.2022.07.14.05.08.25; Thu, 14 Jul 2022 05:08:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239029AbiGNLlN (ORCPT + 99 others); Thu, 14 Jul 2022 07:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230167AbiGNLlM (ORCPT ); Thu, 14 Jul 2022 07:41:12 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BA4BE5B075 for ; Thu, 14 Jul 2022 04:41:10 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D0E2613D5; Thu, 14 Jul 2022 04:41:10 -0700 (PDT) Received: from [10.57.86.49] (unknown [10.57.86.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 685453F792; Thu, 14 Jul 2022 04:41:09 -0700 (PDT) Message-ID: <103b714c-b07c-f016-1062-84bd94786b22@arm.com> Date: Thu, 14 Jul 2022 12:41:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] arm64: dts: rockchip: Fix SD card init on rk3399-nanopi4 Content-Language: en-GB To: =?UTF-8?Q?Heiko_St=c3=bcbner?= , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Christian_Kohlsch=c3=bctter?= References: <12878108.O9o76ZdvQC@diego> From: Robin Murphy In-Reply-To: <12878108.O9o76ZdvQC@diego> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-07-14 00:41, Heiko Stübner wrote: > Hi Christian, > > Am Donnerstag, 14. Juli 2022, 00:22:23 CEST schrieb Christian Kohlschütter: >> mmc/SD-card initialization may sometimes fail on NanoPi r4s with >> "mmc1: problem reading SD Status register" / >> "mmc1: error -110 whilst initialising SD card" >> >> Moreover, rebooting would also sometimes hang. >> > > Nit: here the commit message should continue with something like: > ----- > This is caused by the vcc3v0-sd regulator referencing the wrong gpio. > > Fix the regulator to use the correct pin and drop the always-on property. > ----- >> Signed-off-by: Christian Kohlschütter >> --- >> arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi >> index 8c0ff6c96e03..91789801ab03 100644 >> --- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi >> +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi >> @@ -67,10 +67,10 @@ vcc1v8_s3: vcc1v8-s3 { >> vcc3v0_sd: vcc3v0-sd { >> compatible = "regulator-fixed"; >> enable-active-high; >> - gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>; >> + gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_HIGH>; > > The interesting question would be how nano-pi-specific that gpio is. > > I.e. this is the rk3399-nanopi4.dtsi that is shared by multiple board types, > so can you check in schematics if gpio0-d6 is always used on all of them? On the R4S schematic, this is GPIO0_A1 same as the others. GPIO0 doesn't even have a bank D on RK3399, it only goes up to B5 :/ > > Thanks > Heiko > >> pinctrl-names = "default"; >> pinctrl-0 = <&sdmmc0_pwr_h>; >> - regulator-always-on; >> + regulator-boot-on; >> regulator-min-microvolt = <3000000>; >> regulator-max-microvolt = <3000000>; >> regulator-name = "vcc3v0_sd"; >> @@ -580,7 +580,7 @@ wifi_reg_on_h: wifi-reg_on-h { >> >> sdmmc { >> sdmmc0_det_l: sdmmc0-det-l { >> - rockchip,pins = <0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>; >> + rockchip,pins = <0 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>; ...and claiming the card detect is on the same non-existent pin as the regulator enable is clearly even more wrong. Is this another case where a UHS card is involved, such that VCC_SDIO gets left at 1.8V after a reboot, so subsequent attempts to do the initial handshake where the card is expecting 3V logic levels fail? (AKA the Tinkerboard problem). Hobbling the regulator such that Linux can never actually turn VCC3V0_SD off, thus the card never gets reset, might appear to "work", but isn't the right thing to do. Robin. >> }; >> >> sdmmc0_pwr_h: sdmmc0-pwr-h { >> > > > > > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip