[PATCH] ASoC: fsl_esai: Remove expensive print in irq handler

Subsystems: freescale soc sound drivers, sound, sound - soc layer / dynamic audio power management (asoc), the rest

STALE2325d

3 messages, 3 authors, 2020-04-21 · open the first message on its own page

[PATCH] ASoC: fsl_esai: Remove expensive print in irq handler

From: Shengjiu Wang <hidden>
Date: 2020-04-21 08:49:54

Use dev_dbg instead of dev_err in irq handler, the dev_err
is expensive, we don't need the message to be printed everytime,
which is almost a debug option.

Signed-off-by: Shengjiu Wang <redacted>
---
 sound/soc/fsl/fsl_esai.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index c7a49d03463a..453392a9cd68 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -94,10 +94,10 @@ static irqreturn_t esai_isr(int irq, void *devid)
 		dev_dbg(&pdev->dev, "isr: Transmission Initialized\n");
 
 	if (esr & ESAI_ESR_RFF_MASK)
-		dev_warn(&pdev->dev, "isr: Receiving overrun\n");
+		dev_dbg(&pdev->dev, "isr: Receiving overrun\n");
 
 	if (esr & ESAI_ESR_TFE_MASK)
-		dev_warn(&pdev->dev, "isr: Transmission underrun\n");
+		dev_dbg(&pdev->dev, "isr: Transmission underrun\n");
 
 	if (esr & ESAI_ESR_TLS_MASK)
 		dev_dbg(&pdev->dev, "isr: Just transmitted the last slot\n");
-- 
2.21.0

Re: [PATCH] ASoC: fsl_esai: Remove expensive print in irq handler

From: Mark Brown <broonie@kernel.org>
Date: 2020-04-21 09:51:47

On Tue, Apr 21, 2020 at 04:41:23PM +0800, Shengjiu Wang wrote:
Use dev_dbg instead of dev_err in irq handler, the dev_err
is expensive, we don't need the message to be printed everytime,
which is almost a debug option.
 	if (esr & ESAI_ESR_RFF_MASK)
-		dev_warn(&pdev->dev, "isr: Receiving overrun\n");
+		dev_dbg(&pdev->dev, "isr: Receiving overrun\n");
 
 	if (esr & ESAI_ESR_TFE_MASK)
-		dev_warn(&pdev->dev, "isr: Transmission underrun\n");
+		dev_dbg(&pdev->dev, "isr: Transmission underrun\n");
These are error messages which would suggest a problem that'd lead to
data corruption, it seems bad not to try to flag that to the user -
surely we've got bigger problems than performance if this happens?
Perhaps convert to a ratelimited print if the issue is that when errors
happen they happen a lot?

Re: [PATCH] ASoC: fsl_esai: Remove expensive print in irq handler

From: Shengjiu Wang <shengjiu.wang@gmail.com>
Date: 2020-04-21 10:51:54

Hi

On Tue, Apr 21, 2020 at 5:53 PM Mark Brown [off-list ref] wrote:
On Tue, Apr 21, 2020 at 04:41:23PM +0800, Shengjiu Wang wrote:
quoted
Use dev_dbg instead of dev_err in irq handler, the dev_err
is expensive, we don't need the message to be printed everytime,
which is almost a debug option.
quoted
      if (esr & ESAI_ESR_RFF_MASK)
-             dev_warn(&pdev->dev, "isr: Receiving overrun\n");
+             dev_dbg(&pdev->dev, "isr: Receiving overrun\n");

      if (esr & ESAI_ESR_TFE_MASK)
-             dev_warn(&pdev->dev, "isr: Transmission underrun\n");
+             dev_dbg(&pdev->dev, "isr: Transmission underrun\n");
These are error messages which would suggest a problem that'd lead to
data corruption, it seems bad not to try to flag that to the user -
surely we've got bigger problems than performance if this happens?
Perhaps convert to a ratelimited print if the issue is that when errors
happen they happen a lot?
Thanks for review, I will rethink about this.

best regards
wang shengjiu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help