All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Lee Jones" <lee@kernel.org>, linux-gpio@vger.kernel.org
Subject: Re: [PATCH 08/10] gpio: mpc8xxx: Drop stale remove callback clearing chained handler
Date: Thu, 03 Dec 2026 21:17:32 +0000	[thread overview]
Message-ID: <sashiko-outbox-248679@kernel.org> (raw)
In-Reply-To: <20261203205606.3905705-9-lee@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] gpio: mpc8xxx: shared parent IRQ freed before GPIO_IMR is
  masked on unbind
--

commit d9a4fe4701d225631d57b747b098abd12372ac63
Author: Lee Jones <lee@kernel.org>

gpio: mpc8xxx: Drop stale remove callback clearing chained handler

This commit removes mpc8xxx_remove() so that unbinding the driver relies on
devres LIFO teardown instead of clearing the parent interrupt's chained
handler.

> diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
> index 54ac69f96628e..cd1c03679cc51 100644
> --- a/drivers/gpio/gpio-mpc8xxx.c
> +++ b/drivers/gpio/gpio-mpc8xxx.c
> @@ -461,14 +461,6 @@ static int mpc8xxx_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static void mpc8xxx_remove(struct platform_device *pdev)
> -{
> -	struct mpc8xxx_gpio_chip *mpc8xxx_gc = platform_get_drvdata(pdev);
> -
> -	if (mpc8xxx_gc->irq)
> -		irq_set_chained_handler_and_data(mpc8xxx_gc->irqn, NULL, NULL);
> -}
> -
>  static int mpc8xxx_suspend(struct device *dev)
>  {
>  	struct mpc8xxx_gpio_chip *mpc8xxx_gc = dev_get_drvdata(dev);

[Severity: High]
Can devres LIFO teardown now free the shared parent IRQ while GPIO_IMR still
has active interrupts enabled?

In mpc8xxx_probe(), devm_gpiochip_add_data() is registered before
devm_request_irq() with IRQF_SHARED.  On unbind, devres runs free_irq()
before gpiochip_remove() clears GPIO_IMR via gpiochip_free_remaining_irqs(),
violating the free_irq() requirement to mask shared interrupts first.

When a sibling controller shares the level-high parent IRQ (such as gpio1
and gpio2 on LS1028A), __free_irq() leaves the line enabled across two
synchronize_srcu() grace periods in gpiochip_remove().  If a GPIO line fires
in that window, it stays asserted with no handler left to ack GPIO_IER.

Because the sibling's mpc8xxx_gpio_irq_cascade() unconditionally returns
IRQ_HANDLED, note_interrupt() never throttles the storm, trapping the CPU in
a hardirq loop that can stall synchronize_srcu() and livelock unbind.

Registering devm_request_irq() (or a devm action that masks GPIO_IMR) before
devm_gpiochip_add_data() would ensure hardware interrupts are masked before
free_irq() detaches from the shared parent IRQ.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203205606.3905705-1-lee@kernel.org?part=8

  reply	other threads:[~2026-12-03 21:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 20:54 [PATCH 00/10] gpio: Fix Critical and High issues reported by Sashiko Lee Jones
2026-12-03 20:54 ` Lee Jones
2026-12-03 20:54 ` [PATCH 01/10] gpio: davinci: Validate ngpio against MAX_REGS_BANKS in davinci_gpio_probe() Lee Jones
2026-12-03 20:55 ` [PATCH 02/10] gpiolib: acpi: Hold gpio_device reference in acpi_dev_gpio_irq_wake_get_by() Lee Jones
2026-12-04 11:35   ` Andy Shevchenko
2026-12-03 20:55 ` [PATCH 03/10] gpio: mvebu: Clear chained IRQ handlers on unbind Lee Jones
2026-12-03 21:13   ` sashiko-bot
2026-12-03 22:10   ` Andrew Lunn
2026-12-04  0:05     ` Rosen Penev
2026-12-04  1:17       ` Andrew Lunn
2026-12-05  3:12         ` Rosen Penev
2026-12-03 20:55 ` [PATCH 04/10] gpio: rockchip: Unregister gpiochip on pin-range lookup errors Lee Jones
2026-12-03 20:55   ` Lee Jones
2026-12-03 20:55 ` [PATCH 05/10] gpiolib: Avoid undersized array bitmap in set fastpath Lee Jones
2026-12-03 20:55 ` [PATCH 06/10] gpio: mlxbf2: Embed context save registers to prevent suspend NULL dereference Lee Jones
2026-12-03 20:55 ` [PATCH 07/10] gpio: regmap: Use resolved chip->ngpio for default ngpio_per_reg Lee Jones
2026-12-04 11:36   ` Andy Shevchenko
2026-12-03 20:55 ` [PATCH 08/10] gpio: mpc8xxx: Drop stale remove callback clearing chained handler Lee Jones
2026-12-03 21:17   ` sashiko-bot [this message]
2026-12-03 20:55 ` [PATCH 09/10] gpio: mpsse: Allocate DMA-safe buffer in mpsse_write() Lee Jones
2026-12-03 20:55 ` [PATCH 10/10] gpio: pcie-idio-24: Fix COS_ENABLE_RISING bit definition Lee Jones
2026-12-04 21:02   ` William Breathitt Gray

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=sashiko-outbox-248679@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 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.