Re: [PATCH 18/23] gpio: nomadik: support mobileye,eyeq5-gpio
From: Théo Lebrun <theo.lebrun@bootlin.com>
Date: 2024-02-22 09:37:24
Also in:
linux-devicetree, linux-gpio, linux-mips, lkml
From: Théo Lebrun <theo.lebrun@bootlin.com>
Date: 2024-02-22 09:37:24
Also in:
linux-devicetree, linux-gpio, linux-mips, lkml
Hello, On Wed Feb 21, 2024 at 8:36 PM CET, Linus Walleij wrote:
On Wed, Feb 21, 2024 at 5:16 PM Théo Lebrun [off-list ref] wrote:quoted
quoted
Trying to figure it out...Can I help in the debugging process?Nah, I found it :)quoted
Reading the code once again I'd guess of_device_get_match_data(&gpio_pdev->dev) could be the root cause. We are accessing match data for the GPIO device while probing the pinctrl device. Maybe something isn't initialised properly yet? The rest looks rather harmless, I've checked all conditional expressions.Yep spot on. The nmk_gpio_populate_chip() is sometimes called from the pinctrl driver before the gpio probe() has been called, so the match data is NULL and we crash. This looks like it does for historical reasons and there could be better ways to fix it now that Saravana Kannan has fixed up the probe ordering code. The following is one way to fix it for now using device_is_compatible() (illustrating some other changes I did as well):
Thanks for the debugging and the proposed fix. Indeed matching on compatible to avoid match data for a bool makes sense. Thanks, -- Théo Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel