Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp658106imw; Fri, 15 Jul 2022 10:21:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uXtpF95smO08w00vnrHKjlklHvTdYx87FGV/2bDGq58zXsjSFptSyGkuVTRjVeO2ekKDDK X-Received: by 2002:a17:907:7388:b0:72b:9be1:e32d with SMTP id er8-20020a170907738800b0072b9be1e32dmr14178974ejc.611.1657905667680; Fri, 15 Jul 2022 10:21:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657905667; cv=none; d=google.com; s=arc-20160816; b=iQU370e6V5K1LKl9kppGFYM9OAWLamwoX9f8SMP1yAMItoc11SF8Wb7IPQ2cVTsYvt y7gXPNDdVzyNK6vrC4scYaJADYNye7OrpZrXhZkiQAmC6j6zrfUsf6B9kgFnlo1Tsr4O ecmsd1rvzGHavgVnlD+mRWFH2UR7uLXHJAnIJ+Q6TrfZL9CC6gQBeQgcp1IQrt4U14kB MuffHHw7Nmhe789RDfRS7VhgW5pRNVRQbAgLs8Y72Y8FpBl49vLhy95YlL7AUbcCWRuc M4bZa/fenxrqdcz3iZCMHo2zdxSilizxQBLK+BRo4Wosr95fd5YCF+Bn8lmRbhkhFKka +dEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=k9mYwQ4GZm0yX1uaonHMP1HNEcS1yGmWnGbQClcs4i0=; b=WnO+RbKraFgor9WAV3cmAqhdQSv1yxBnQCQ1OA7jGhNodAPaaVdOI/Alfu2A+2dvXA QqWCjVx4qQkZN7islZ+4LRjN+JpIWglRIgteNLLG1t7MYN83C6k1qglLyrmgiOpGd9Pi GX3Er9sk1y0jnRzio+YBFqOR2y3PvEkbwCfxslLA90GFgpgkm8q0khzjrCEs0ZLNPuUd cuFs41BjoTpVHj6Z3fIXXTyP45/1BI+97mzcfGHJYkrwspCuUdj60EX5xULgy75aIla9 oErKYlOkOgc0VQVEcuqkwVmjQrHSSiaTczKe674cin+cMGtHssjaVdau7TIUd5RXWlpW yZFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kohlschutter-com.20210112.gappssmtp.com header.s=20210112 header.b=zFID5lvP; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y12-20020a056402270c00b0043ab49628b2si7031639edd.586.2022.07.15.10.20.41; Fri, 15 Jul 2022 10:21:07 -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; dkim=pass header.i=@kohlschutter-com.20210112.gappssmtp.com header.s=20210112 header.b=zFID5lvP; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232055AbiGORQo (ORCPT + 99 others); Fri, 15 Jul 2022 13:16:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbiGORQl (ORCPT ); Fri, 15 Jul 2022 13:16:41 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E90E43E6C for ; Fri, 15 Jul 2022 10:16:23 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id z23so10085174eju.8 for ; Fri, 15 Jul 2022 10:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kohlschutter-com.20210112.gappssmtp.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=k9mYwQ4GZm0yX1uaonHMP1HNEcS1yGmWnGbQClcs4i0=; b=zFID5lvPR8/gCoMoKCKoy9rjEMsXVDH8styUKWjnB9OpkSx33TYhV9J4WZFvM6fW0U wi0Ki8iHWle+06SAd9C4E9SZqG3ioGoMmc2kbEdZV5HF74a0OWFlipC+4UM1jyL+gUtC mtZnctRxLTV1Red2PjGsuYaHdlmGnt/+V05EwivTqBK+p6sbIS37C2IPpCKdmXeCW1O0 K2BlX8dvQesrp01srzrt1e8J85tnylx45T0fS+ntK8EblgVMsa+F/sdMGcL5Q+PufqSk K6DlfaDLk2TnQRjL/AN1wp2Zi/h6s5L23r61AaWV86P3f/84bf96pOiCEtEFmn1REXtO IfAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=k9mYwQ4GZm0yX1uaonHMP1HNEcS1yGmWnGbQClcs4i0=; b=jCzDrz6M9eGGl2y6q3PSCu03uzvSqvdSd7sYb43+O446+SnHiVZ/VXaKo0jN4IqiI2 JZdMElhHMxgkbj0crpOWoQlh4oZz6IiUo4WHEbdaK7EncbpBSPUdb5MKBooEVTM8f+jT YK7t+lN14bUfHTI5xvqPOXcP6UpJppeTddVAx8vPBoa+ZYhAvB2MZ3HGg4gRI4G96Yro lyj5aEU6BaZoHOdWEvV9aaztqoioxfx5qlfHF7Bzryr5E3TjRG6lqK0o3DWXUcvAviR1 2XeWh7vKdK1E70yv3gAo9j/eZ6PrtMr69vYPJa+PQfdhxu8kZ6361n0upJg+Jr8SsA8a WI7A== X-Gm-Message-State: AJIora/Ixv9GxWtgDycut4lzSngYk2QTDkwlBhYIQVOfnNrZnACyjzCM /nHN8+j9jVCHqSjUszBIicz5Dbvj6pfeZ6X1 X-Received: by 2002:a17:906:6545:b0:722:7c99:1ad7 with SMTP id u5-20020a170906654500b007227c991ad7mr14438736ejn.325.1657905381857; Fri, 15 Jul 2022 10:16:21 -0700 (PDT) Received: from smtpclient.apple (ip5b434222.dynamic.kabel-deutschland.de. [91.67.66.34]) by smtp.gmail.com with ESMTPSA id j17-20020a17090623f100b0072a55ec6f3bsm2259246ejg.165.2022.07.15.10.16.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jul 2022 10:16:21 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: [PATCH v4] arm64: dts: rockchip: Fix SD card init on rk3399-nanopi4 From: =?utf-8?Q?Christian_Kohlsch=C3=BCtter?= In-Reply-To: <73F9AED0-D2A8-4294-B6E1-1B92D2A36529@kohlschutter.com> Date: Fri, 15 Jul 2022 19:16:20 +0200 Cc: linux-arm-kernel , "open list:ARM/Rockchip SoC..." , linux-kernel , Linux MMC List Content-Transfer-Encoding: quoted-printable Message-Id: <115AD6A4-021B-4879-BFB5-BC7689A0203E@kohlschutter.com> References: <12878108.O9o76ZdvQC@diego> <103b714c-b07c-f016-1062-84bd94786b22@arm.com> <9AF1E75F-5947-49B0-887D-82C426527B99@kohlschutter.com> <590f7a08-a6ca-be54-4254-363343642a52@arm.com> <5ca9bd94-54d9-04f8-0098-a56ffb6f5fe1@arm.com> <502b3fbe-3077-407e-6010-a8cb3ffce7d6@arm.com> <449292CA-CE60-4B90-90F7-295FBFEAB3F8@kohlschutter.com> <73F9AED0-D2A8-4294-B6E1-1B92D2A36529@kohlschutter.com> To: Robin Murphy , wens@kernel.org, =?utf-8?Q?Heiko_St=C3=BCbner?= , Markus Reichl X-Mailer: Apple Mail (2.3696.100.31) X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,T_SPF_TEMPERROR autolearn=no 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 OK, this took me a while to figure out. When no undervoltage limit is configured, I can reliably trigger the = initialization bug upon boot. When the limit is set to 3.0V, it rarely occurs, but just after I send = the v3 patch, I was able to reproduce... > Am 15.07.2022 um 19:12 schrieb Christian Kohlsch=C3=BCtter = : >=20 > mmc/SD-card initialization may fail on NanoPi R4S with > "mmc1: problem reading SD Status register" / > "mmc1: error -110 whilst initialising SD card" > either on cold boot or after a reboot. >=20 > Moreover, the system would also sometimes hang upon reboot. >=20 > This is prevented by setting an explicit undervoltage protection limit > for the SD-card-specific vcc3v0_sd voltage regulator. >=20 > Set the undervoltage protection limit to 2.7V, which is the minimum > permissible SD card operating voltage. >=20 > Signed-off-by: Christian Kohlsch=C3=BCtter = > --- > arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi | 4 ++++ > 1 file changed, 4 insertions(+) > mode change 100644 =3D> 100755 = arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi >=20 > diff --git a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi = b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi > old mode 100644 > new mode 100755 > index 8c0ff6c96e03..669c74ce4d13 > --- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi > @@ -73,6 +73,10 @@ vcc3v0_sd: vcc3v0-sd { > regulator-always-on; > regulator-min-microvolt =3D <3000000>; > regulator-max-microvolt =3D <3000000>; > + > + // must be configured or SD card may fail to initialize = occasionally > + regulator-uv-protection-microvolt =3D <2700000>; > + > regulator-name =3D "vcc3v0_sd"; > vin-supply =3D <&vcc3v3_sys>; > }; > --=20 > 2.36.1