From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Linus Walleij <linus.walleij@linaro.org>,
linux-arm-kernel@lists.infradead.org
Subject: [REGRESSION] gpio hogging fails with pinctrl gpio drivers
Date: Thu, 6 Feb 2020 17:32:47 +0000 [thread overview]
Message-ID: <20200206173247.GX25745@shell.armlinux.org.uk> (raw)
Hi Linus,
It seems that sometime between 4.20 and 5.5, something has broken the
ability to specify gpio-hogs in DT for GPIOs that are written around
pinctrl drivers.
For example:
gpio6: sx1503@20 {
compatible = "semtech,sx1503q";
...
phy_rst {
gpio-hog;
gpios = <9 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "10g-rstn";
};
};
fails with:
gpio gpiochip7: (sx1503q): setup of own GPIO 10g-rstn failed
requesting hog GPIO 10g-rstn (chip sx1503q, offset 9) failed, -517
gpiochip_add_data_with_key: GPIOs 480..495 (sx1503q) failed to register, -517
It appears that the reason for this failure is that the hogs are
requested in gpiochip_add_data_with_key(), called from
devm_gpiochip_add_data(), but as the set_config method points to
gpiochip_generic_config, it wants to look up the pinctrl pin range
via pinctrl_get_device_gpio_range(). However, that has not been setup
yet, as the following call to gpiochip_add_pin_range() has not been
reached:
ret = devm_gpiochip_add_data(dev, &pctl->gpio, pctl);
if (ret)
return ret;
ret = gpiochip_add_pin_range(&pctl->gpio, dev_name(dev),
0, 0, pctl->data->npins);
and so pinctrl_get_device_gpio_range() returns -EPROBE_DEFER.
Consequently, adding a gpio-hog to DT for this driver results in the
driver endlessly returning -EPROBE_DEFER.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2020-02-06 17:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 17:32 Russell King - ARM Linux admin [this message]
2020-02-20 8:17 ` [REGRESSION] gpio hogging fails with pinctrl gpio drivers Linus Walleij
2020-02-20 10:12 ` Peter Rosin
2020-02-20 17:28 ` Andrey Smirnov
2020-02-20 18:19 ` Russell King - ARM Linux admin
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=20200206173247.GX25745@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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).