[PATCH] iommu: arm: Remove redundant dev_err()/dev_err_probe()

Pan Chuang posted 1 patch 1 week, 4 days ago
drivers/iommu/arm/arm-smmu/arm-smmu.c   | 9 ++-------
drivers/iommu/arm/arm-smmu/qcom_iommu.c | 4 +---
2 files changed, 3 insertions(+), 10 deletions(-)
[PATCH] iommu: arm: Remove redundant dev_err()/dev_err_probe()
Posted by Pan Chuang 1 week, 4 days ago
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq()
automatically log detailed error messages on failure. Remove
the now-redundant driver-specific dev_err() and dev_err_probe() calls.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
---
 drivers/iommu/arm/arm-smmu/arm-smmu.c   | 9 ++-------
 drivers/iommu/arm/arm-smmu/qcom_iommu.c | 4 +---
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
index 0bd21d206eb3..889a0966d36c 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
@@ -865,11 +865,8 @@ static int arm_smmu_init_domain_context(struct arm_smmu_domain *smmu_domain,
 		ret = devm_request_irq(smmu->dev, irq, context_fault, IRQF_SHARED,
 				       "arm-smmu-context-fault", smmu_domain);
 
-	if (ret < 0) {
-		dev_err(smmu->dev, "failed to request context IRQ %d (%u)\n",
-			cfg->irptndx, irq);
+	if (ret < 0)
 		cfg->irptndx = ARM_SMMU_INVALID_IRPTNDX;
-	}
 
 	mutex_unlock(&smmu_domain->init_mutex);
 
@@ -2219,9 +2216,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 		err = devm_request_irq(dev, irq, global_fault, IRQF_SHARED,
 				       "arm-smmu global fault", smmu);
 		if (err)
-			return dev_err_probe(dev, err,
-					"failed to request global IRQ %d (%u)\n",
-					i, irq);
+			return err;
 	}
 
 	platform_set_drvdata(pdev, smmu);
diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
index a1e8cf29f594..2b57262b076f 100644
--- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
+++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
@@ -712,10 +712,8 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev)
 			       IRQF_SHARED,
 			       "qcom-iommu-fault",
 			       ctx);
-	if (ret) {
-		dev_err(dev, "failed to request IRQ %u\n", irq);
+	if (ret)
 		return ret;
-	}
 
 	ret = get_asid(dev->of_node);
 	if (ret < 0) {
-- 
2.34.1
Re: [PATCH] iommu: arm: Remove redundant dev_err()/dev_err_probe()
Posted by Will Deacon 2 days, 21 hours ago
On Tue, 14 Jul 2026 21:32:43 +0800, Pan Chuang wrote:
> Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
> devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq()
> automatically log detailed error messages on failure. Remove
> the now-redundant driver-specific dev_err() and dev_err_probe() calls.
> 
> 

Applied to iommu (arm/smmu/updates), thanks!

[1/1] iommu: arm: Remove redundant dev_err()/dev_err_probe()
      https://git.kernel.org/iommu/c/13a86292681d

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
Re: [PATCH] iommu: arm: Remove redundant dev_err()/dev_err_probe()
Posted by Robin Murphy 1 week, 2 days ago
On 14/07/2026 2:32 pm, Pan Chuang wrote:
> Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
> devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq()
> automatically log detailed error messages on failure. Remove
> the now-redundant driver-specific dev_err() and dev_err_probe() calls.

FWIW, the arm-smmu messages do provide contextual information about 
precisely *which* IRQ in SMMU terms was at fault, which generic code 
cannot do - the context/global index gives the developer enough to go 
and directly check the relevant DT/ACPI entry, without first having to 
figure out what hardware resource the Linux vIRQ number represents. 
However I do concur that the generic code is now more than enough for 
the general "something is terribly wrong" case, and beyond that we 
really don't need to optimise Linux for people writing bad firmware...

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> Signed-off-by: Pan Chuang <panchuang@vivo.com>
> ---
>   drivers/iommu/arm/arm-smmu/arm-smmu.c   | 9 ++-------
>   drivers/iommu/arm/arm-smmu/qcom_iommu.c | 4 +---
>   2 files changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> index 0bd21d206eb3..889a0966d36c 100644
> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> @@ -865,11 +865,8 @@ static int arm_smmu_init_domain_context(struct arm_smmu_domain *smmu_domain,
>   		ret = devm_request_irq(smmu->dev, irq, context_fault, IRQF_SHARED,
>   				       "arm-smmu-context-fault", smmu_domain);
>   
> -	if (ret < 0) {
> -		dev_err(smmu->dev, "failed to request context IRQ %d (%u)\n",
> -			cfg->irptndx, irq);
> +	if (ret < 0)
>   		cfg->irptndx = ARM_SMMU_INVALID_IRPTNDX;
> -	}
>   
>   	mutex_unlock(&smmu_domain->init_mutex);
>   
> @@ -2219,9 +2216,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
>   		err = devm_request_irq(dev, irq, global_fault, IRQF_SHARED,
>   				       "arm-smmu global fault", smmu);
>   		if (err)
> -			return dev_err_probe(dev, err,
> -					"failed to request global IRQ %d (%u)\n",
> -					i, irq);
> +			return err;
>   	}
>   
>   	platform_set_drvdata(pdev, smmu);
> diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> index a1e8cf29f594..2b57262b076f 100644
> --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> @@ -712,10 +712,8 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev)
>   			       IRQF_SHARED,
>   			       "qcom-iommu-fault",
>   			       ctx);
> -	if (ret) {
> -		dev_err(dev, "failed to request IRQ %u\n", irq);
> +	if (ret)
>   		return ret;
> -	}
>   
>   	ret = get_asid(dev->of_node);
>   	if (ret < 0) {