All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: mmci: Break IRQ status loop when all zero
@ 2022-04-16 22:45 Linus Walleij
  2022-04-21 13:54 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2022-04-16 22:45 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Linus Walleij

We iterate an extra time through the IRQ status handling
loop despite nothing had fired. Enabling the debug prints:

mmci-pl18x 80005000.mmc: op 01 arg 00000000 flags 000000e1
mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000001
mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000000
mmci-pl18x 80005000.mmc: op 01 arg 40ff8080 flags 000000e1
mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000001
mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000000

It is pointless to loop through the function when status
is zero. Just break the loop if the status is zero.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/host/mmci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 45b8608c935c..f3cf3152a397 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1619,6 +1619,8 @@ static irqreturn_t mmci_irq(int irq, void *dev_id)
 
 	do {
 		status = readl(host->base + MMCISTATUS);
+		if (!status)
+			break;
 
 		if (host->singleirq) {
 			if (status & host->mask1_reg)
-- 
2.35.1


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

* Re: [PATCH] mmc: mmci: Break IRQ status loop when all zero
  2022-04-16 22:45 [PATCH] mmc: mmci: Break IRQ status loop when all zero Linus Walleij
@ 2022-04-21 13:54 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2022-04-21 13:54 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-mmc

On Sun, 17 Apr 2022 at 00:47, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> We iterate an extra time through the IRQ status handling
> loop despite nothing had fired. Enabling the debug prints:
>
> mmci-pl18x 80005000.mmc: op 01 arg 00000000 flags 000000e1
> mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000001
> mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000000
> mmci-pl18x 80005000.mmc: op 01 arg 40ff8080 flags 000000e1
> mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000001
> mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000000
>
> It is pointless to loop through the function when status
> is zero. Just break the loop if the status is zero.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/mmci.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 45b8608c935c..f3cf3152a397 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1619,6 +1619,8 @@ static irqreturn_t mmci_irq(int irq, void *dev_id)
>
>         do {
>                 status = readl(host->base + MMCISTATUS);
> +               if (!status)
> +                       break;
>
>                 if (host->singleirq) {
>                         if (status & host->mask1_reg)
> --
> 2.35.1
>

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

end of thread, other threads:[~2022-04-21 13:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-16 22:45 [PATCH] mmc: mmci: Break IRQ status loop when all zero Linus Walleij
2022-04-21 13:54 ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.