From: sashiko-bot@kernel.org
To: "Eliav Farber" <farbere@amazon.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] pps: clients: gpio: release pins to idle state on remove and shutdown
Date: Wed, 16 Sep 2026 13:57:41 +0000 [thread overview]
Message-ID: <20260916135741.83AE31F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260916134744.46354-3-farbere@amazon.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] pps: missing IRQ and timer teardown in pps_gpio_shutdown()
--
commit e71a89236222915be5ef5d5a822ad6e3bcc21b37
Author: Eliav Farber <farbere@amazon.com>
pps: clients: gpio: release pins to idle state on remove and shutdown
Some boards route the PPS input GPIO through a pin controller and mux it
to another function when the driver is not bound. This patch selects the
"idle" pinctrl state in both remove() and shutdown() so that the alternate
mux is restored, for instance before kexec.
> diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
> index 73ec2c7335e51..bdedbed82d82c 100644
> --- a/drivers/pps/clients/pps-gpio.c
> +++ b/drivers/pps/clients/pps-gpio.c
[ ... ]
> @@ -216,9 +217,26 @@ static void pps_gpio_remove(struct platform_device *pdev)
> timer_delete_sync(&data->echo_timer);
> /* reset echo pin in any case */
> gpiod_set_value(data->echo_pin, 0);
> + /*
> + * Release the pins to their "idle" state, if the board defines one, so
> + * they are handed back to whatever function uses them while pps-gpio is
> + * not bound. Boards that do not describe an idle pinctrl state are
> + * unaffected. The "default" (active) state is applied automatically by
> + * the driver core before probe.
> + */
> + pinctrl_pm_select_idle_state(&pdev->dev);
> dev_info(&pdev->dev, "removed IRQ %d as PPS source\n", data->irq);
> }
>
> +static void pps_gpio_shutdown(struct platform_device *pdev)
> +{
> + /*
> + * Leave the pins in their "idle" state on shutdown so a subsequent
> + * kernel (e.g. after kexec) finds the pin controller in a known state.
> + */
> + pinctrl_pm_select_idle_state(&pdev->dev);
[Severity: High]
Does this code risk causing an interrupt storm during shutdown or kexec?
When pps_gpio_shutdown() alters the physical pin state to "idle" while system
interrupts are still enabled, it could leave the edge-triggered PPS input pin
floating (e.g. if the "idle" state removes pull resistors). Because the IRQ is
never explicitly disabled here and the echo timer is left running, electrical
noise might generate rapid spurious edges.
Since the IRQ handler always returns IRQ_HANDLED, the kernel IRQ core won't
detect and shut down a spurious storm. Could the CPU get stuck in an infinite
interrupt loop, preventing shutdown or kexec from completing? Should the IRQ
and timer be torn down here as they are in pps_gpio_remove()?
> +}
> +
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260916134744.46354-1-farbere@amazon.com?part=2
next prev parent reply other threads:[~2026-09-16 13:57 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 13:47 [PATCH 0/2] pps-gpio: restore pin mux on unbind and shutdown Eliav Farber
2026-09-16 13:47 ` [PATCH 1/2] dt-bindings: pps: pps-gpio: document optional idle pinctrl state Eliav Farber
2026-09-16 13:47 ` [PATCH 2/2] pps: clients: gpio: release pins to idle state on remove and shutdown Eliav Farber
2026-09-16 13:57 ` sashiko-bot [this message]
2026-09-16 16:48 ` [PATCH 0/2] pps-gpio: restore pin mux on unbind " Rodolfo Giometti
2026-09-16 18:25 ` Farber, Eliav
2026-09-16 18:26 ` [PATCH v2 " Eliav Farber
2026-09-16 18:26 ` [PATCH v2 1/2] dt-bindings: pps: pps-gpio: document optional pinctrl states Eliav Farber
2026-09-17 7:13 ` Rodolfo Giometti
2026-09-17 7:48 ` Farber, Eliav
2026-09-16 18:26 ` [PATCH v2 2/2] pps: clients: gpio: release pins to an inactive state on remove and shutdown Eliav Farber
2026-09-16 18:43 ` sashiko-bot
2026-09-17 7:14 ` Rodolfo Giometti
2026-09-17 7:52 ` Farber, Eliav
2026-09-17 7:56 ` [PATCH v3 0/3] pps-gpio: restore pin mux on unbind " Eliav Farber
2026-09-17 7:56 ` [PATCH v3 1/3] pps: clients: gpio: propagate probe error codes Eliav Farber
2026-09-17 8:04 ` sashiko-bot
2026-09-17 9:58 ` Bartosz Golaszewski
2026-09-18 7:50 ` Rodolfo Giometti
2026-09-17 7:56 ` [PATCH v3 2/3] dt-bindings: pps: pps-gpio: document optional pinctrl states Eliav Farber
2026-09-17 15:35 ` Rob Herring (Arm)
2026-09-17 16:13 ` Rob Herring
2026-09-18 7:50 ` Rodolfo Giometti
2026-09-18 15:43 ` Rob Herring
2026-09-17 7:56 ` [PATCH v3 3/3] pps: clients: gpio: release pins to an inactive state on remove and shutdown Eliav Farber
2026-09-17 8:10 ` sashiko-bot
2026-09-19 17:11 ` [PATCH v4 0/3] pps-gpio: restore pin mux on unbind " Eliav Farber
2026-09-22 7:40 ` Rodolfo Giometti
2026-09-22 10:08 ` Farber, Eliav
2026-09-22 10:30 ` [PATCH v5 0/4] " Eliav Farber
2026-09-22 10:30 ` [PATCH v5 1/4] pps: clients: gpio: propagate probe error codes Eliav Farber
2026-09-22 10:30 ` [PATCH v5 2/4] pps: clients: gpio: only tear down the echo timer when it exists Eliav Farber
2026-09-22 10:30 ` [PATCH v5 3/4] dt-bindings: pps: pps-gpio: document optional pinctrl states Eliav Farber
2026-09-22 12:46 ` Rodolfo Giometti
2026-09-23 12:36 ` Rob Herring
2026-09-23 13:13 ` Farber, Eliav
2026-09-23 18:04 ` Rob Herring
2026-09-22 10:30 ` [PATCH v5 4/4] pps: clients: gpio: release pins to an inactive state on remove and shutdown Eliav Farber
2026-09-22 10:39 ` sashiko-bot
2026-09-22 12:46 ` Rodolfo Giometti
2026-09-22 14:55 ` Farber, Eliav
2026-09-23 7:50 ` Rodolfo Giometti
2026-09-23 18:22 ` [PATCH v6 0/4] pps-gpio: restore pin mux on unbind " Eliav Farber
2026-09-23 18:22 ` [PATCH v6 1/4] pps: clients: gpio: propagate probe error codes Eliav Farber
2026-09-24 12:58 ` Rodolfo Giometti
2026-09-24 14:46 ` Bartosz Golaszewski
2026-09-23 18:22 ` [PATCH v6 2/4] pps: clients: gpio: only tear down the echo timer when it exists Eliav Farber
2026-09-24 12:59 ` Rodolfo Giometti
2026-09-24 14:47 ` Bartosz Golaszewski
2026-09-23 18:22 ` [PATCH v6 3/4] dt-bindings: pps: pps-gpio: document optional pinctrl states Eliav Farber
2026-09-23 18:41 ` Rob Herring
2026-09-24 12:59 ` Rodolfo Giometti
2026-09-23 18:22 ` [PATCH v6 4/4] pps: clients: gpio: release pins to an inactive state on remove and shutdown Eliav Farber
2026-09-24 12:59 ` Rodolfo Giometti
2026-10-01 7:53 ` Linus Walleij
2026-09-24 12:58 ` [PATCH v6 0/4] pps-gpio: restore pin mux on unbind " Rodolfo Giometti
2026-09-19 17:11 ` [PATCH v4 1/3] pps: clients: gpio: propagate probe error codes Eliav Farber
2026-09-22 7:40 ` Rodolfo Giometti
2026-09-22 8:08 ` Farber, Eliav
2026-09-22 8:22 ` Rodolfo Giometti
2026-09-22 10:06 ` Farber, Eliav
2026-09-19 17:11 ` [PATCH v4 2/3] dt-bindings: pps: pps-gpio: document optional pinctrl states Eliav Farber
2026-09-22 7:40 ` Rodolfo Giometti
2026-09-22 10:11 ` Farber, Eliav
2026-09-19 17:11 ` [PATCH v4 3/3] pps: clients: gpio: release pins to an inactive state on remove and shutdown Eliav Farber
2026-09-22 7:40 ` Rodolfo Giometti
2026-09-22 10:13 ` Farber, Eliav
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=20260916135741.83AE31F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=farbere@amazon.com \
--cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox