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=1796302432; b=JLVLIwRbio3x6tvliF22ZBX2u734NNDyt6eeHD4J8WJkoHPSXWQO12DUYkOtVcJQuF6x hss8k7ZnyQXGDEP4CkTY3dG5EjoM8REEFjV+IU3C1EJ4kj5QmobeXR7yv6YgsCkNM2T8U qotwEpHaGLo4rL6er2YazRjGNv3Uyyn0yPngeMsfw74NbF7sCSEUwAnA9x56+rbPk/MPX ZA6FrVBBiTM1qeSJDMyssVUi/pK42E5JNZTnIGDa8IQrRQ88htGsp1Q9o+j6PflykEevB cuMd108TKhovVgw4UBuDiULnWoCKwOZ5yW1nYSbGkCw0ASYrFSNJgfUoi2NclibjmpA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796302432; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=NAIUXQa5SNBl90V4He2GgaXNYOTlrpFMHTnEsanm2ng=; b=RTJhY+USV4mAQKo4Jf5IkEzOeOlfYqKIV7lYVPLzEu033PYfqfsaT+ql3JJD7fkkQxiG XW43Gwu+2060zyQpkgJzfyC2Fgp2EhacaKyDlEfIXcqrnd4a8GuGQAOBuxcRqXjMuhJED Z19UyekRcsueVD+/TzQxlHXHuUS8ik/Pr+5hGmPI1zcG8cZpKHH58RsHIUQs8GwYUgCwH Xd/8FmJX2sVwbbTxkfx0bM/Tfoj97lkAbrmnoVQJjKGsD9jqV2SerTfx1k5y/6ti2Lq7C kE7nHl2jzlDoI0Jz9fr0txd1zSvFxLWRHoJwDZt9OVY1Mx6/JOIugxJnvPOWMU1PqKQ== 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=Jpn27N7S; 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 88B1B606A334; Thu, 3 Dec 2026 12:53:52 +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=Jpn27N7S Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7936F1F000C1; Thu, 3 Dec 2026 12:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796302432; bh=NAIUXQa5SNBl90V4He2GgaXNYOTlrpFMHTnEsanm2ng=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Jpn27N7SPABbAAnNkBmzKiPsua6lOpOV1lBhkTVwzI4S2uxSf9iopw6neE57O08Gz EAK3eEN9OyMuc6QR4FOfJaiTwpEDYI/kNsJeTZ1MHju6VUGxhfGvrkxJxve/QaMpdt d1yVilxAIsuCIashxmByKXh54eKqKPv4E7/b6pumYikxMkovCbIE4U27iO7JG8RqcL NZ3aWHYYb7Tc3OXhXMHLQZeOh/NEUNz0/a+GQGC92Ynl0yNQDQAM4uryYDMd4TKg4j 0w7atOW22b6d84XuXVh862Y6pRN6ZL8ZcmVF4yiNpDx4j8PqLHnyWJCPR2DWegvJ5g MYVOV4yCU3ibA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 6/6] soc: qcom: ice: Drop exported resume and suspend APIs 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-6-86f79ce468b5@oss.qualcomm.com> References: <20261203-qcom_ice_pm_enable-v3-0-86f79ce468b5@oss.qualcomm.com> <20261203-qcom_ice_pm_enable-v3-6-86f79ce468b5@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 12:53:51 +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 6 potential issues to consider: - [High] soc: qcom: ice: dropping resume/suspend breaks legacy DT bindings - [High] soc: qcom: ice: unclocked MMIO access when CONFIG_PM is disabled - [High] soc: qcom: ice: legacy DT bindings left unclocked after qcom_ice_create() - [High] soc: qcom: ice: UFS v5.0.0 sync reset runs after qcom_ice_runtime_resume() - [Medium] soc: qcom: ice: DL_FLAG_AUTOREMOVE_SUPPLIER leaks RPM ref on probe failure - [Medium] soc: qcom: ice: qcom_ice_remove() leaks enabled clocks when runtime-active -- commit 56528d5ac3c6c7e88600729e222e97f438e79ee1 Author: Kuldeep Singh soc: qcom: ice: Drop exported resume and suspend APIs This commit folds qcom_ice_resume() and qcom_ice_suspend() into the runtime PM callbacks in drivers/soc/qcom/ice.c and removes their exported symbols and public declarations from include/soc/qcom/ice.h. > diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c > index 1fe1f1bb21c98..6246bbf8968d7 100644 > --- a/drivers/soc/qcom/ice.c > +++ b/drivers/soc/qcom/ice.c > @@ -344,8 +344,9 @@ static void qcom_ice_disable_clocks(struct qcom_ice *= ice) > clk_disable_unprepare(ice->core_clk); > } > =20 > -int qcom_ice_resume(struct qcom_ice *ice) > +static int qcom_ice_runtime_resume(struct device *dev) > { > + struct qcom_ice *ice =3D dev_get_drvdata(dev); > int err; > =20 > err =3D qcom_ice_enable_clocks(ice); [Severity: High] Will ICE clocks stay permanently disabled when CONFIG_PM is disabled? QCOM_INLINE_CRYPTO_ENGINE and its storage consumers do not select or depend on PM. With CONFIG_PM=3Dn, pm_ptr(&qcom_ice_pm_ops) evaluates to NULL and __pm_runtime_resume() in device_link_add() is a no-op stub, so qcom_ice_runtime_resume() never runs. Because qcom_ice_create() unconditionally calls qcom_ice_disable_clocks() before returning and qcom_ice_resume() is gone, subsequent calls to qcom_ice_enable() access unclocked ICE MMIO registers and can hang the bus or trigger an SError at boot. [Severity: High] Are legacy devicetree bindings left with ICE clocks disabled even when CONFIG_PM is enabled? When a storage node provides an "ice" reg range (such as sdhc_1 in sdm670.dtsi), of_qcom_ice_get() returns directly from qcom_ice_create(&pdev->dev, base) without probing qcom_ice_driver, attaching qcom_ice_pm_ops, or creating a device link. Because qcom_ice_create() disables core_clk and iface_clk before returning and sdhci_msm_probe() never enables the "ice" clock, nothing re-enables core_clk. Subsequent calls to qcom_ice_enable() then perform unclocked MMIO accesses during boot, causing a bus hang or SError. [Severity: High] Does folding qcom_ice_resume() into the supplier runtime PM callback break UFS v5.0.0 resume ordering? On UFS v5.0.0 (such as SM8550), ufs_qcom_resume() pulses UFS_ICE_SYNC_RST_SEL | UFS_ICE_SYNC_RST_SW in UFS_MEM_ICE_CFG when the link is not active (for example, on Hibern8 exit). Previously, ufs_qcom_resume() called qcom_ice_resume() after that reset. With runtime PM device links, the PM core runs qcom_ice_runtime_resume() before hba->dev resumes and before __ufshcd_wl_resume() calls ufs_qcom_resume(). The later synchronous reset wipes HWKM setup and starts BIST while ice->hwkm_init_complete stays true, and Hibern8 exit does not call qcom_ice_enable() to re-initialize ICE. > @@ -363,26 +364,16 @@ int qcom_ice_resume(struct qcom_ice *ice) > =20 > return 0; > } > -EXPORT_SYMBOL_GPL(qcom_ice_resume); > =20 > -int qcom_ice_suspend(struct qcom_ice *ice) > +static int qcom_ice_runtime_suspend(struct device *dev) > { > + struct qcom_ice *ice =3D dev_get_drvdata(dev); > + > ice->hwkm_init_complete =3D false; > qcom_ice_disable_clocks(ice); > =20 > return 0; > } > -EXPORT_SYMBOL_GPL(qcom_ice_suspend); [Severity: Medium] Can a consumer probe failure or deferral leak the ICE supplier's runtime PM usage_count and prevent qcom_ice_runtime_suspend() from running? of_qcom_ice_get() adds the device link with DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE | DL_FLAG_AUTOREMOVE_SUPPLIER. In ufshcd_pltfrm_init(), ufshcd_init() acquires ICE before pm_runtime_set_active(dev) runs, so dev->power.runtime_status is still RPM_SUSPENDED if ufshcd_init() fails or returns -EPROBE_DEFER. On probe unwind, __device_links_no_driver() only drops links marked DL_FLAG_AUTOREMOVE_CONSUMER, and pm_runtime_reinit() skips pm_runtime_set_suspended() because runtime_status is not RPM_ACTIVE. The supplier's usage_count stays elevated and ICE clocks remain on indefinitely; using DL_FLAG_AUTOREMOVE_CONSUMER would drop the link on consumer probe failure. [Severity: Medium] Does qcom_ice_remove() leak enabled ICE clocks if the driver is unbound while runtime-active? If ice->dev still has power.usage_count > 0 when __device_release_driver() calls pm_runtime_put_sync() (for instance if userspace set power/control to "on" or after a failed consumer probe leaked the device link), qcom_ice_runtime_suspend() is not called. qcom_ice_remove() only clears the ice_handles xarray entry, and device_unbind_cleanup() then runs devm_pm_runtime_enable()'s cleanup (which disables runtime PM without suspending) followed by devm_clk_release(), calling clk_put() while core_clk and iface_clk are still prepared and enabled. > diff --git a/include/soc/qcom/ice.h b/include/soc/qcom/ice.h > index 4bee553f0a59d..b17f2df0b75cf 100644 > --- a/include/soc/qcom/ice.h > +++ b/include/soc/qcom/ice.h > @@ -12,8 +12,6 @@ > struct qcom_ice; > =20 > int qcom_ice_enable(struct qcom_ice *ice); > -int qcom_ice_resume(struct qcom_ice *ice); > -int qcom_ice_suspend(struct qcom_ice *ice); > int qcom_ice_program_key(struct qcom_ice *ice, unsigned int slot, > const struct blk_crypto_key *blk_key); > int qcom_ice_evict_key(struct qcom_ice *ice, int slot); [Severity: High] Without qcom_ice_resume() and qcom_ice_suspend(), how do legacy devicetree consumers re-initialize ICE across suspend and resume? Legacy bindings (used by storage nodes in dtsi files such as sdm845.dtsi and sdm670.dtsi) do not have a standalone qcom-ice supplier device or runtime PM device link. With these APIs gone, qcom_ice_runtime_suspend() and qcom_ice_runtime_resume() never execute for them, so ice->hwkm_init_complete is never cleared on suspend and qcom_ice_hwkm_init() and qcom_ice_wait_bist_status() are never re-run after power collapse or Hibern8, breaking inline encryption. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-qcom_ice_p= m_enable-v3-0-86f79ce468b5@oss.qualcomm.com?part=3D6