Regression in next with gpiolib
Hi Timur, Linus & Grygorii,
Looks like commit 108d23e322a2 ("gpiolib: request the gpio before querying its direction") caused a regression on at least pandaboard es with booting hanging shortly after gpio init.
It seems to be that we're now calling request and free on all gpios before they are properly configured?
I narrowed the hang down to gpio bank1 lines 7 and possibly 8 where not calling omap_gpio_free() on them makes the system boot again.
These lines are used for the leds in omap4-panda-common.dtsi, and omap_gpio_free() will by default set the unused lines for input and bad things happen. I guess hardware failure could also happen although I have not seen it here.
It seems a similar issue can exist on other platforms too, so it's probably a good idea to revert this for now.
Any ideas on how we should fix this?
Regards,
Tony
Quoted 2 lines · Tony Lindgren
It seems to be that we're now calling request and free on all gpios before they are properly configured?
Yes, that's what my patch does. At the time, it seemed like a good idea -- request the GPIO before touching its hardware. But it appears that the 'request' function of some drivers also re-muxes the GPIO in order to honor the request.
The question is whether that's correct behavior. I don't know.
Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
Quoted 12 lines · Tony Lindgren
Hi Timur, Linus & Grygorii,
Looks like commit
108d23e322a2("gpiolib: request the gpio before querying its direction") caused a regression on at least pandaboard es with booting hanging shortly after gpio init.It seems to be that we're now calling request and free on all gpios before they are properly configured?
I narrowed the hang down to gpio bank1 lines 7 and possibly 8 where not calling
omap_gpio_free()on them makes the system boot again.
Quoted 7 lines
These lines are used for the leds in
omap4-panda-common.dtsi, andomap_gpio_free()will by default set the unused lines for input and bad things happen. I guess hardware failure could also happen although I have not seen it here.It seems a similar issue can exist on other platforms too, so it's probably a good idea to revert this for now.
I reverted it for now.
Yours,
Linus Walleij
Quoted 19 lines · Linus Walleij
Quoted 17 lines · Tony Lindgren
Hi Timur, Linus & Grygorii,
Looks like commit
108d23e322a2("gpiolib: request the gpio before querying its direction") caused a regression on at least pandaboard es with booting hanging shortly after gpio init.It seems to be that we're now calling request and free on all gpios before they are properly configured?
I narrowed the hang down to gpio bank1 lines 7 and possibly 8 where not calling
omap_gpio_free()on them makes the system boot again.These lines are used for the leds in
omap4-panda-common.dtsi, andomap_gpio_free()will by default set the unused lines for input and bad things happen. I guess hardware failure could also happen although I have not seen it here.
Quoted 4 lines
Quoted 2 lines
It seems a similar issue can exist on other platforms too, so it's probably a good idea to revert this for now.
I reverted it for now.
OK thanks!
Tony