Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp874118rwr; Thu, 4 May 2023 10:40:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7SKJdSwSRh/VcFABwncu0LG3+CvTCsVVA+gt4/KxsRrZL8+b/0zoYO77bqGFrQ00Q+4atJ X-Received: by 2002:a05:6a20:7d82:b0:f3:756e:e116 with SMTP id v2-20020a056a207d8200b000f3756ee116mr3828769pzj.38.1683222040318; Thu, 04 May 2023 10:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683222040; cv=none; d=google.com; s=arc-20160816; b=rMJEeNlh2ZmpLVU1/7eyFZC1/v/yEa3o+wbuD9UeRyF1aRIOx3fA9Zso+t49gqO8OP R4AL65pVwCE1GYBItiJr+irc5clj96irDCnwreHWYFGxbyyhgQMMOuEJJIwLGbfFMNM9 3+6Dgn4mgXg6bIvNjUXjhYlrUNbQatTW28hj7lxSVBmpwhyBUzeX1a41jXYuOWQOpGeH LA724TmJ4DSFd14YYUYpak/F4kcg0GHwORO3cl/zi3nl1JGyMrDWTUZV2Zbz5cwrDfC6 8jWCULN1BRgF3FHB/kj0M/aXu5PxdJRhv8MEFg1Fl9aPQ3Yftotd7f6GGZgvGRsU4R+P qYhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IVsm3eagCXOoKF8dywX6JomRr8irZRf0OWQgR6SRd8c=; b=pL+OOgWx1PHDNUVlX+1k3M6R7eHRWrEySj22ASWDXf+2KZEPKUSS/EmsBk4yvOSgwJ v3sxr9aoXkpk1ZUUkBJp1Bb+egcsxRzPJF7Q0LfDxAfaySCo9i66NQvza00BU883I1YN ab1tGh4ripX/58abKI+xR/n3hz76UWb/qx/WhwlsHFFbHWayzfi+UzF33Cm92JhRkxBf oiocb9TkMfSkWy5/NdgnQ7jj25T0ceB00bFQdvskEcayZ1Z7QA5mMHjH6JkYjKHTlNdj 8R0fnp6D+PICve72050H6xrwzJ6kiA/T1mrlVfJAVyc/y+6SGNBa98RvObuAyqAUJ3js sj+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hE7MELyW; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 25-20020a631859000000b0051b1b5917f6si33869667pgy.160.2023.05.04.10.40.27; Thu, 04 May 2023 10:40:40 -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=@collabora.com header.s=mail header.b=hE7MELyW; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230112AbjEDRhI (ORCPT + 99 others); Thu, 4 May 2023 13:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230038AbjEDRge (ORCPT ); Thu, 4 May 2023 13:36:34 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CF225FEC; Thu, 4 May 2023 10:36:29 -0700 (PDT) Received: from jupiter.universe (dyndsl-091-248-211-176.ewe-ip-backbone.de [91.248.211.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madras.collabora.co.uk (Postfix) with ESMTPSA id 48F26660570D; Thu, 4 May 2023 18:36:25 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1683221785; bh=167nUJPaQ51u5ho/2UstluOaEMM5LZNNdaUekQZ3nm0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hE7MELyWsFw50ZH/pbcqiRhR9nqa0PzAzepuew6iOnT1wTluYjjpMPH/s30DLORDL +kdy6ZHgjjzO7EYRWUI6tPeQTtvloWCqc2m4nzQQ7F2fKxram61eQn/I0Bz9PznF0c UFYD69HFsnD3PZFQLOHVNqHBpFozTiQDdsqUMCwy74PYfDB+JoJXrdCUuuQTBU5yUI XmdFBDI+vnH8PTF0SrqgWttS1xFWihZ8iA5ALDmrQNrUVBxoV3uWW6M1IF1xPElkct HrrCeNzP18LuI6UEYaSushXULi8L25aQHfjTXRdguq74wae3BAoxxahUkYrRC/3n7y sSeJEpF8SbQ0A== Received: by jupiter.universe (Postfix, from userid 1000) id E89194807F8; Thu, 4 May 2023 19:36:20 +0200 (CEST) From: Sebastian Reichel To: Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Lee Jones Cc: Michael Turquette , Stephen Boyd , Linus Walleij , Mark Brown , Liam Girdwood , Alexandre Belloni , Alessandro Zummo , linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v8 13/14] regulator: rk808: revert to synchronous probing Date: Thu, 4 May 2023 19:36:17 +0200 Message-Id: <20230504173618.142075-14-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230504173618.142075-1-sebastian.reichel@collabora.com> References: <20230504173618.142075-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 The rk808 driver registers a bunch of regulator devices in a loop. If one of the later regulators fails to register (usually because its input supply is not yet available) everything will be unrolled (i.e. previously registered regulators will be unregistered). With asynchronous registration there might already be consumers, though. We do not have the necessary infrastructure to properly unregister the consumer device, so this scenario should be avoided. First checking all input supplies or disallowing usage of the regulators until all are registered does not work, since there can be self-references (e.g. DCDC channels providing the supply of LDOs). The only sensible solution I found is registering the regulator devices asynchronously, so that we do not have to unroll. Since this is a major rework let's revert back to synchronous probing for now to fix the issue at hand. Signed-off-by: Sebastian Reichel --- drivers/regulator/rk808-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index 71a1ca8b917e..5f14d6dd4593 100644 --- a/drivers/regulator/rk808-regulator.c +++ b/drivers/regulator/rk808-regulator.c @@ -1355,7 +1355,7 @@ static struct platform_driver rk808_regulator_driver = { .probe = rk808_regulator_probe, .driver = { .name = "rk808-regulator", - .probe_type = PROBE_PREFER_ASYNCHRONOUS, + .probe_type = PROBE_FORCE_SYNCHRONOUS, }, }; -- 2.39.2