iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing
@ 2019-11-11 11:17 Jean-Philippe Brucker
  2019-11-11 11:17 ` [PATCH 2/2] iommu/arm-smmu: Remove duplicate error message Jean-Philippe Brucker
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jean-Philippe Brucker @ 2019-11-11 11:17 UTC (permalink / raw)
  To: linux-arm-kernel, iommu; +Cc: robin.murphy, will

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message
to platform_get_irq*()"), platform_get_irq_byname() displays an error
when the IRQ isn't found. Since the SMMUv3 driver uses that function to
query which interrupt method is available, the message is now displayed
during boot for any SMMUv3 that doesn't implement the combined
interrupt, or that implements MSIs.

[   20.700337] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ combined not found
[   20.706508] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ eventq not found
[   20.712503] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ priq not found
[   20.718325] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ gerror not found

Use platform_get_irq_byname_optional() to avoid displaying a spurious
error.

Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()")
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
 drivers/iommu/arm-smmu-v3.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index bfa4a0f39ed0..a89797f346a4 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -5207,19 +5207,19 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 
 	/* Interrupt lines */
 
-	irq = platform_get_irq_byname(pdev, "combined");
+	irq = platform_get_irq_byname_optional(pdev, "combined");
 	if (irq > 0)
 		smmu->combined_irq = irq;
 	else {
-		irq = platform_get_irq_byname(pdev, "eventq");
+		irq = platform_get_irq_byname_optional(pdev, "eventq");
 		if (irq > 0)
 			smmu->evtq.q.irq = irq;
 
-		irq = platform_get_irq_byname(pdev, "priq");
+		irq = platform_get_irq_byname_optional(pdev, "priq");
 		if (irq > 0)
 			smmu->priq.q.irq = irq;
 
-		irq = platform_get_irq_byname(pdev, "gerror");
+		irq = platform_get_irq_byname_optional(pdev, "gerror");
 		if (irq > 0)
 			smmu->gerr_irq = irq;
 	}
-- 
2.23.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] iommu/arm-smmu: Remove duplicate error message
  2019-11-11 11:17 [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing Jean-Philippe Brucker
@ 2019-11-11 11:17 ` Jean-Philippe Brucker
  2019-11-11 14:37   ` Will Deacon
  2019-11-11 14:43   ` Robin Murphy
  2019-11-11 11:52 ` [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing John Garry
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: Jean-Philippe Brucker @ 2019-11-11 11:17 UTC (permalink / raw)
  To: linux-arm-kernel, iommu; +Cc: robin.murphy, will

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message
to platform_get_irq*()"), platform_get_irq() displays an error when the
IRQ isn't found. Remove the error print from the SMMU driver. Note the
slight change of behaviour: no message is printed if platform_get_irq()
returns -EPROBE_DEFER, which probably doesn't concern the SMMU.

Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()")
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
 drivers/iommu/arm-smmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 7c503a6bc585..6f676686752c 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -2062,10 +2062,8 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 	for (i = 0; i < num_irqs; ++i) {
 		int irq = platform_get_irq(pdev, i);
 
-		if (irq < 0) {
-			dev_err(dev, "failed to get irq index %d\n", i);
+		if (irq < 0)
 			return -ENODEV;
-		}
 		smmu->irqs[i] = irq;
 	}
 
-- 
2.23.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing
  2019-11-11 11:17 [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing Jean-Philippe Brucker
  2019-11-11 11:17 ` [PATCH 2/2] iommu/arm-smmu: Remove duplicate error message Jean-Philippe Brucker
@ 2019-11-11 11:52 ` John Garry
  2019-11-11 14:23   ` Jean-Philippe Brucker
  2019-11-11 14:36 ` Will Deacon
  2019-11-11 14:44 ` Joerg Roedel
  3 siblings, 1 reply; 8+ messages in thread
From: John Garry @ 2019-11-11 11:52 UTC (permalink / raw)
  To: Jean-Philippe Brucker, linux-arm-kernel, iommu; +Cc: will, robin.murphy

