From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B78443822B5 for ; Tue, 4 Aug 2026 11:56:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785844572; cv=none; b=pMHA1VyOjtCmVxMlKN4Yn343IkR4WttvBM8SnBAV4+69QvLHbs92nuQHF73a7hBFZ06OzIiZCtDbUnEj/cDd7+s4UywM0GXpzBNC29H5RIBtMLt4T3KOFCSeETP57tlbPOsMfGYuDNhRuSjJaWrOSUWud+i9WjYpdrs4mqK+A2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785844572; c=relaxed/simple; bh=f2uFUXzOh9ed2PB9UIZrruaq47ewE/vvHcYpSlqLKnc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T4EiVp6+k8HQzskxLwFlV7+2kAdB306V063fFOgYYW0D/kNDoVfz0hODe7uF4WGwrj2EgujnyvNedyyBxyt6HS1iimKrW80tIwpP3AZrMeGgwR6jcDyaNL7KG2TGhEbc28QHt/jT5srgCSVJxseJ1JiwU7vejeJVMM0aPv8jUJ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eQ6kE6FS; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eQ6kE6FS" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-47f59f25ec4so1641358f8f.2 for ; Tue, 04 Aug 2026 04:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785844568; x=1786449368; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hYG4UXLGxO7ttgBOjFjsHN6l7EWjIoeHBMt3IH2Ql0w=; b=eQ6kE6FS5C1FLTE3b0HcVxtGNGIQqeYddMidMRyegJk+PAsJ/mlsF+zSeVQXpM/QfP p9DGvX/p66Hj/EPbTz3x8YAUNo05bfRGyOaUPit7DCFr91pUAuwXxRIgn8wm6CIv5swS t4h5e5tneAkb644hRTzcfUknp4ti7UAZQCy/lSr8RoMKgt2hLLhp4ou1fxwFuTqcW8Z/ ZMtFeZjVFMA5MjOkAHNcWL7sqXzcL3OsRaYI1KkZEboGJd9gA/aDUTpKnBdGdioccSyb Q2GN+5xtUXluWmt9y4K8Ua2UnzbAC0JjwSDIUN1uQRg5wyl1Ci+3twuxzAaQanPuky2U u+aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785844568; x=1786449368; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=hYG4UXLGxO7ttgBOjFjsHN6l7EWjIoeHBMt3IH2Ql0w=; b=jAeyfhBSN5zFqqaJKqwZTQD0sH3vmjDYJMVzHJbjINnZ+LnDQAISpRYD+jBezNJjkC Y+GMruXhBoFmz0UMRKcOTE66cZUsooS2L9XUXYPoilpaZbxOnkpEuZsGpDCvQRX7Q98a LyZ3GVuMyPI9fLifbgTleceZywymInehN7BPD2GfKdDnN+0Tq9SyPyS803uTH/9zsiTu n8gFCD9OvVB1gJY+dwJmJwgSnNvG5kFwDUP5m0eJKKnP3EzIby3UYCtdo7k1ED7rG5/B 28uK2ZL/DRZG8XU0O6QNOVzJpuhfC7KVJYYOsophxWzNXmit4F2+1MDqTY4+LT/XlShJ yiLg== X-Forwarded-Encrypted: i=1; AHgh+RorMTZv8iT47EFEHxKpG+SCzdjyYKGEnwR0xh7nTTB0D0XhK6Cb/lSeyOpKzjOTJFWa8wCE8BLo3HV/WIw=@vger.kernel.org X-Gm-Message-State: AOJu0YwtLgsuoWKPjP9SVzT7LmBIHiEkNDKgRNupKbdbKhwXg5Gcn1rI IT7Ag+nujKxqKqjZI6Y5jsMBuxmGNbk4AymN7D5rDpXX3RapnOA/rl5K X-Gm-Gg: AR+sD10JLn7F1lAaX303e/9zY/c3p64PZs5EVX6bv21H9pqTT7zsJghQ56jN8NtH9M3 WPNNyzUQBCuK7fF2cIx1XtSdd7sb1R1CWVJ44Mv/Mp4nN+6+bmMVadr63k3NLOakiwCDgLKFLr4 WUdo5x0wQ0PzJvSLfq/rvhHbRM+qiZAk+K3SRI+XhJYfXOWQY8TK6ekbkdRbaG7JnOJG5zCehwP tdkPsp87fm08Q9L7lZ9YZBkTiYd0ne+9eDq8oxKLp3WtNnGtoGOij2b3vJj/gvYfHdDurxbHGwf IR0RK2Wt7AuHSEq2PvBcmws69CZf782h7ET2yA/pmoTjB0+eCzgT7opeeuv6wNOKRJKw4theyjE QvmBJHJFtmDOY/FrYbu816+7wVBvFlnfy2fQAVrEHB3zlmrdz7hafp2KADgCCpUwr37LbXZgwHv AABZk0A0/dv2IsMxAQjen3FVxRWtUwGrE8+ZulEjZ3sk6VbOKbl3U2NCEPbS/yL/dV8rTwLFN3R D1seGNCgcmheoedMJp8gdQ1cXxB8KctBb+KUV0= X-Received: by 2002:a05:6000:491d:b0:47f:93fc:2d27 with SMTP id ffacd0b85a97d-47fd72f08f6mr36644389f8f.30.1785844567776; Tue, 04 Aug 2026 04:56:07 -0700 (PDT) Received: from VivoBook-ASUS-X712UA-M712UA.lan (public-gprs192228.centertel.pl. [46.134.90.37]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fd45a1abfsm42083414f8f.37.2026.08.04.04.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2026 04:56:07 -0700 (PDT) From: Stanislaw Pal To: Bjorn Andersson , Stephen Boyd , Michael Turquette Cc: Jie Luo , Mieczyslaw Nalewaj , Brian Masney , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v2] clk: qcom: ipq-cmn-pll: keep the CMN block bus clocks enabled Date: Tue, 4 Aug 2026 13:53:59 +0200 Message-ID: <20260804115359.16633-1-kuncy7@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260730191353.557494-1-kuncy7@gmail.com> References: <20260730191353.557494-1-kuncy7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The probe function takes a runtime PM reference to enable the GCC AHB & SYS clocks of the CMN PLL block, registers the clocks, and then drops the reference, letting pm_clk gate both clocks a few milliseconds after probe has returned. The clock ops access the CMN PLL registers without a runtime PM reference of their own, and on IPQ5018 gating the CMN block bus clocks makes the SoC hang on a subsequent bus access: boards died silently within milliseconds of the CMN PLL probe, up to a 100% reproducible boot loop, depending on binary layout (micro-timing). Take a devres-managed runtime PM reference in probe, so the bus clocks stay enabled for as long as the driver is bound and the reference is released again on unbind. Fixes: f81715a4c87c ("clk: qcom: Add CMN PLL clock controller driver for IPQ SoC") Cc: stable@vger.kernel.org Signed-off-by: Stanislaw Pal --- Changes in v2: - Use devm_pm_runtime_get_noresume() instead of simply skipping the pm_runtime_put() on the probe success path. The v1 arrangement left the usage count elevated with nothing to balance it on unbind; the devres action releases it. Spotted by the Sashiko automated review (thanks to Mieczyslaw Nalewaj for pointing it out). Note that pm_runtime_reinit() on unbind does set the status back to suspended, so the leak did not have the re-bind consequences the report suggested - but it was a leak nonetheless, and the devres form is the idiomatic way to express "keep this device resumed while bound". - The diff is now purely additive; the existing error handling in probe is left untouched. Note for stable: devm_pm_runtime_get_noresume() was added in v6.16 by commit 73db799bf5ef ("PM: runtime: Add new devm functions"), while this driver dates back to v6.14. On 6.14.y/6.15.y (both EOL) the equivalent is to move the pm_runtime_put() out of probe and add one to ipq_cmn_pll_clk_remove() instead. v1: https://lore.kernel.org/linux-clk/20260730191353.557494-1-kuncy7@gmail.com/ drivers/clk/qcom/ipq-cmn-pll.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/clk/qcom/ipq-cmn-pll.c +++ b/drivers/clk/qcom/ipq-cmn-pll.c @@ -437,6 +437,17 @@ static int ipq_cmn_pll_clk_probe(struct if (ret) return ret; + /* + * The clock ops access the CMN PLL registers without taking a + * runtime PM reference of their own, and on IPQ5018 gating the CMN + * block AHB & SYS clocks after probe hangs the SoC on a subsequent + * bus access. Hold a reference for as long as the driver is bound + * so that the bus clocks stay enabled. + */ + ret = devm_pm_runtime_get_noresume(dev); + if (ret) + return ret; + /* Register CMN PLL clock and fixed rate output clocks. */ ret = ipq_cmn_pll_register_clks(pdev); pm_runtime_put(dev);