Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp769449imw; Fri, 15 Jul 2022 12:30:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tvmzxkJUIUVrNlyFwPgr/P4KmSUjGcl+EV6avKSNaGHY4g1qypnHR9+NX4Zne2HMEi2bCp X-Received: by 2002:a05:6870:b28d:b0:10b:d7fb:ba63 with SMTP id c13-20020a056870b28d00b0010bd7fbba63mr11131214oao.90.1657913448829; Fri, 15 Jul 2022 12:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657913448; cv=none; d=google.com; s=arc-20160816; b=fBCCFtpaX1bI/7ubxrEStXDbbz2xiwC9OSDrfPxCofm1knHSCDBCSZvAPjcNBQuWXI 4lGPwanrmAjXx0h2saiIqF8r5+v6DBf2qezVg5XLBarK0uH/cm//fEvB/okKRNU82AOO 0+fGnPLlpwpi0jwqUXEkw8t1eN96BLsqPW7SLy4beMeUwq2/GLX/3Fa7TIscbw84rZ1w H4AV+cQMqY/GiDxv95yDHLfZ22yy+BPtXHf/rbtLeO4ac67hEIqbAfV9SA5Qx1zlbquS vuv2Vjm8mhkl9vTp+BMYnL1Z1XPZf+mRJX6mLzULQtr9iJNGY7yv3ydgiayKtB33UHN/ 6cVg== 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=bv2dOhFfF2dk3rLWdihNlfJKNevFVvMuIuaBR1GrWRE=; b=sDGyCIP5qGrvQxJFqSiDPY5T8bRarZemVyA6MS6eJRBtLpHGmspB9HvzsoA7kUiILO JfFr2ZanyMwayVrTzhzkHEJZHNpWYtRAdpsyGrZPBMCx3K6cB3o8g9kycU3bV2mUIJgF wsOwzagyqvtwlsHZH2NV2RigosjQTDPH2smytTVi+KievxMY21TYqdyK0GxS8dqWeF0p 7PzhQxRL7DT1t8e4d3CzLhSI//SZjH54dVyNheqiJGlF05dYNKngjQJWfiBlahK4Cf3T WcwtMwLEHNR0X4zqfIuS7jIzdnsiq4aMCcW6H26SzLZgTw4xoITDysBUfJLv8+nzQ9M5 vbrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kohlschutter-com.20210112.gappssmtp.com header.s=20210112 header.b=C2TKJm5I; 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 u10-20020aca600a000000b00339fd79d565si4268523oib.279.2022.07.15.12.30.35; Fri, 15 Jul 2022 12:30:48 -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=C2TKJm5I; 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 S230199AbiGOTEZ (ORCPT + 99 others); Fri, 15 Jul 2022 15:04:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbiGOTEY (ORCPT ); Fri, 15 Jul 2022 15:04:24 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABDA813E06 for ; Fri, 15 Jul 2022 12:04:23 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id sz17so10531597ejc.9 for ; Fri, 15 Jul 2022 12:04: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=bv2dOhFfF2dk3rLWdihNlfJKNevFVvMuIuaBR1GrWRE=; b=C2TKJm5IFjGEWJD7Q5OSvM7ms789VUE4H0SshdOsXi3HBldXepa1WRPnnUZ3nQBm90 3zhmtQC7b9aYbi4fWkgPIttqG2M1era+PHqkCZW+8RpCvSlU+5B8cPssYmOIGo/632Xa +aVeXZnSE97zEg767JEi34Keyf5Vlka4VFLlN0625atSzEXPcLlWIf7wke1im0r8X1OZ D94rXiwPs/C4fjZazbdxyZ+h+HkPbcs1HMzJlDu6oY60Pu0A7aR++StIjYgJrLwMt/rx KxWjGMUripZKRDqbL8CqH72TlXYi3OcXSCYACwmgIzpo3lOUnrSBTBXXxgX1x3r6tMEn nL0Q== 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=bv2dOhFfF2dk3rLWdihNlfJKNevFVvMuIuaBR1GrWRE=; b=wrNsrUKo+w7LTxt3A0C9pW6u4s3PteoPfMLvxDPDXQXDekvJpd7znaau7mS7RObTKP bqeSjbdsOpNwMCHnKM23Baj252UOhLPXk4A2pnGKNB0P/PMQHOb9A5OSELRLUg6v7B9k 0pL1VWptR35R/6hsKSvYDWtYHKJ+w3O5mhjfTqMuTQNE++SNQtstVw/3/L6EFJ0Uowuu CsHlj/RkEU++4DgoUjkR5Ag1sk8znSdCV5QHSKm2GrpupiiDu4tYBioyfDNXl/x9Bxe+ M+zHd6iv53Xdrre1YFWzJH/9V0MD51vCabyL05MPPulRQJGg/Bt1W4540aeiYqSk9Nn6 /ygw== X-Gm-Message-State: AJIora+bij+/jz0pyyo0TgEW140lT1e12vRB633ymbL2RKzjv3PaFOTk EHvdPQJYinYgDG7ws9Y8Sbg/iw== X-Received: by 2002:a17:907:9605:b0:6f5:c66:7c13 with SMTP id gb5-20020a170907960500b006f50c667c13mr15273977ejc.66.1657911862212; Fri, 15 Jul 2022 12:04:22 -0700 (PDT) Received: from smtpclient.apple (ip5b434222.dynamic.kabel-deutschland.de. [91.67.66.34]) by smtp.gmail.com with ESMTPSA id u18-20020a05640207d200b0042dcbc3f302sm3276938edy.36.2022.07.15.12.04.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jul 2022 12:04: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: <9405b97a-6758-ad4e-ccff-eed072096539@arm.com> Date: Fri, 15 Jul 2022 21:04:20 +0200 Cc: wens@kernel.org, =?utf-8?Q?Heiko_St=C3=BCbner?= , Markus Reichl , linux-arm-kernel , "open list:ARM/Rockchip SoC..." , linux-kernel , Linux MMC List Content-Transfer-Encoding: quoted-printable Message-Id: 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> <115AD6A4-021B-4879-BFB5-BC7689A0203E@kohlschutter.com> <17a4c6f6-d79c-a7b2-860f-e5944b778f9f@arm.com> <9405b97a-6758-ad4e-ccff-eed072096539@arm.com> To: Robin Murphy X-Mailer: Apple Mail (2.3696.100.31) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Am 15.07.2022 um 20:57 schrieb Robin Murphy : >=20 > On 2022-07-15 19:11, Robin Murphy wrote: >> On 2022-07-15 18:16, Christian Kohlsch=C3=BCtter wrote: >>> OK, this took me a while to figure out. >>>=20 >>> 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... >> Well this has to be in the running for "weirdest placebo ever"... :/ >> All it actually seems to achieve is printing an error[1] (this is = after all a tiny 5-pin fixed-voltage LDO regulator, not an intelligent = PMIC), and if that makes an appreciable difference then there has to be = some kind of weird timing condition at play. Maybe regulator_register() = ends up turning it off and on again rapidly enough that the card sees a = voltage brownout and glitches, and adding more delay by printing to the = console somewhere in the middle gives it enough time to act as a proper = power cycle with no ill effect? >=20 > ...and apparently the answer is yes, it seems to be doing exactly that = (see attached). But seemingly my SD cards don't mind, or maybe my T4 = board happens to have more capacitance than Christian's R4S so my = voltage dip isn't as bad, or both. >=20 > So it seems like the solution here might indeed simply be to remove = the regulator-always-on which doesn't seem to have any reason to be here = anyway. Without that, the enable stays low until the MMC driver probes = and claims it, which is then massively longer than the time it takes for = VCC3V0_SD to ramp down completely. >=20 > Robin. Removing "regulator-always-on" has the effect that the system freezes = upon reboot. There may well be another bug slumbering in the codebase = that is circumvented by 1. adding a delay in the code and 2. not turning = the regulator off upon shutdown.