On 11/11/2019 11:17, Jean-Philippe Brucker wrote:
> Since commit 7723f4c5ecdb ("driver core: platform: Add an error message
> to platform_get_irq*()"), platform_get_irq_byname() displays an error
> when the IRQ isn't found. Since the SMMUv3 driver uses that function to
> query which interrupt method is available, the message is now displayed
> during boot for any SMMUv3 that doesn't implement the combined
> interrupt, or that implements MSIs.
> 
> [   20.700337] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ combined not found
> [   20.706508] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ eventq not found
> [   20.712503] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ priq not found
> [   20.718325] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ gerror not found
> 
> Use platform_get_irq_byname_optional() to avoid displaying a spurious
> error.
> 
> Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()")
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>

That stops a nuisance:
Tested-by: John Garry <john.garry@huawei.com>

However, I will say though that the combined irq seems necessary for 
TX2, which is not warned about being missing now.

Finally, A cover letter would have been handy to mention that the new 
API was only introduced after rc1

thanks

> ---
>   drivers/iommu/arm-smmu-v3.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index bfa4a0f39ed0..a89797f346a4 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -5207,19 +5207,19 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
>   
>   	/* Interrupt lines */
>   
> -	irq = platform_get_irq_byname(pdev, "combined");
> +	irq = platform_get_irq_byname_optional(pdev, "combined");
>   	if (irq > 0)
>   		smmu->combined_irq = irq;
>   	else {
> -		irq = platform_get_irq_byname(pdev, "eventq");
> +		irq = platform_get_irq_byname_optional(pdev, "eventq");
>   		if (irq > 0)
>   			smmu->evtq.q.irq = irq;
>   
> -		irq = platform_get_irq_byname(pdev, "priq");
> +		irq = platform_get_irq_byname_optional(pdev, "priq");
>   		if (irq > 0)
>   			smmu->priq.q.irq = irq;
>   
> -		irq = platform_get_irq_byname(pdev, "gerror");
> +		irq = platform_get_irq_byname_optional(pdev, "gerror");
>   		if (irq > 0)
>   			smmu->gerr_irq = irq;
>   	}
> 

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing
  2019-11-11 11:52 ` [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing John Garry
@ 2019-11-11 14:23   ` Jean-Philippe Brucker
  0 siblings, 0 replies; 8+ messages in thread
From: Jean-Philippe Brucker @ 2019-11-11 14:23 UTC (permalink / raw)
  To: John Garry; +Cc: will, iommu, robin.murphy, linux-arm-kernel

Hi John,

On Mon, Nov 11, 2019 at 11:52:38AM +0000, John Garry wrote:
> On 11/11/2019 11:17, Jean-Philippe Brucker wrote:
> > Since commit 7723f4c5ecdb ("driver core: platform: Add an error message
> > to platform_get_irq*()"), platform_get_irq_byname() displays an error
> > when the IRQ isn't found. Since the SMMUv3 driver uses that function to
> > query which interrupt method is available, the message is now displayed
> > during boot for any SMMUv3 that doesn't implement the combined
> > interrupt, or that implements MSIs.
> > 
> > [   20.700337] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ combined not found
> > [   20.706508] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ eventq not found
> > [   20.712503] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ priq not found
> > [   20.718325] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ gerror not found
> > 
> > Use platform_get_irq_byname_optional() to avoid displaying a spurious
> > error.
> > 
> > Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()")
> > Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> 
> That stops a nuisance:
> Tested-by: John Garry <john.garry@huawei.com>

Thanks

> However, I will say though that the combined irq seems necessary for TX2,
> which is not warned about being missing now.

I don't think we warned about this before commit 7723f4c5ecdb either.
There are some warnings later in arm_smmu_setup_irqs() if the firmware
didn't describe any wiring at all, but we don't check whether the TX2 does
have the combined interrupt. Personally I wouldn't tie this to one SMMU
implementation because it would prevent from supporting a (hypothetical)
platform that integrates the same SMMU but "fixes" the IRQ lines.

> Finally, A cover letter would have been handy to mention that the new API
> was only introduced after rc1

Oh, I didn't even notice that, I thought it was introduced by rc1. I'll
add a cover if I send a v2.

Thanks,
Jean
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing
  2019-11-11 11:17 [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing Jean-Philippe Brucker
  2019-11-11 11:17 ` [PATCH 2/2] iommu/arm-smmu: Remove duplicate error message Jean-Philippe Brucker
  2019-11-11 11:52 ` [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing John Garry
@ 2019-11-11 14:36 ` Will Deacon
  2019-11-11 14:44 ` Joerg Roedel
  3 siblings, 0 replies; 8+ messages in thread
From: Will Deacon @ 2019-11-11 14:36 UTC (permalink / raw)
  To: Jean-Philippe Brucker; +Cc: iommu, robin.murphy, linux-arm-kernel

On Mon, Nov 11, 2019 at 12:17:20PM +0100, Jean-Philippe Brucker wrote:
> Since commit 7723f4c5ecdb ("driver core: platform: Add an error message
> to platform_get_irq*()"), platform_get_irq_byname() displays an error
> when the IRQ isn't found. Since the SMMUv3 driver uses that function to
> query which interrupt method is available, the message is now displayed
> during boot for any SMMUv3 that doesn't implement the combined
> interrupt, or that implements MSIs.
> 
> [   20.700337] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ combined not found
> [   20.706508] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ eventq not found
> [   20.712503] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ priq not found
> [   20.718325] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ gerror not found
> 
> Use platform_get_irq_byname_optional() to avoid displaying a spurious
> error.
> 
> Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()")
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> ---
>  drivers/iommu/arm-smmu-v3.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index bfa4a0f39ed0..a89797f346a4 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -5207,19 +5207,19 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
>  
>  	/* Interrupt lines */
>  
> -	irq = platform_get_irq_byname(pdev, "combined");
> +	irq = platform_get_irq_byname_optional(pdev, "combined");
>  	if (irq > 0)
>  		smmu->combined_irq = irq;
>  	else {
> -		irq = platform_get_irq_byname(pdev, "eventq");
> +		irq = platform_get_irq_byname_optional(pdev, "eventq");
>  		if (irq > 0)
>  			smmu->evtq.q.irq = irq;
>  
> -		irq = platform_get_irq_byname(pdev, "priq");
> +		irq = platform_get_irq_byname_optional(pdev, "priq");
>  		if (irq > 0)
>  			smmu->priq.q.irq = irq;
>  
> -		irq = platform_get_irq_byname(pdev, "gerror");
> +		irq = platform_get_irq_byname_optional(pdev, "gerror");
>  		if (irq > 0)
>  			smmu->gerr_irq = irq;
>  	}

Thanks, looks mechanical enough for me:

Acked-by: Will Deacon <will@kernel.org>

Will
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] iommu/arm-smmu: Remove duplicate error message
  2019-11-11 11:17 ` [PATCH 2/2] iommu/arm-smmu: Remove duplicate error message Jean-Philippe Brucker
@ 2019-11-11 14:37   ` Will Deacon
  2019-11-11 14:43   ` Robin Murphy
  1 sibling, 0 replies; 8+ messages in thread
From: Will Deacon @ 2019-11-11 14:37 UTC (permalink / raw)
  To: Jean-Philippe Brucker; +Cc: iommu, robin.murphy, linux-arm-kernel

On Mon, Nov 11, 2019 at 12:17:21PM +0100, Jean-Philippe Brucker wrote:
> Since commit 7723f4c5ecdb ("driver core: platform: Add an error message
> to platform_get_irq*()"), platform_get_irq() displays an error when the
> IRQ isn't found. Remove the error print from the SMMU driver. Note the
> slight change of behaviour: no message is printed if platform_get_irq()
> returns -EPROBE_DEFER, which probably doesn't concern the SMMU.
> 
> Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()")
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> ---
>  drivers/iommu/arm-smmu.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 7c503a6bc585..6f676686752c 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -2062,10 +2062,8 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
>  	for (i = 0; i < num_irqs; ++i) {
>  		int irq = platform_get_irq(pdev, i);
>  
> -		if (irq < 0) {
> -			dev_err(dev, "failed to get irq index %d\n", i);
> +		if (irq < 0)
>  			return -ENODEV;
> -		}
>  		smmu->irqs[i] = irq;
>  	}

Acked-by: Will Deacon <will@kernel.org>

Thanks,

Will
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] iommu/arm-smmu: Remove duplicate error message
  2019-11-11 11:17 ` [PATCH 2/2] iommu/arm-smmu: Remove duplicate error message Jean-Philippe Brucker
  2019-11-11 14:37   ` Will Deacon
@ 2019-11-11 14:43   ` Robin Murphy
  1 sibling, 0 replies; 8+ messages in thread
From: Robin Murphy @ 2019-11-11 14:43 UTC (permalink / raw)
  To: Jean-Philippe Brucker, linux-arm-kernel, iommu; +Cc: will

On 11/11/2019 11:17, Jean-Philippe Brucker wrote:
> Since commit 7723f4c5ecdb ("driver core: platform: Add an error message
> to platform_get_irq*()"), platform_get_irq() displays an error when the
> IRQ isn't found. Remove the error print from the SMMU driver. Note the
> slight change of behaviour: no message is printed if platform_get_irq()
> returns -EPROBE_DEFER, which probably doesn't concern the SMMU.
> 
> Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()")
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> ---
>   drivers/iommu/arm-smmu.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 7c503a6bc585..6f676686752c 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -2062,10 +2062,8 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
>   	for (i = 0; i < num_irqs; ++i) {
>   		int irq = platform_get_irq(pdev, i);
>   
> -		if (irq < 0) {
> -			dev_err(dev, "failed to get irq index %d\n", i);
> +		if (irq < 0)
>   			return -ENODEV;

It's a preexisting issue, but we should really "return irq" here.

Robin.

> -		}
>   		smmu->irqs[i] = irq;
>   	}
>   
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing
  2019-11-11 11:17 [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing Jean-Philippe Brucker
                   ` (2 preceding siblings ...)
  2019-11-11 14:36 ` Will Deacon
@ 2019-11-11 14:44 ` Joerg Roedel
  3 siblings, 0 replies; 8+ messages in thread
From: Joerg Roedel @ 2019-11-11 14:44 UTC (permalink / raw)
  To: Jean-Philippe Brucker; +Cc: robin.murphy, iommu, will, linux-arm-kernel

On Mon, Nov 11, 2019 at 12:17:20PM +0100, Jean-Philippe Brucker wrote:
> Since commit 7723f4c5ecdb ("driver core: platform: Add an error message
> to platform_get_irq*()"), platform_get_irq_byname() displays an error
> when the IRQ isn't found. Since the SMMUv3 driver uses that function to
> query which interrupt method is available, the message is now displayed
> during boot for any SMMUv3 that doesn't implement the combined
> interrupt, or that implements MSIs.
> 
> [   20.700337] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ combined not found
> [   20.706508] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ eventq not found
> [   20.712503] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ priq not found
> [   20.718325] arm-smmu-v3 arm-smmu-v3.7.auto: IRQ gerror not found
> 
> Use platform_get_irq_byname_optional() to avoid displaying a spurious
> error.
> 
> Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()")
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> ---
>  drivers/iommu/arm-smmu-v3.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied both, thanks.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-11-11 14:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 11:17 [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing Jean-Philippe Brucker
2019-11-11 11:17 ` [PATCH 2/2] iommu/arm-smmu: Remove duplicate error message Jean-Philippe Brucker
2019-11-11 14:37   ` Will Deacon
2019-11-11 14:43   ` Robin Murphy
2019-11-11 11:52 ` [PATCH 1/2] iommu/arm-smmu-v3: Don't display an error when IRQ lines are missing John Garry
2019-11-11 14:23   ` Jean-Philippe Brucker
2019-11-11 14:36 ` Will Deacon
2019-11-11 14:44 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).