From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796302178; b=5YJLDQvNFQ0nVyDDhSuGSfBEROg+YW2RmSP8dSVkGGETotL7KMIXEvp14pM72TDZlq8+ oQZ2nIslL2UcQlzVrmeTXHQteTTh/z9hjSqh733RbNavKtncSEDGsfXe1pRN6m07GppwJ fJ75QjWg98aKOlZDMxEe5d+WxQAP51XCcIgGyA4U0BNtNZ5YuEOHLjwfEjSTOTgLI4kbB /nhFHNBcma8gRh2nHFmz88TOVHx/BtqWHBefzae7zvGwRn9sM2p8W5TlLAzJDVbDd5Aij zSZgJ7aBkEOEk6tmnYWWti5M2sdyU/6ZFh8+Fpe9JE3eylyDRrfuXBt+YDzVDfXrAMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796302178; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=6Yuqnu0dcB4QsyKLE0M6FgEg2LTN7yclrnOO05ejzUE=; b=5LAbAVxnNqfPusl2E8hNqUTSa1qGVdffOuXXY5qu1yqhEyFa724YO4pR4TzpBG/zrnkO cQZsEm3/KjMPwOrovkcDF9656UsoYyn+z1YjpHaS8HmaGNREEJJ9sZrKD3To5q2v7CoQT w+jeLdjBSwUlgnSbv6quKaDWIj6PP9MUelDSDwooKhxjY2EhhI0gcxLp75ko12EV29uvs X2XwBMj6FLnuqSkzHIYlNWvBcvhijJS8qvxqQ990Z+1NCNecc13zt9vM5+sdzRp2pB/Zt jjkS9pP/c6I2ZpjfemXYSGav6RUhXbjY1Phk6jJzaEg/oUOtis7+Zoltw7o6VhSjEdA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gCL5RyUx; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FEBD606A32C; Thu, 3 Dec 2026 12:49:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gCL5RyUx Received: by smtp.kernel.org (Postfix) with ESMTPSA id DECB01F00896; Thu, 3 Dec 2026 12:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796302177; bh=6Yuqnu0dcB4QsyKLE0M6FgEg2LTN7yclrnOO05ejzUE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=gCL5RyUxpAKyGwUK1yl0bLg3f0nc5I8ldkhvb5pmAq2Zi8vUMLwij0/KpEFNwqaLE tvUdATjj1u7fEneVuLXn0gQ97qJf0llk0h0I78rlQ21yQDQXL4EXNQQ4q8S8NhtGzk SxRv1McEZcD9dF4Ec+rX4kjuQa9Pnaye5wilBjzAdLMiUaHdkTkm0eNQMIpph7uagL i9GJO8LdZX5ljP9/GevX6ZzIRvqsnycR0bhyJgsPgS33OUoBTG4chFt49j6xvd29Jo dJWdHu6UqOkivU+9AzXk7e4FPqdwCvyktNd8ZOAGcHEzp74FL98xjF65FPmCzmvid2 LvJkyVo2DaQrw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 4/6] soc: qcom: ice: Add runtime PM support Reply-To: sashiko-reviews@lists.linux.dev To: "Kuldeep Singh" , "Abel Vesa" , "Bjorn Andersson" , "Konrad Dybcio" , "Manivannan Sadhasivam" , "Harshal Dev" , "Eric Biggers" , "Ulf Hansson" , "Bartosz Golaszewski" , "Martin K. Petersen" , "Gaurav Kashyap" , "Adrian Hunter" , "James E.J. Bottomley" Cc: "Konrad Dybcio" , linux-crypto@vger.kernel.org, linux-scsi@vger.kernel.org In-Reply-To: <20261203-qcom_ice_pm_enable-v3-4-86f79ce468b5@oss.qualcomm.com> References: <20261203-qcom_ice_pm_enable-v3-0-86f79ce468b5@oss.qualcomm.com> <20261203-qcom_ice_pm_enable-v3-4-86f79ce468b5@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 12:49:36 +0000 X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [High] soc: qcom: ice: disabling clocks in qcom_ice_create() breaks legacy DT and !PM - [High] soc: qcom: ice: qcom_ice_create() disables clocks breaking legacy sdhci-msm - [Medium] soc: qcom: ice: qcom_ice_remove() leaks enabled clocks on driver unbind -- commit 8259f425b33ced4a304438e153146ff4e36ea494 Author: Kuldeep Singh soc: qcom: ice: Add runtime PM support This commit adds runtime PM callbacks to the Qualcomm ICE driver to gate core_clk and iface_clk when idle, disabling the clocks at the end of qcom_ice_create() and marking the ICE platform device suspended in qcom_ice_probe(). > diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c > index beeaa67082062..ea4a79c98b232 100644 > --- a/drivers/soc/qcom/ice.c > +++ b/drivers/soc/qcom/ice.c [ ... ] > @@ -348,14 +367,23 @@ EXPORT_SYMBOL_GPL(qcom_ice_resume); > =20 > int qcom_ice_suspend(struct qcom_ice *ice) > { > - clk_disable_unprepare(ice->iface_clk); > - clk_disable_unprepare(ice->core_clk); > ice->hwkm_init_complete =3D false; > + qcom_ice_disable_clocks(ice); > =20 > return 0; > } [Severity: High] Can qcom_ice_suspend() underflow the ICE clock counts on first consumer suspend at this commit, and does disabling clocks in qcom_ice_create() break legacy sdhci-msm targets? At this commit, qcom_ice_create() disables core_clk and iface_clk before returning, while of_qcom_ice_get() has no runtime PM device links yet. Dedicated-DT consumers call qcom_ice_enable() during probe while ICE is unclocked, and consumers call qcom_ice_suspend() on first suspend. This underflows CCF prepare/enable counts and breaks git bisect, though commit "ice: Link storage consumers for runtime PM" resolves the bisectability issue later in the series. On legacy sdhci-msm DT targets, sdhci_msm_probe() never acquires or enables the "ice" clock (GCC_SDCC1_ICE_CORE_CLK), and of_qcom_ice_get() returns directly from qcom_ice_create() without runtime PM ops or a device link. Disabling core_clk in qcom_ice_create() therefore leaves ICE unclocked when sdhci_msm_cqe_enable() -> sdhci_msm_ice_enable() -> qcom_ice_enable() accesses ICE registers, risking bus errors or BIST timeouts even at the end of the series. [ ... ] > @@ -599,25 +628,31 @@ static struct qcom_ice *qcom_ice_create(struct devi= ce *dev, > * Legacy DT binding uses different clk names for each consumer, > * so lets try those first. If none of those are a match, it means > * the we only have one clock and it is part of the dedicated DT node. > - * Also, enable the clock before we check what HW version the driver > - * supports. > */ > - engine->core_clk =3D devm_clk_get_optional_enabled(dev, "ice_core_clk"); > + engine->core_clk =3D devm_clk_get_optional(dev, "ice_core_clk"); > if (!engine->core_clk) > - engine->core_clk =3D devm_clk_get_optional_enabled(dev, "ice"); > + engine->core_clk =3D devm_clk_get_optional(dev, "ice"); > if (!engine->core_clk) > - engine->core_clk =3D devm_clk_get_optional_enabled(dev, "core"); > + engine->core_clk =3D devm_clk_get_optional(dev, "core"); > if (!engine->core_clk) > - engine->core_clk =3D devm_clk_get_enabled(dev, NULL); > + engine->core_clk =3D devm_clk_get(dev, NULL); > if (IS_ERR(engine->core_clk)) > return ERR_CAST(engine->core_clk); > =20 > - engine->iface_clk =3D devm_clk_get_optional_enabled(dev, "iface"); > + engine->iface_clk =3D devm_clk_get_optional(dev, "iface"); > if (IS_ERR(engine->iface_clk)) > return ERR_CAST(engine->iface_clk); > =20 > - if (!qcom_ice_check_supported(engine)) > + err =3D qcom_ice_enable_clocks(engine); > + if (err) > + return ERR_PTR(err); > + > + if (!qcom_ice_check_supported(engine)) { > + qcom_ice_disable_clocks(engine); > return ERR_PTR(-EOPNOTSUPP); > + } > + > + qcom_ice_disable_clocks(engine); [Severity: High] Does unconditionally disabling core_clk and iface_clk at the end of qcom_ice_create() leave ICE unclocked on legacy DT bindings and when CONFIG_PM is disabled? When CONFIG_PM is disabled on dedicated ICE DT platforms, pm_ptr() drops qcom_ice_pm_ops and runtime PM helpers compile to no-ops, so qcom_ice_enable_clocks() is never called again. On legacy sdhci-msm DT platforms, of_qcom_ice_get() returns directly from qcom_ice_create() with no runtime PM ops or device link, and sdhci_msm_probe() never enables the ice clock. In both cases, qcom_ice_enable() accesses ICE MMIO registers with core_clk disabled, risking SError crashes, NOC bus hangs during boot, or BIST timeouts. Only disabling the clocks in qcom_ice_probe() when CONFIG_PM is enabled would keep legacy DT and !PM targets clocked. [ ... ] > @@ -771,6 +807,15 @@ static int qcom_ice_probe(struct platform_device *pd= ev) > return PTR_ERR(engine); > } > =20 > + platform_set_drvdata(pdev, engine); > + pm_runtime_set_suspended(&pdev->dev); > + > + err =3D devm_pm_runtime_enable(&pdev->dev); > + if (err) { > + xa_store(&ice_handles, phandle, ERR_PTR(err), GFP_KERNEL); > + return err; > + } [Severity: Medium] Can unbinding qcom-ice while it is runtime-active leak prepared and enabled reference counts on core_clk and iface_clk? Replacing devm_clk_get*_enabled() with devm_clk_get*() removes automatic clk_disable_unprepare() teardown on unbind. If the device is active at unbind time (for example after power/control is set to on via pm_runtime_forbid()), __device_release_driver() leaves it runtime-active. qcom_ice_remove() only clears the xarray entry, and devm_pm_runtime_enable()'s cleanup only calls pm_runtime_disable() without suspending the device, leaving the clocks prepared and enabled when devres puts them. Consumer unbind paths like sdhci_msm_remove() also leave ICE active via pm_runtime_get_sync() before pm_runtime_disable(). Because the link uses DL_FLAG_AUTOREMOVE_SUPPLIER rather than DL_FLAG_AUTOREMOVE_CONSUMER, unbinding the consumer does not drop the link, leaving ICE clocks enabled. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-qcom_ice_p= m_enable-v3-0-86f79ce468b5@oss.qualcomm.com?part=3D4