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=1796302421; b=usk8OzihgB9njxHHHprsjfbd3QmQMAPLT5/DZ8nj+sJx26dlq0NIokVrjUCCMLfkZl8n iRftOGrrxQMgbN1diFS2ZNlbqpJSNuASmYZGw7e6C5BTbywdMVhNxSdFZ67ea79n4niia JPG+LLriCY/Pl0d5ttRtZdJAj/IYtKE8RVB0hOz9sT8PbGxv8ixuBmuuIehuJnagA2gQo Am2tncQYdZNP6lgoZxHSSIzNMVC7uX8Qb+Tmlj9quQ6OXrj1t+4gDpH2+0ZtpfFFdNDH1 SatRhU/NL2/K/33dUkUPmAxtvL3j+XucklcKf3bu1aBwIX22vSojQqgshwFqomxyj9w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796302421; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=L5y0uWHtwWHjCkjke0+mQWyYMAWN0y3EpddiiUITSHk=; b=0QrDzBhz565s+U4apTNT804Tf0eEW45ilK5PbqtqvbYnKWQu6CigtHwVJ2y2Fqd4QxFd aVZE+OdpjO+2ii2zA0BxhCXt/ial1EaAZz17X1kwlWjbop4R59qrpAIuoQ+30CFl1IbWz OHVuOTDYN6vnLBU3IWnrOgEp5sufYHPPp8Hgn7p9O/kiUT9s9d2tJyoqGO98wOsYdvX4a OTKl3R6BGMCIcfK08aF3NeLrJTY1+UB+j6EUjXjPGk5IvR20xMPtqVvm69ShnGIhJ0hcB cpQn06EdU/zr+w9Z8MwDr9i52kEMwDBcbBsUHsTUUjUE16iGa1XN3/WT6asI1AwFluQ== 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=Myzr0AN3; 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 72D49606A322; Thu, 3 Dec 2026 12:53:41 +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=Myzr0AN3 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8267E1F000C1; Thu, 3 Dec 2026 12:53:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796302421; bh=L5y0uWHtwWHjCkjke0+mQWyYMAWN0y3EpddiiUITSHk=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Myzr0AN3hpbxfZRUXTtvV3i7YYvzeyKNR5vFmnbY5zO3CmzaQaEB/4B+XCxtLcGwx VrHXoK7L8dsDQjqTKEHCUnHj+9HhPybkZUpf+RDco6wQP/hHLmYTk21A6WKVpRlvuU YUf9LMCFhSNqEn0w8QYo/OvtHeNfDcz4nnb+fRqS2/u8ZbB59dtwGzXSvlu+WtN4Ya MbirpwEVZAHDEI/zc12nIvOWWFMAe0VOG/CpipnFvI4stzipG7cYy5gsR/odLasjvH sWRaPveYBJX8aCkrTsSxgsE5Z08TKX14xOawcHt9mAlNiYsNDLv4LcUAj5Pj7MVI96 HCclsl+7AOEyw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 5/6] ice: Link storage consumers for runtime PM 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-5-86f79ce468b5@oss.qualcomm.com> References: <20261203-qcom_ice_pm_enable-v3-0-86f79ce468b5@oss.qualcomm.com> <20261203-qcom_ice_pm_enable-v3-5-86f79ce468b5@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 12:53:40 +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 7 potential issues to consider: - [High] soc: qcom: ice: removing resume/suspend breaks legacy DT bindings - [High] soc: qcom: ice: clocks stay permanently disabled under CONFIG_PM=3Dn - [High] soc: qcom: ice: legacy DT bindings leave ICE clocks off and skip resume - [High] ufs: qcom: UFS v5.0.0 ICE reset now runs after qcom_ice_runtime_resume() - [High] soc: qcom: ice: PM link resumes ICE before consumer clocks on legacy DTBs - [Medium] soc: qcom: ice: leak supplier RPM ref on ufs-qcom probe failure - [Medium] soc: qcom: ice: missing clock disable in qcom_ice_remove() when RPM active -- commit d6be345364d48f56eae0a0efabdbaa3684476c9c Author: Kuldeep Singh ice: Link storage consumers for runtime PM This commit adds a runtime PM device link from storage consumers to the ICE supplier in of_qcom_ice_get() and removes the explicit qcom_ice_resume() and qcom_ice_suspend() calls from sdhci-msm and ufs-qcom. > diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c > index 32b1bcba47d6b..73b2851c51c56 100644 > --- a/drivers/mmc/host/sdhci-msm.c > +++ b/drivers/mmc/host/sdhci-msm.c [ ... ] > @@ -2983,15 +2955,11 @@ static int sdhci_msm_runtime_resume(struct device= *dev) > =20 > dev_pm_opp_set_rate(dev, msm_host->clk_rate); > =20 > - ret =3D sdhci_msm_ice_resume(msm_host); > - if (ret) > - return ret; > - > spin_lock_irqsave(&host->lock, flags); > host->runtime_suspended =3D false; > spin_unlock_irqrestore(&host->lock, flags); > =20 > - return ret; > + return 0; > } [Severity: High] Does removing sdhci_msm_ice_resume() break platforms using the legacy devicetree binding where the storage node provides an "ice" reg range instead of a "qcom,ice" phandle? In of_qcom_ice_get(), legacy DT consumers return qcom_ice_create() early without a separate qcom-ice device or PM device link, and qcom_ice_create() disables engine->core_clk and engine->iface_clk before returning. Because sdhci-msm does not manage the ice clock (for example on sdm670), nothing re-enables it after probe, so later calls to qcom_ice_enable() and qcom_ice_program_key() access ICE registers while unclocked, causing bus hangs, SErrors, or BIST timeouts. [ ... ] > diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c > index ea4a79c98b232..1fe1f1bb21c98 100644 > --- a/drivers/soc/qcom/ice.c > +++ b/drivers/soc/qcom/ice.c > @@ -725,7 +725,9 @@ static struct qcom_ice *of_qcom_ice_get(struct device= *dev) > return ice; > } > =20 > - link =3D device_link_add(dev, &pdev->dev, DL_FLAG_AUTOREMOVE_SUPPLIER); > + link =3D device_link_add(dev, &pdev->dev, DL_FLAG_PM_RUNTIME | > + DL_FLAG_RPM_ACTIVE | > + DL_FLAG_AUTOREMOVE_SUPPLIER); > if (!link) { > dev_err(&pdev->dev, > "Failed to create device link to consumer %s\n", [Severity: Medium] Can combining DL_FLAG_RPM_ACTIVE with DL_FLAG_AUTOREMOVE_SUPPLIER leak the ICE supplier's runtime PM reference if ufs-qcom probe fails? In ufshcd_pltfrm_init(), ufshcd_init() calls ufs_qcom_ice_init() while hba->dev is still RPM_SUSPENDED, before pm_runtime_set_active(). If ufshcd_init() later returns an error, __device_links_no_driver() does not drop DL_FLAG_AUTOREMOVE_SUPPLIER links and pm_runtime_reinit() skips rpm_put_suppliers() because hba->dev is already RPM_SUSPENDED, leaving ICE clocks and its power domain permanently active. Using DL_FLAG_AUTOREMOVE_CONSUMER would drop the link and release the supplier reference on consumer probe failure. [Severity: High] Will ICE clocks stay permanently disabled when the kernel is built with CONFIG_PM=3Dn? QCOM_INLINE_CRYPTO_ENGINE does not depend on or select PM. When CONFIG_PM=3Dn, qcom_ice_create() still disables core_clk and iface_clk before returning, while pm_ptr(&qcom_ice_pm_ops) evaluates to NULL and DL_FLAG_RPM_ACTIVE is a no-op, leaving ICE unclocked during qcom_ice_enable() and keyslot programming. [Severity: High] Can linking ICE as a PM supplier resume ICE before the storage consumer's shared AHB clock and power domain are enabled on older deployed DTBs? The DT binding in qcom,inline-crypto-engine.yaml preserves compatibility for older standalone ICE nodes (for example on sm8550) that declare only core_clk without an iface clock or power-domains. With DL_FLAG_PM_RUNTIME, __rpm_callback() runs qcom_ice_runtime_resume() before the storage consumer enables its AHB clock and UFS_PHY_GDSC, so qcom_ice_hwkm_init() and qcom_ice_wait_bist_status() access ICE MMIO registers while the block is still powered off or unclocked, causing an SError or bus hang. [Severity: Medium] If qcom-ice is unbound while runtime-active, does qcom_ice_remove() leak the prepare and enable counts on core_clk and iface_clk? qcom_ice_remove() only clears the xarray entry and relies on devm_pm_runtime_enable() and devm_clk_get() cleanup, neither of which invokes qcom_ice_runtime_suspend() or disables clocks. When usage_count is still non-zero at unbind (for instance after a failed ufs-qcom probe leaks the supplier link reference, or if userspace set power/control to "on"), __device_release_driver() skips runtime suspend before devres_release_all() puts the clocks. > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c > index 6afb8498b8c26..2e65b55f14052 100644 > --- a/drivers/ufs/host/ufs-qcom.c > +++ b/drivers/ufs/host/ufs-qcom.c [ ... ] > @@ -859,25 +833,22 @@ static int ufs_qcom_resume(struct ufs_hba *hba, enu= m ufs_pm_op pm_op) > ufshcd_readl(hba, UFS_MEM_ICE_CFG); > } > =20 > - return ufs_qcom_ice_resume(host); > + return 0; > } [Severity: High] Does dropping ufs_qcom_ice_resume() skip ICE resume on legacy UFS devicetree bindings (such as sdm845 and sm8150)? When the UFS node provides an "ice" reg range instead of a "qcom,ice" phandle, of_qcom_ice_get() returns early without creating a PM device link or binding qcom_ice_pm_ops. Without ufs_qcom_ice_suspend() and ufs_qcom_ice_resume(), ice->hwkm_init_complete is never cleared on suspend and qcom_ice_hwkm_init() and qcom_ice_wait_bist_status() never run on Hibern8 resume. [Severity: High] On UFS v5.0.0 controllers (such as SM8550), does the ICE synchronous reset in ufs_qcom_resume() now run after qcom_ice_runtime_resume()? With ICE linked as a PM supplier of hba->dev, PM core runs qcom_ice_runtime_resume() before resuming hba->dev and calling ufs_qcom_resume(). ufs_qcom_resume() then pulses UFS_ICE_SYNC_RST_SW in UFS_MEM_ICE_CFG, wiping the HWKM configuration while leaving ice->hwkm_init_complete set and skipping the post-reset BIST wait; on Hibern8 resume, __ufshcd_wl_resume() does not call ufs_qcom_ice_enable(), breaking wrapped-key programming and encrypted I/O. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-qcom_ice_p= m_enable-v3-0-86f79ce468b5@oss.qualcomm.com?part=3D5