diff mbox series

mmc: mmci: Break IRQ status loop when all zero

Message ID 20220416224549.627623-1-linus.walleij@linaro.org (mailing list archive)
State New, archived
Headers show
Series mmc: mmci: Break IRQ status loop when all zero | expand

Commit Message

Linus Walleij April 16, 2022, 10:45 p.m. UTC
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(+)

Comments

Ulf Hansson April 21, 2022, 1:54 p.m. UTC | #1
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
>
diff mbox series

Patch

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)