From nobody Wed Sep 30 12:52:28 2026 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 BF5A93A3E7A for ; Sat, 8 Aug 2026 08:02:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786176154; cv=none; b=qVhnWFlLDW4Mqyy3dQn+Vx6NVDFl9Wj8rn4R9RHbIIZEr8/KYHNWAtOcx8jovlln2qgwwBT94lp5SWG5Lu39+sXOplcD0P/YEAiA1uFC28dTECaJJDM9h36e2ZAcMy53vkbgrFDGYWwr5tGdn2a5rIcWDaNLT1Dy4NJFrvbRa6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786176154; c=relaxed/simple; bh=Qtiy299hgXH9miMRATmDtFVX36AP62Lyow4p85Fjtoc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bPuFsIPh+uzIXubsVTMpvmjd805qAO3fxLYQxnDBlgxybEwaH+cHJckKlPfR/UorgU0xz0bRxpH1PTEqKhd8BDH8i9WIwXmtg98evC8FUw/ZH2qZSYN68nr5yTjWZke89Rq07Y7hRj92HzLdv5K1ViQf9JTb9bKDO18GdYgcI24= 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=JNPg3EaY; arc=none smtp.client-ip=209.85.216.46 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="JNPg3EaY" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-3810c5d691bso258483a91.1 for ; Sat, 08 Aug 2026 01:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786176152; x=1786780952; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=mLmbCLzuywYLsOVyyYkrBNI0Jw0ZVFv5psG5aDAHyEg=; b=JNPg3EaYpemhj5aP4kfgqpmVEISAlaurH7WdqXRKhxVvFnqDGkKzu0yK1gGEpRU0Qj wh0UkCLyDpBgdYs0qhnSIes7fNAZg5yJ2XeEc3aNgg3GdhpHvnwsSokZB9w1YSXPFwdU o4+JYc97JZ0w10ekv8zjZ8q4EEO/Jpx4QvrHwE2UChjl8SMfzyiKlMNkQTAtlXZZU7DV naE2yQkAlLVDDFqUf0OIIqTzMrCZFOTV5zH7/hSR4fZh+8OYbJls4dUAUti/iwrRNiGD FPB1dxq3IoFzDvhKo35+Rh0FVHAJRqbRLi0pJlW5pm3AEwvBY/eLJp/VhZZENxprywOF jdZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786176152; x=1786780952; h=content-transfer-encoding:mime-version: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=mLmbCLzuywYLsOVyyYkrBNI0Jw0ZVFv5psG5aDAHyEg=; b=eGPUY6V8qrACvfog4lhXmh0tjgJqqYTpruKlKh3KErJ/5Wt0itMp+wK/x1l8QytJ1g Fh7xw7W/fvDtJ8S8ToVKLMHdIqPfFfBwF2Kl267O/d/hYReA/vp4YY/yHKhj+C7cC9P8 Ruh3gLf12K8jY7vKtB+rA8GEcCuOI0d7JSnFWnoSy5suzJvGIOu0nXNHs937aA6IgtrA 7RgLMj7ZjcWZkAUhdnmVQS1MULb7+fxNRCbjdxNgVG52iT5N3Sb8EZSAdOMJCnlZt1o6 ucc/VglKFdvMd4jfRbyrGfZnuSee7ZIIBuLafdcsKRSS7bDQJ9beK/ehlZblDdeQuePe ld4w== X-Forwarded-Encrypted: i=1; AHgh+Ro3SMRuOnqNYGLqQpL2ATpDA/7VtELdM19XhanTJr/iVP2Alb6JqJLBffvwv8Gpv55wA9Oq2zd5IT+XMho=@vger.kernel.org X-Gm-Message-State: AOJu0YyhnBiXwybcl/0EgWgjFKwBDfTjV43bASf5LIjczg33jpWlgV+I ZSlklUjttACquJ0CfxRmA+buXdaXmjN8HsFlK7DFl5/AKhtc81gVRcfy X-Gm-Gg: AR+sD13fwdURX+CgGffMndJpt5md5WblblUbeTfQ7AXO6jqkU+C+Vffeybo11W0f9pO DfJoWoqliQkAuVWmc1Rag50GUnGErDHvYgk2vBnuyyx4QE+z6F8NdzJ6TM5LPFqHdrlZY1AvERs 5ybuldTb+UnJt+RjWvcENPyrj6koUNvKkssD3MydPdTUYjiCagd050L0p0/f3aNVjtPipmUILGx U3f0wwQU7h1yCNdwbAPq0rimouAaUUgDkYB3/J+lqkbdNgYw+vHTC+oWeqiSB57WVoyT383Xzp0 ZqmPSF/IH41eJcqfGpTYO+ZwY1Eu6y7CMeSe8zx8b0rg8DoBQo9Ec6+/3JCYIoXB5/beRewM/pS hkhQMqCm1d1ig5x6TDTM7M/R+tQ1/MwHMcoCHFsunlz6CEKZBu6gydBLdq6Cof4zjdy3vEHpRk2 HKBxbT89hJzBs/NiOYjIY9+yXNMexY1SO84gGrmAu8INzSjpG4Kpj8HyEXs+JGa0snERRzOMxx/ 9QNEQeW X-Received: by 2002:a17:90b:1d02:b0:37f:fdc8:71b4 with SMTP id 98e67ed59e1d1-3903c599356mr29221904a91.2.1786176151990; Sat, 08 Aug 2026 01:02:31 -0700 (PDT) Received: from lgs.. ([101.76.249.46]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-39085de8ddcsm7774143a91.6.2026.08.08.01.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Aug 2026 01:02:31 -0700 (PDT) From: Guangshuo Li To: Abel Vesa , Peng Fan , Michael Turquette , Stephen Boyd , Brian Masney , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Dong Aisheng , Shawn Guo , linux-clk@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Guangshuo Li , stable@vger.kernel.org Subject: [PATCH] clk: imx: imx8qxp-lpcg: fix runtime PM cleanup on error path Date: Sat, 8 Aug 2026 16:02:15 +0800 Message-ID: <20260808080215.2669452-1-lgs201920130244@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" imx_lpcg_parse_clks_from_dt() takes a runtime PM usage reference with pm_runtime_get_noresume() and enables autosuspend with pm_runtime_use_autosuspend(). The success path drops the usage reference with pm_runtime_put_autosuspend(), but the error path only disables runtime PM. As a result, the reference taken by pm_runtime_get_noresume() remains unbalanced on registration failure. The autosuspend setting is also left enabled instead of being undone with pm_runtime_dont_use_autosuspend(). Add pm_runtime_dont_use_autosuspend() to undo the autosuspend setting and pm_runtime_put_noidle() to drop the usage reference on the error path. This issue was found by manual code inspection. Fixes: 18cdbad40c6c ("clk: imx: clk-imx8qxp-lpcg: add runtime pm support") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li Reviewed-by: Brian Masney --- drivers/clk/imx/clk-imx8qxp-lpcg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx8qxp-lpcg.c b/drivers/clk/imx/clk-imx8q= xp-lpcg.c index 1dae3410ee99..262645bef62d 100644 --- a/drivers/clk/imx/clk-imx8qxp-lpcg.c +++ b/drivers/clk/imx/clk-imx8qxp-lpcg.c @@ -277,8 +277,9 @@ static int imx_lpcg_parse_clks_from_dt(struct platform_= device *pdev, if (clk_hws[idx]) imx_clk_lpcg_scu_unregister(clk_hws[idx]); } - + pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_disable(&pdev->dev); + pm_runtime_put_noidle(&pdev->dev); =20 return ret; } --=20 2.43.0