diff options
author | Hal Feng <hal.feng@starfivetech.com> | 2023-09-05 20:21:04 +0800 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2023-09-12 10:09:40 +0200 |
commit | 8406d6b5916663b4edc604b3effbf4935b61c2da (patch) | |
tree | 147d9f0d70f35e0dd70e44146d839a0f29ee09a7 /drivers/pinctrl | |
parent | 87d315a34133edcb29c4cadbf196ec6c30dfd47b (diff) | |
download | lwn-8406d6b5916663b4edc604b3effbf4935b61c2da.tar.gz lwn-8406d6b5916663b4edc604b3effbf4935b61c2da.zip |
pinctrl: starfive: jh7110: Fix failure to set irq after CONFIG_PM is enabled
The issue was found when we enabled CONFIG_PM and tested edge events using
libgpiod.
> # gpiomon -r gpiochip0 55
> gpiomon: error waiting for events: Permission denied
`gpiomon` will call irq_chip_pm_get() and then call pm_runtime_resume_and_get()
if (IS_ENABLED(CONFIG_PM) && sfp->gc.irq.domain->pm_dev).
pm_runtime_resume_and_get() will fail if the runtime pm of pinctrl device
is disabled.
As we expect the pinctrl driver can be always working and never suspend
during runtime, unset sfp->gc.irq.domain->pm_dev to make sure
pm_runtime_resume_and_get() won't be called when setting irq.
Fixes: 447976ab62c5 ("pinctrl: starfive: Add StarFive JH7110 sys controller driver")
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Link: https://lore.kernel.org/r/20230905122105.117000-2-hal.feng@starfivetech.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c index b9081805c8f6..ac6a0abe5534 100644 --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c @@ -967,8 +967,6 @@ int jh7110_pinctrl_probe(struct platform_device *pdev) if (ret) return dev_err_probe(dev, ret, "could not register gpiochip\n"); - irq_domain_set_pm_device(sfp->gc.irq.domain, dev); - dev_info(dev, "StarFive GPIO chip registered %d GPIOs\n", sfp->gc.ngpio); return pinctrl_enable(sfp->pctl); |