Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA71AC982DE for ; Mon, 21 Sep 2026 06:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0CRy1pyedhyJ0pJQWni4nQgMeHUoCc4miHTTc2/TOy0=; b=XAi9e3ZROso2Np kOfybxHXRLOe6jFyanJsJxqH2eZI79GcfFlgm1HBmrQLAAaB9Q2vnmhjK/tHG4Gt57/tgGitJ9x+s DU71fTI/C9Lt8B2vUEnh7js+tb+VaRaAIa2gYQBYV9x2a38DHvYo2ZrjwXgjw4n4wTXYDENvEaHWk YLMRNBKhWxXMYh7PH3KBDMbjgnnyYdogrPcl99wo3ivkUCkknxem3Sw9csuFb4RKXC/Mwm4zakoHb uawa/o8AeR/xgtdyBBMcJ8b6Bm4WU+WZgXAxev5ND/DkrSFJr2WaD+9AQrPWF9r5Ez6Ff/aLfYC6v X8aqV6Wrjhsj0FjHDmxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x8XuK-000000017s8-3Eso; Mon, 21 Sep 2026 06:53:44 +0000 Received: from mail-m128228.netease.com ([103.209.128.228]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x8XuI-000000017qI-1lpt for linux-rockchip@lists.infradead.org; Mon, 21 Sep 2026 06:53:43 +0000 Received: from localhost.localdomain (unknown [61.154.14.86]) by smtp.qiye.163.com (Hmail) with ESMTP id 4e889c066; Mon, 21 Sep 2026 14:53:38 +0800 (GMT+08:00) From: Shawn Lin To: Ulf Hansson , Heiko Stuebner Cc: Sebastian Reichel , linux-pm@vger.kernel.org, linux-rockchip@lists.infradead.org, Shawn Lin Subject: [PATCH v3 3/4] pmdomain: rockchip: don't ignore clock lookup errors on attach Date: Mon, 21 Sep 2026 14:52:52 +0800 Message-Id: <1789973573-151146-4-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1789973573-151146-1-git-send-email-shawn.lin@rock-chips.com> References: <1789973573-151146-1-git-send-email-shawn.lin@rock-chips.com> X-HM-Tid: 0aa0c2bddec603a4kunmfcbddeea30c3c0 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkZS05NVkpNGk1KGUJNSh1MSlYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlNSlVKTk9VSk9VQ01ZV1kWGg8SFR0UWUFZT0tIVUpLSU 9PT0hVSktLVUpCS0tZBg++ DKIM-Signature: a=rsa-sha256; b=U1en4AOeVs5x8FopBm5fX92B0QNGN9KYSXVzFRe2K1Osm8EVeJ12MSFr9yBECO2DRKzIS/6Bso5+wlhJ4HjSTwphxMFdkftFS1Ikqraq3ccY0QyvBMmLDRSgSy4kH+wIJ35BsbYLFovCZLVSbb5SkMuON7/mCfWdARI/VDqFgus=; s=default; c=relaxed/relaxed; d=rock-chips.com; v=1; bh=LDzfuJ9zFjGPIivIDj5ael+x0eh5KurV+j4tyeiVfgc=; h=date:mime-version:subject:message-id:from; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260920_235342_680898_A06B239F X-CRM114-Status: GOOD ( 12.00 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org rockchip_pd_attach_dev() treated every of_clk_get() error as the end of the clock list, so a clock that exists but is not available yet (e.g. -EPROBE_DEFER) was silently skipped and the device ended up without pm_clk management. Only -ENOENT means there are no more clocks. Fixes: 7c696693a4f5 ("soc: rockchip: power-domain: Add power domain driver") Signed-off-by: Shawn Lin Reviewed-by: Sebastian Reichel --- Changes in v3: None Changes in v2: None drivers/pmdomain/rockchip/pm-domains.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c index b6b099b..e193f97 100644 --- a/drivers/pmdomain/rockchip/pm-domains.c +++ b/drivers/pmdomain/rockchip/pm-domains.c @@ -759,7 +759,19 @@ static int rockchip_pd_attach_dev(struct generic_pm_domain *genpd, } i = 0; - while ((clk = of_clk_get(dev->of_node, i++)) && !IS_ERR(clk)) { + while (1) { + clk = of_clk_get(dev->of_node, i++); + if (IS_ERR(clk)) { + error = PTR_ERR(clk); + if (error == -ENOENT) + break; + + dev_err(dev, "failed to get clock %d: %d\n", i - 1, + error); + pm_clk_destroy(dev); + return error; + } + dev_dbg(dev, "adding clock '%pC' to list of PM clocks\n", clk); error = pm_clk_add_clk(dev, clk); if (error) { -- 2.7.4 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip