From nobody Thu Apr 2 07:43:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB3411F03EF; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770706618; cv=none; b=DOT8qEIxHl9ZO0v+P+iLhYx3oEza/VeGEfny5ZCifSsFax9wZ9JnXx5c9DfbTdqC/eP49huU8+JOTcAjyHSiRvtsnegp1ZD90b2rozfBBAzgBHtXBon/mZXO0nJb2fIHjtXUQqxZMNwYvTbMkIy9e9Ne55F7QHPMibYyZOcceqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770706618; c=relaxed/simple; bh=9k6PZUXz+WIcEyDU8GQDLchGRBb94F0Zkoj+zNNUO1w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F9ZDHc/4i4VKtCQcbet0hlTc/9Gw6yeusfW5dqOjYtVi+dMMLPbGEg3Bxnnxn4jRwdcNiPDgRk2cWdogRpYZt0uIA6Z9sEJXrCBRk8FmgbfkAAw7wj3zqF/vq0IpukH4yq/tgBOAA6T/E8PK2mdBK77RCi4WaFofeXednRklkHo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q8p9C0N4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q8p9C0N4" Received: by smtp.kernel.org (Postfix) with ESMTPS id 7AEDFC116C6; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770706618; bh=9k6PZUXz+WIcEyDU8GQDLchGRBb94F0Zkoj+zNNUO1w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Q8p9C0N4e3p3wXLXwIbeE5jCUAUkJfDbWcg192PD0qweCb8wkDSECUXyJ9+tmGE1I PRSSsyF6+jgsaxZDB2U3zvhqxhh8ozXFSUcesbEIm0dU3c0Iv9A0FbT+Uk+ByYAShQ Ukwq9ULcgesP8Q8hFfDueowkBioXPcOwt4gAjmsPmj2n5bkZhshcvwJgkrNGNrht2c +4Fj3YJcvOsw0I8bQv1ietkYzRv8WROk8sYiB5Oqqf3ENJePdKZd59v8J6ybQS1QQO +Z2dirjv3oKGMWxVKD+gn94kaFRF6sF4vPuSW4MntkJnQ+6NNxOYRN2aWkYPNOYo+q 1Zm/vKtJo8D7Q== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67C21EA3F0D; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 10 Feb 2026 12:26:50 +0530 Subject: [PATCH v2 1/4] soc: qcom: ice: Remove platform_driver support and expose as a pure library Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260210-qcom-ice-fix-v2-1-9c1ab5d6502c@oss.qualcomm.com> References: <20260210-qcom-ice-fix-v2-0-9c1ab5d6502c@oss.qualcomm.com> In-Reply-To: <20260210-qcom-ice-fix-v2-0-9c1ab5d6502c@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Abel Vesa , Adrian Hunter , Ulf Hansson , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org, Sumit Garg , mani@kernel.org, Manivannan Sadhasivam , stable@vger.kernel.org, Abel Vesa X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=8433; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=GPFUIIrwKER6IyezrGPLm3Ggoo7yyD5LRXIRLkVOue8=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpita4HLKQ2qFWK/ODxaFMc9Uuv/lk/7t/VT+Uc ciozcx8mkCJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaYrWuAAKCRBVnxHm/pHO 9ZKRB/9UzSOkSfrzOGjWmUpqiQKmJ0Nf4P2Fz1nvOBb/HIlvldfV6BKviQ96AWI1GrCOep/aHlK 7UoFF8aasoykQB1ToCqdM8vQa/iGXwBwj/xiFzSvOE9FflWfR2+2e5nqUMLFSjU1oFki6Okh7E/ 8tppcC5VETVwiXtoCWK6zxbOmgfXIC/YK8PxT0myYAEcwiAxdfc7+mSTxbDs9trCBJFnQbTpXyQ YnMYLeJ2W5wP6SBN+Wro6KqSGNqPk7AMYq3OEN5EiEsMTuevRsq5f08Ui2mbmVIzCTJVXm9FcJA XuO5jtGfMha5qxIKup9cT8hF8jB92LR1U6WExmGuI0APDOBX X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam The current platform driver design causes probe ordering races with consumers (UFS, eMMC) due to ICE's dependency on SCM firmware calls. If ICE probe fails (missing ICE SCM or DT registers), devm_of_qcom_ice_get() loops with -EPROBE_DEFER, leaving consumers non-functional even when ICE should be gracefully disabled. devm_of_qcom_ice_get() cannot know if the ICE driver probe has failed due to above reasons or it is waiting for the SCM driver. Moreover, there is no devlink dependency between ICE and consumer drivers as 'qcom,ice' is not considered as a DT 'supplier'. So the consumer drivers have no idea of when the ICE driver is going to probe. To avoid all this hassle, remove the platform driver support altogether and just expose the ICE driver as a pure library to consumer drivers. With this design, when devm_of_qcom_ice_get() is called, it will check if the ICE instance is available or not. If not, it will create one based on the ICE DT node, increase the refcount and return the handle. When the next consumer calls the API again, the ICE instance would be available. So this function will just increment the refcount and return the instance. Finally, when the consumer devices get destroyed, refcount will be decremented and finally the cleanup will happen once the last consumer goes away. For the consumers using the old DT binding of providing the separate 'ice' register range in their node, this change has no impact. This change also warrants rewording the kernel-doc of devm_of_qcom_ice_get() API. While at it, remove the duplicate kernel-doc for of_qcom_ice_get() static helper as it provides no value. Cc: stable@vger.kernel.org Cc: Abel Vesa Reported-by: Sumit Garg Fixes: 2afbf43a4aec ("soc: qcom: Make the Qualcomm UFS/SDCC ICE a dedicated= driver") Signed-off-by: Manivannan Sadhasivam --- drivers/soc/qcom/ice.c | 118 ++++++++++++++++++---------------------------= ---- 1 file changed, 44 insertions(+), 74 deletions(-) diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c index b203bc685cad..8e25609c7e7b 100644 --- a/drivers/soc/qcom/ice.c +++ b/drivers/soc/qcom/ice.c @@ -107,12 +107,16 @@ struct qcom_ice { struct device *dev; void __iomem *base; =20 + struct kref refcount; struct clk *core_clk; bool use_hwkm; bool hwkm_init_complete; u8 hwkm_version; }; =20 +static DEFINE_MUTEX(ice_mutex); +struct qcom_ice *ice_handle; + static bool qcom_ice_check_supported(struct qcom_ice *ice) { u32 regval =3D qcom_ice_readl(ice, QCOM_ICE_REG_VERSION); @@ -592,30 +596,18 @@ static struct qcom_ice *qcom_ice_create(struct device= *dev, return engine; } =20 -/** - * of_qcom_ice_get() - get an ICE instance from a DT node - * @dev: device pointer for the consumer device - * - * This function will provide an ICE instance either by creating one for t= he - * consumer device if its DT node provides the 'ice' reg range and the 'ic= e' - * clock (for legacy DT style). On the other hand, if consumer provides a - * phandle via 'qcom,ice' property to an ICE DT, the ICE instance will alr= eady - * be created and so this function will return that instead. - * - * Return: ICE pointer on success, NULL if there is no ICE data provided b= y the - * consumer or ERR_PTR() on error. - */ static struct qcom_ice *of_qcom_ice_get(struct device *dev) { struct platform_device *pdev =3D to_platform_device(dev); struct qcom_ice *ice; struct resource *res; void __iomem *base; - struct device_link *link; =20 if (!dev || !dev->of_node) return ERR_PTR(-ENODEV); =20 + guard(mutex)(&ice_mutex); + /* * In order to support legacy style devicetree bindings, we need * to create the ICE instance using the consumer device and the reg @@ -631,6 +623,16 @@ static struct qcom_ice *of_qcom_ice_get(struct device = *dev) return qcom_ice_create(&pdev->dev, base); } =20 + /* + * If the ICE node has been initialized already, just increase the + * refcount and return the handle. + */ + if (ice_handle) { + kref_get(&ice_handle->refcount); + + return ice_handle; + } + /* * If the consumer node does not provider an 'ice' reg range * (legacy DT binding), then it must at least provide a phandle @@ -643,41 +645,42 @@ static struct qcom_ice *of_qcom_ice_get(struct device= *dev) =20 pdev =3D of_find_device_by_node(node); if (!pdev) { - dev_err(dev, "Cannot find device node %s\n", node->name); + dev_err(dev, "Cannot find ICE platform device\n"); return ERR_PTR(-EPROBE_DEFER); } =20 - ice =3D platform_get_drvdata(pdev); - if (!ice) { - dev_err(dev, "Cannot get ice instance from %s\n", - dev_name(&pdev->dev)); + base =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) { + dev_warn(&pdev->dev, "ICE registers not found\n"); platform_device_put(pdev); - return ERR_PTR(-EPROBE_DEFER); + return base; } =20 - link =3D device_link_add(dev, &pdev->dev, DL_FLAG_AUTOREMOVE_SUPPLIER); - if (!link) { - dev_err(&pdev->dev, - "Failed to create device link to consumer %s\n", - dev_name(dev)); + ice =3D qcom_ice_create(&pdev->dev, base); + if (IS_ERR(ice)) { platform_device_put(pdev); - ice =3D ERR_PTR(-EINVAL); + return ice_handle; } =20 - return ice; + ice_handle =3D ice; + kref_init(&ice_handle->refcount); + + return ice_handle; } =20 -static void qcom_ice_put(const struct qcom_ice *ice) +static void qcom_ice_put(struct kref *kref) { - struct platform_device *pdev =3D to_platform_device(ice->dev); - - if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "ice")) - platform_device_put(pdev); + platform_device_put(to_platform_device(ice_handle->dev)); + ice_handle =3D NULL; } =20 static void devm_of_qcom_ice_put(struct device *dev, void *res) { - qcom_ice_put(*(struct qcom_ice **)res); + const struct qcom_ice *ice =3D *(struct qcom_ice **)res; + struct platform_device *pdev =3D to_platform_device(ice->dev); + + if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "ice")) + kref_put(&ice_handle->refcount, qcom_ice_put); } =20 /** @@ -685,11 +688,14 @@ static void devm_of_qcom_ice_put(struct device *dev, = void *res) * a DT node. * @dev: device pointer for the consumer device. * - * This function will provide an ICE instance either by creating one for t= he - * consumer device if its DT node provides the 'ice' reg range and the 'ic= e' - * clock (for legacy DT style). On the other hand, if consumer provides a - * phandle via 'qcom,ice' property to an ICE DT, the ICE instance will alr= eady - * be created and so this function will return that instead. + * This function will create the ICE instance (for the first time) and inc= rease + * its refcount if the consumer device has either 'ice' reg range (legacy = DT + * binding) or the 'qcom,ice' property pointing to the ICE DT node. If the= ICE + * instance was already created, it will just increase its refcount and re= turn + * the handle. + * + * Devres automatically decrements the refcount when consumer device gets + * destroyed and frees the ICE instance when the last consumer goes away. * * Return: ICE pointer on success, NULL if there is no ICE data provided b= y the * consumer or ERR_PTR() on error. @@ -714,41 +720,5 @@ struct qcom_ice *devm_of_qcom_ice_get(struct device *d= ev) } EXPORT_SYMBOL_GPL(devm_of_qcom_ice_get); =20 -static int qcom_ice_probe(struct platform_device *pdev) -{ - struct qcom_ice *engine; - void __iomem *base; - - base =3D devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(base)) { - dev_warn(&pdev->dev, "ICE registers not found\n"); - return PTR_ERR(base); - } - - engine =3D qcom_ice_create(&pdev->dev, base); - if (IS_ERR(engine)) - return PTR_ERR(engine); - - platform_set_drvdata(pdev, engine); - - return 0; -} - -static const struct of_device_id qcom_ice_of_match_table[] =3D { - { .compatible =3D "qcom,inline-crypto-engine" }, - { }, -}; -MODULE_DEVICE_TABLE(of, qcom_ice_of_match_table); - -static struct platform_driver qcom_ice_driver =3D { - .probe =3D qcom_ice_probe, - .driver =3D { - .name =3D "qcom-ice", - .of_match_table =3D qcom_ice_of_match_table, - }, -}; - -module_platform_driver(qcom_ice_driver); - MODULE_DESCRIPTION("Qualcomm Inline Crypto Engine driver"); MODULE_LICENSE("GPL"); --=20 2.51.0 From nobody Thu Apr 2 07:43:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF0512F3618; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770706618; cv=none; b=odDMlqJ+zvLEA723qh1ZZwTbhm16Yox3L4BHmuISYAC8AbTaeHZ3tskf9NoLHy0G5X1YWo7BmZCMZA6iiHnktxzDxyvB3+wTmzbTNrLnulUqeyojM0uhHYZJKk9r91V9OicOyBlz4hX12M7CiKi5bE5vKL+bQMxiMnYu7/kraOU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770706618; c=relaxed/simple; bh=U91t0kFHPzGEKPnhTW3rHjasrA7cECKpz8gy7FXoBwk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CdYo5v3ZQthFqL+xH5CN9caUvFfnva6/ri0iBYghtV8a4NCSbFrs6BgicdO9WE9kVQ6VafgLKNa35TdRtED84CK3MIye7fyX0G8y2VARG+PCUdUX7BWwSU6zgbqs2m5RGIWJ32LLtEZIrGOpa1pd6UlbOxoIyjOggOV2/N2Vh9A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cHZdIWYw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cHZdIWYw" Received: by smtp.kernel.org (Postfix) with ESMTPS id 97FA8C19424; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770706618; bh=U91t0kFHPzGEKPnhTW3rHjasrA7cECKpz8gy7FXoBwk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=cHZdIWYwy1dAubQBzr6Vl2WkcrlWeLkm6vf7RqTdhgUm0kqBmSVnXiEq14YiU0ANZ 4d9gcxGLN4566t0bOJdVNam/jL3R26GmhWNQ+SdLsfnwd97cvl217NJnoBSTTJXv+M Jchl/DJctdndILhwcJ28533OnBus1QlxHFySLFmc0HXl+gwumBNhAcMcAhOgCjimMO 0pgO/y3VjUJkXBAcPhyN1yBvt6FozUEWbEHICegGX5skt1UaAZlWd0td9Kc64KgzK1 eMtnSNU9euMMKP5xOP+Qzwjf66+LStNplBBjcx7C4XabgP8eamRyiNeH3J9DzusxXY IRN/eRAklNvNw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D4B4EA3F13; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 10 Feb 2026 12:26:51 +0530 Subject: [PATCH v2 2/4] soc: qcom: ice: Return proper error codes from devm_of_qcom_ice_get() instead of NULL Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260210-qcom-ice-fix-v2-2-9c1ab5d6502c@oss.qualcomm.com> References: <20260210-qcom-ice-fix-v2-0-9c1ab5d6502c@oss.qualcomm.com> In-Reply-To: <20260210-qcom-ice-fix-v2-0-9c1ab5d6502c@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Abel Vesa , Adrian Hunter , Ulf Hansson , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org, Sumit Garg , mani@kernel.org, Manivannan Sadhasivam X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1991; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=R3ti+Do4o2blOWOwxCpVWH7G3OaIyEGRpXFXfGBMGwo=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpita4hjQe5fQN8fLFldr783St9cfJQ2pKAom0u BxfbrQuiKyJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaYrWuAAKCRBVnxHm/pHO 9bSNB/9Ys1wwQndfMoM+YNJqTzJ0bBhbgtGkAXjt+CgID8ZLWfGL3duLhuG7Eif4zs1MN/B7fVP jxPKfkL/Z5gcKtKrgO3+gIpHMaAPavMGsUiLMlacyTvB7B1ZldnzAaZ6/4YlqaBRPt+zFcRk714 t2ciDbjvCblFyxZBTIhhFHOTj2zUusCymuP9UVgdCN7oOM/+sd9dmgg/kHl29pONtAiKANf/FuF BQXl6JAo1xnhvl4L/eKjZM8kkByA2qGJ7NEoW8TMq9suF16s5GJ64mwEJVgKg8wld3QN9DrAk6+ a5d34SRNXnxOHQiV6Kp92AUcILXELkiHWJaqqvq4HP18xsAX X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam devm_of_qcom_ice_get() currently returns NULL if ICE SCM is not available or "qcom,ice" property is not found in DT. But this confuses the clients since NULL doesn't convey the reason for failure. So return proper error codes instead of NULL. Reported-by: Sumit Garg Signed-off-by: Manivannan Sadhasivam Reviewed-by: Konrad Dybcio --- drivers/soc/qcom/ice.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c index 8e25609c7e7b..498cb0e0d1e4 100644 --- a/drivers/soc/qcom/ice.c +++ b/drivers/soc/qcom/ice.c @@ -563,7 +563,7 @@ static struct qcom_ice *qcom_ice_create(struct device *= dev, =20 if (!qcom_scm_ice_available()) { dev_warn(dev, "ICE SCM interface not found\n"); - return NULL; + return ERR_PTR(-EOPNOTSUPP); } =20 engine =3D devm_kzalloc(dev, sizeof(*engine), GFP_KERNEL); @@ -641,7 +641,7 @@ static struct qcom_ice *of_qcom_ice_get(struct device *= dev) struct device_node *node __free(device_node) =3D of_parse_phandle(dev->of= _node, "qcom,ice", 0); if (!node) - return NULL; + return ERR_PTR(-ENODEV); =20 pdev =3D of_find_device_by_node(node); if (!pdev) { @@ -697,8 +697,7 @@ static void devm_of_qcom_ice_put(struct device *dev, vo= id *res) * Devres automatically decrements the refcount when consumer device gets * destroyed and frees the ICE instance when the last consumer goes away. * - * Return: ICE pointer on success, NULL if there is no ICE data provided b= y the - * consumer or ERR_PTR() on error. + * Return: ICE pointer on success, ERR_PTR() on error. */ struct qcom_ice *devm_of_qcom_ice_get(struct device *dev) { @@ -709,7 +708,7 @@ struct qcom_ice *devm_of_qcom_ice_get(struct device *de= v) return ERR_PTR(-ENOMEM); =20 ice =3D of_qcom_ice_get(dev); - if (!IS_ERR_OR_NULL(ice)) { + if (!IS_ERR(ice)) { *dr =3D ice; devres_add(dev, dr); } else { --=20 2.51.0 From nobody Thu Apr 2 07:43:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1CAE32692D; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770706618; cv=none; b=VV4QXAeRYMlt2Yg6cl3uPOjW9HcAlr9DMg93/Qufk/iSQRsxdquwTrWTiCSi57z2LvEnBLfCD1tghMnJkg+j9FtQF2mtzN9EvceuADSuq/aPf+4hPWpO8l6kZvla/kiKz0s/3KYD77Ae4b8GzXQIFbgCPSEZfTw5k1YQKKi6ASE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770706618; c=relaxed/simple; bh=lh1qd96ymZJU5LO53UJtp+J/py70ywlqsW41wm3yqkU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uDbLDI5Np8VeJe/tayp1cS4YJNetc1gGotovDEYo/AIqvKbGrhEkrjwO21VOj1+HHbvmleSnrnql8IoO3ZbE1Zs9keD9EiOyWKEmdTR/78u7baJr3kyRlSV8rpHfnTIBfDrlHhyw1U7RrFwHNPeABVexl9oHR9lt9rSIC8+3fzA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YBvy++WK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YBvy++WK" Received: by smtp.kernel.org (Postfix) with ESMTPS id ABA93C2BC87; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770706618; bh=lh1qd96ymZJU5LO53UJtp+J/py70ywlqsW41wm3yqkU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YBvy++WKVloTrkXiDN/9KMtYIc/rOiR3sDJwLYsyyAMc1MYeajtWExhIphO1Jop1e TuhH3EvgnO/H3/s0C/9hH+YBpGzsUozAZcQFunVRPdNzF2v6NOFPXIDZL4HfdKLvFz eMYZxv5np1exqkQto7q6xxbJMBPLtxwhIi4dI/p4ezy755bRmAPG5h/yxJucvba7P/ 9s0iCY26T5sLLl0DaK7xTNXR4xECwtS7vYohUhZ70BujEUg19CvzKNzqvP5/SoApB7 opOEeLiyIBScgKCFG3j90yw4cxByQA+0APjKVMEDVEsHl5zjVnNCOxQLZrKR9raEe4 ls6HR4EKpMDmA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F5F8EA3F11; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 10 Feb 2026 12:26:52 +0530 Subject: [PATCH v2 3/4] mmc: sdhci-msm: Remove NULL check from devm_of_qcom_ice_get() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260210-qcom-ice-fix-v2-3-9c1ab5d6502c@oss.qualcomm.com> References: <20260210-qcom-ice-fix-v2-0-9c1ab5d6502c@oss.qualcomm.com> In-Reply-To: <20260210-qcom-ice-fix-v2-0-9c1ab5d6502c@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Abel Vesa , Adrian Hunter , Ulf Hansson , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org, Sumit Garg , mani@kernel.org, Manivannan Sadhasivam X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1116; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=RFJ6aiBL+C6phcTa/pja7cXNj5Ir3ve7IHMAT5QAUyo=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpita427DMd6zsyCIBZSsjTuQycO9zekmH/+DrW 8VN5F5v10CJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaYrWuAAKCRBVnxHm/pHO 9ZovCACIifNUXJ1AaJ5ODxc+RIq7EDZczAPEnS4OIlHkN9A2YTpab8UMmsh2hcJ+PwLUJTCVZ/t M+xqfmbQwnLDbpXT1fosJrSnKjeZnf3g0SRVAVdEMLq2DFVspQiU8buTpckUN5GEjukPW2JPqew fpuSSFnEmDifQJUSIXTK738VHuh7Eu/PzqiGMre4aOfPI7JGUp/rydbXTUe5GQl+uT/t8+Jjapi rJJ7NO5s4ugh5GTAaOsv/FRTMvxw8GcmzWVfRoJGcZkz89+jqpfHqSMKbMLMGcztXXxkZhcdOIa 6bbAPn7wh46plBz/laXuXp2m/07kf0cP/VqSal2oO/6OB0g9 X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam Now since the devm_of_qcom_ice_get() API never returns NULL, remove the NULL check and also simplify the error handling. Signed-off-by: Manivannan Sadhasivam Acked-by: Adrian Hunter Acked-by: Ulf Hansson Reviewed-by: Konrad Dybcio --- drivers/mmc/host/sdhci-msm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 3b85233131b3..8d862079cf17 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -1906,14 +1906,14 @@ static int sdhci_msm_ice_init(struct sdhci_msm_host= *msm_host, return 0; =20 ice =3D devm_of_qcom_ice_get(dev); - if (ice =3D=3D ERR_PTR(-EOPNOTSUPP)) { + if (IS_ERR(ice)) { + if (ice !=3D ERR_PTR(-EOPNOTSUPP)) + return PTR_ERR(ice); + dev_warn(dev, "Disabling inline encryption support\n"); - ice =3D NULL; + return 0; } =20 - if (IS_ERR_OR_NULL(ice)) - return PTR_ERR_OR_ZERO(ice); - if (qcom_ice_get_supported_key_type(ice) !=3D BLK_CRYPTO_KEY_TYPE_RAW) { dev_warn(dev, "Wrapped keys not supported. Disabling inline encryption s= upport.\n"); return 0; --=20 2.51.0 From nobody Thu Apr 2 07:43:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED4B732E750; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770706619; cv=none; b=tVEHBRGhzGyRuIUmhQnh1TDf7i/3AQv2n3dfrfWVFygj8exse2whj5qJiWqiYBnSHiq7ZV2eIQSl6nw33QFQ6vm3D342BUJLt29dAz98xf8utmzbQGQeXdYv53heGOXiefsHuAb2rpLWdQ3mLJBSkddJJTQFp2JILum5qoNhUCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770706619; c=relaxed/simple; bh=BqHZGQIeCQ45SHzcHrF0Fr/DAKVMrwgf/SUEWdoIFb0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=csyFe/Uom5cH49FAhH8FNWR57GbbGV+Mam0h79VSGsCrkkVT20GALPZ+/d3gu3WgVsQs/yyWq7MyRcbDBBNm8HouQNYEOq9Jt9O84Xh/ZG7JzqF/wkNx8XM7W7ojbD9jxMzRfK+AtI4InJa5fAEe46U251MJUHR8YGuxMsQwNVc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pi7wZMB4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pi7wZMB4" Received: by smtp.kernel.org (Postfix) with ESMTPS id C8ADCC4AF0D; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770706618; bh=BqHZGQIeCQ45SHzcHrF0Fr/DAKVMrwgf/SUEWdoIFb0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=pi7wZMB4OyDrcCpDoqfQdeZ6mbBCKxYR3hG/5x0+Vmr6DrP3p4ybynWxeVtj9IX9j +hyHd9AoVtBYa45lYUKHTX6SFdl4JLPEkWJzkEXNuNIEg227d3xHEBu1mnnGBvQEJ+ 8C+x02pGjckz7KjdhdAJasoLt1NfV5Xru5/iA9eUWIeu8N5LtF0JvzmuAxaf0lkyLp DIPdTu5o3QstdFHxQ7su/1CWdSZdG1AkgC9nnqkFK3Wv+gEZe5TJOgju28VB3H0geF PDuow52fo/WkqcGHhL7H1LrcRtlALC/cCUbWvjcSHSxUeU2Me1mimLlLhzx0X1fOZo Zq1QvqSmHHYjg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE6E9EA3F12; Tue, 10 Feb 2026 06:56:58 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Tue, 10 Feb 2026 12:26:53 +0530 Subject: [PATCH v2 4/4] scsi: ufs: ufs-qcom: Remove NULL check from devm_of_qcom_ice_get() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260210-qcom-ice-fix-v2-4-9c1ab5d6502c@oss.qualcomm.com> References: <20260210-qcom-ice-fix-v2-0-9c1ab5d6502c@oss.qualcomm.com> In-Reply-To: <20260210-qcom-ice-fix-v2-0-9c1ab5d6502c@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Abel Vesa , Adrian Hunter , Ulf Hansson , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org, Sumit Garg , mani@kernel.org, Manivannan Sadhasivam X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=988; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=FiX0U3Dm1c+1x6b4FdICdmWPYMgaPZ7RllOZdWKy2K8=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBpita42yOVZvNIs7XIN83MKt1HqaVNv0rUcGwMj 6V1ximH0EqJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaYrWuAAKCRBVnxHm/pHO 9fx+B/4gycPlxXLFgpHn+yVLSbelGWv8BKp29Oc7vTQvS5fmWt73d9YPbmyfTZdS8oyUixibIyB kEyYLxKTqDBjV3Xq7GHx0bCc5xIzKWwchVW3NvP9qB3AzNYy3QkEmTj/8YOmAh6OrhxFL4cw3wd I3Ag5/FxcdSd/ND04ug4B+P6dW97zvT+0DimBimsGGDX3QJvmwcW3xqEn2IJ6A7rkIpFgl5kXmH j63Rj5wJFbkYT1xlpiZBYWtJMhJS9aOhm5elMwC6f5YsPncwIGULfaioRb0R3Q5Lh66+NG7u+Wa MjQd/jeTErP7lOn9qp1F1Zr3knyHdvU8hZWWs+G1OjBi3juG X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam Now since the devm_of_qcom_ice_get() API never returns NULL, remove the NULL check and also simplify the error handling. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Konrad Dybcio --- drivers/ufs/host/ufs-qcom.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 8ebee0cc5313..6ab08565413b 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -176,14 +176,14 @@ static int ufs_qcom_ice_init(struct ufs_qcom_host *ho= st) int i; =20 ice =3D devm_of_qcom_ice_get(dev); - if (ice =3D=3D ERR_PTR(-EOPNOTSUPP)) { + if (IS_ERR(ice)) { + if (ice !=3D ERR_PTR(-EOPNOTSUPP)) + return PTR_ERR(ice); + dev_warn(dev, "Disabling inline encryption support\n"); - ice =3D NULL; + return 0; } =20 - if (IS_ERR_OR_NULL(ice)) - return PTR_ERR_OR_ZERO(ice); - host->ice =3D ice; =20 /* Initialize the blk_crypto_profile */ --=20 2.51.0