linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Matsievskiy <matsievskiysv@gmail.com>
To: linus.walleij@linaro.org
Cc: alexandre.belloni@bootlin.com, quentin.schulz@bootlin.com,
	lars.povlsen@microchip.com, horatiu.vultur@microchip.com,
	andriy.shevchenko@linux.intel.com, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org,
	UNGLinuxDriver@microchip.com,
	Sergey Matsievskiy <matsievskiysv@gmail.com>
Subject: [PATCH 1/1] pinctrl: ocelot: fix system hang on level based interrupts
Date: Sun,  6 Oct 2024 21:13:10 +0300	[thread overview]
Message-ID: <20241006181310.181309-2-matsievskiysv@gmail.com> (raw)
In-Reply-To: <20241006181310.181309-1-matsievskiysv@gmail.com>

Fix interrupt handle loops, produced by spurious and short level based
interrupts by unconditionally clearing the parent interrupt, even when
no GPIO interrupts are pending.

Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com>
---
 drivers/pinctrl/pinctrl-ocelot.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
index be9b8c010167..d1ab8450ea93 100644
--- a/drivers/pinctrl/pinctrl-ocelot.c
+++ b/drivers/pinctrl/pinctrl-ocelot.c
@@ -1955,21 +1955,21 @@ static void ocelot_irq_handler(struct irq_desc *desc)
 	unsigned int reg = 0, irq, i;
 	unsigned long irqs;
 
+	chained_irq_enter(parent_chip, desc);
+
 	for (i = 0; i < info->stride; i++) {
 		regmap_read(info->map, id_reg + 4 * i, &reg);
 		if (!reg)
 			continue;
 
-		chained_irq_enter(parent_chip, desc);
-
 		irqs = reg;
 
 		for_each_set_bit(irq, &irqs,
 				 min(32U, info->desc->npins - 32 * i))
 			generic_handle_domain_irq(chip->irq.domain, irq + 32 * i);
-
-		chained_irq_exit(parent_chip, desc);
 	}
+
+	chained_irq_exit(parent_chip, desc);
 }
 
 static int ocelot_gpiochip_register(struct platform_device *pdev,
-- 
2.39.5


  reply	other threads:[~2024-10-06 18:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-06 18:13 [PATCH 0/1] pinctrl: ocelot: fix system hang on level based interrupts Sergey Matsievskiy
2024-10-06 18:13 ` Sergey Matsievskiy [this message]
2024-10-11  9:18   ` [PATCH 1/1] " Linus Walleij
2024-10-11 15:40     ` Sergey Matsievskiy
2024-10-11 20:02       ` Linus Walleij
2024-10-11 20:54   ` Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241006181310.181309-2-matsievskiysv@gmail.com \
    --to=matsievskiysv@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=lars.povlsen@microchip.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=quentin.schulz@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).