From: Sergey Matsievskiy <matsievskiysv@gmail.com>
To: Linus Walleij <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
Subject: Re: [PATCH 1/1] pinctrl: ocelot: fix system hang on level based interrupts
Date: Fri, 11 Oct 2024 18:40:36 +0300 [thread overview]
Message-ID: <ZwlG9AKToZFFPAvi@KILLINGMACHINE> (raw)
In-Reply-To: <CACRpkdbJ7xh1qOYaZOh+s+Tj_GgE4LXMFuOgL1zpxBRqJQVx6w@mail.gmail.com>
On Fri, Oct 11, 2024 at 11:18:55AM +0200, Linus Walleij wrote:
> I'm a bit puzzled by the patch because I don't understand it.
The current implementation only calls chained_irq_enter() and chained_irq_exit()
if it detects pending interrupts.
```
for (i = 0; i < info->stride; i++) {
uregmap_read(info->map, id_reg + 4 * i, ®);
if (!reg)
continue;
chained_irq_enter(parent_chip, desc);
```
However, in case of GPIO pin configured in level mode and the parent controller
configured in edge mode, GPIO interrupt might be lowered by the hardware. In the
result,if the interrupt is short enough, the parent interrupt is still pending
while the GPIO interrupt is cleared; chained_irq_enter() never gets called and
the system hangs trying to service the parent interrupt.
Moving chained_irq_enter() and chained_irq_exit() outside the for loop ensures
that they are called even when GPIO interrupt is lowered by the hardware.
The similar code with chained_irq_enter() / chained_irq_exit() functions
wrapping interrupt checking loop may be found in many other drivers:
```
grep -r -A 10 chained_irq_enter drivers/pinctrl
```
> This needs to describe how moving the chained irq calls achieves
> this effect.
If the explanation above satisfies you, I'll elaborate the commit message and
resend the patch.
--
Sergey Matsievskiy
next prev parent reply other threads:[~2024-10-11 15:40 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 ` [PATCH 1/1] " Sergey Matsievskiy
2024-10-11 9:18 ` Linus Walleij
2024-10-11 15:40 ` Sergey Matsievskiy [this message]
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=ZwlG9AKToZFFPAvi@KILLINGMACHINE \
--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).