linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu: rockchip: Drop verbose prints in the interrupt handler
@ 2018-08-30 22:28 Ezequiel Garcia
  2018-09-10 14:14 ` Heiko Stuebner
  2018-09-25 11:29 ` Joerg Roedel
  0 siblings, 2 replies; 5+ messages in thread
From: Ezequiel Garcia @ 2018-08-30 22:28 UTC (permalink / raw)
  To: linux-arm-kernel

Printing verbosely via WARN macros and friends in interrupt handlers
is strongly discouraged. Drop them and use proper ratelimited
prints.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/iommu/rockchip-iommu.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index 054cd2c8e9c8..21bb9a30bc64 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -523,11 +523,13 @@ static irqreturn_t rk_iommu_irq(int irq, void *dev_id)
 	irqreturn_t ret = IRQ_NONE;
 	int i;
 
-	if (WARN_ON(!pm_runtime_get_if_in_use(iommu->dev)))
-		return 0;
+	if (!pm_runtime_get_if_in_use(iommu->dev))
+		return ret;
 
-	if (WARN_ON(clk_bulk_enable(iommu->num_clocks, iommu->clocks)))
+	if (clk_bulk_enable(iommu->num_clocks, iommu->clocks)) {
+		dev_err_ratelimited(iommu->dev, "couldn't enable clocks\n");
 		goto out;
+	}
 
 	for (i = 0; i < iommu->num_mmu; i++) {
 		int_status = rk_iommu_read(iommu->bases[i], RK_MMU_INT_STATUS);
@@ -544,7 +546,7 @@ static irqreturn_t rk_iommu_irq(int irq, void *dev_id)
 			flags = (status & RK_MMU_STATUS_PAGE_FAULT_IS_WRITE) ?
 					IOMMU_FAULT_WRITE : IOMMU_FAULT_READ;
 
-			dev_err(iommu->dev, "Page fault at %pad of type %s\n",
+			dev_err_ratelimited(iommu->dev, "Page fault at %pad of type %s\n",
 				&iova,
 				(flags == IOMMU_FAULT_WRITE) ? "write" : "read");
 
-- 
2.18.0

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

* [PATCH] iommu: rockchip: Drop verbose prints in the interrupt handler
  2018-08-30 22:28 [PATCH] iommu: rockchip: Drop verbose prints in the interrupt handler Ezequiel Garcia
@ 2018-09-10 14:14 ` Heiko Stuebner
  2018-09-25 11:29 ` Joerg Roedel
  1 sibling, 0 replies; 5+ messages in thread
From: Heiko Stuebner @ 2018-09-10 14:14 UTC (permalink / raw)
  To: linux-arm-kernel

Am Freitag, 31. August 2018, 00:28:32 CEST schrieb Ezequiel Garcia:
> Printing verbosely via WARN macros and friends in interrupt handlers
> is strongly discouraged. Drop them and use proper ratelimited
> prints.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

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

* [PATCH] iommu: rockchip: Drop verbose prints in the interrupt handler
  2018-08-30 22:28 [PATCH] iommu: rockchip: Drop verbose prints in the interrupt handler Ezequiel Garcia
  2018-09-10 14:14 ` Heiko Stuebner
@ 2018-09-25 11:29 ` Joerg Roedel
  2018-09-26 17:31   ` Ezequiel Garcia
  1 sibling, 1 reply; 5+ messages in thread
From: Joerg Roedel @ 2018-09-25 11:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 30, 2018 at 07:28:32PM -0300, Ezequiel Garcia wrote:
> Printing verbosely via WARN macros and friends in interrupt handlers
> is strongly discouraged. Drop them and use proper ratelimited
> prints.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
> ---
>  drivers/iommu/rockchip-iommu.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

This doesn't apply cleanly to v4.19-rc5, can you please base the patch
on that tag, add the Reviewed-by and re-send?

Thanks,

	Joerg

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

* [PATCH] iommu: rockchip: Drop verbose prints in the interrupt handler
  2018-09-25 11:29 ` Joerg Roedel
@ 2018-09-26 17:31   ` Ezequiel Garcia
  2018-09-27  8:10     ` Marc Zyngier
  0 siblings, 1 reply; 5+ messages in thread
From: Ezequiel Garcia @ 2018-09-26 17:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2018-09-25 at 13:29 +0200, Joerg Roedel wrote:
> On Thu, Aug 30, 2018 at 07:28:32PM -0300, Ezequiel Garcia wrote:
> > Printing verbosely via WARN macros and friends in interrupt handlers
> > is strongly discouraged. Drop them and use proper ratelimited
> > prints.
> > 
> > Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
> > ---
> >  drivers/iommu/rockchip-iommu.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> This doesn't apply cleanly to v4.19-rc5, can you please base the patch
> on that tag, add the Reviewed-by and re-send?
> 

Well, after looking at the latest code, now I'm wondering why Marc
changed the WARN_ON with a WARN_ON_ONCE, instead of a less verbose
ratelimited print.

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

* [PATCH] iommu: rockchip: Drop verbose prints in the interrupt handler
  2018-09-26 17:31   ` Ezequiel Garcia
@ 2018-09-27  8:10     ` Marc Zyngier
  0 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2018-09-27  8:10 UTC (permalink / raw)
  To: linux-arm-kernel

On 26/09/18 18:31, Ezequiel Garcia wrote:
> On Tue, 2018-09-25 at 13:29 +0200, Joerg Roedel wrote:
>> On Thu, Aug 30, 2018 at 07:28:32PM -0300, Ezequiel Garcia wrote:
>>> Printing verbosely via WARN macros and friends in interrupt handlers
>>> is strongly discouraged. Drop them and use proper ratelimited
>>> prints.
>>>
>>> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
>>> ---
>>>   drivers/iommu/rockchip-iommu.c | 10 ++++++----
>>>   1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> This doesn't apply cleanly to v4.19-rc5, can you please base the patch
>> on that tag, add the Reviewed-by and re-send?
>>
> 
> Well, after looking at the latest code, now I'm wondering why Marc
> changed the WARN_ON with a WARN_ON_ONCE, instead of a less verbose
> ratelimited print.

WARN_ONCE does it exactly once. A rate-limited printk will still spit as 
many messages as you want.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

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

end of thread, other threads:[~2018-09-27  8:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-30 22:28 [PATCH] iommu: rockchip: Drop verbose prints in the interrupt handler Ezequiel Garcia
2018-09-10 14:14 ` Heiko Stuebner
2018-09-25 11:29 ` Joerg Roedel
2018-09-26 17:31   ` Ezequiel Garcia
2018-09-27  8:10     ` Marc Zyngier

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).