Re: [PATCH] gpio: Revert regression in sysfs-gpio (gpiolib.c)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> Some GPIO lines have stopped working after the patch
> commit 2ab73c6d8323f ("gpio: Support GPIO controllers without pin-ranges")
> 
> And this has supposedly been fixed in the following patches
> commit 89ad556b7f96a ("gpio: Avoid using pin ranges with !PINCTRL")
> commit 6dbbf84603961 ("gpiolib: Don't free if pin ranges are not defined")
> 
> But an erratic behavior where some GPIO lines work while others do not work
> has been introduced.
> 
> This patch reverts those changes so that the sysfs-gpio interface works
> properly again.
> 
> Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@xxxxxxxxx>

This breaks the pinctrl-microchip-sgpio driver as far as I can see.

I tried to debug it and this is what I have discovered so far:
 (1) the sgpio driver will use the gpio_stub_drv for its child nodes.
     Looks like a workaround, see [1].
 (2) these will have an empty gpio range
 (3) with the changes of this patch, pinctrl_gpio_request() will now
     be called and will fail with -EPROBE_DEFER.

I'm not exactly sure what to do here. Saravana Kannan once suggested
to use devm_of_platform_populate() to probe the child nodes [2]. But
I haven't found any other driver doing that.

Also, I'm not sure if there are any other other driver which get
broken by this. I.e. ones falling into the gpio_stub_drv category.

[1] https://lore.kernel.org/lkml/20210122193600.1415639-1-saravanak@xxxxxxxxxx/
[2] https://lore.kernel.org/lkml/CAGETcx9PiX==mLxB9PO8Myyk6u2vhPVwTMsA5NkD-ywH5xhusw@xxxxxxxxxxxxxx/

-michael

NB. this patch doesn't contain a Fixes tag. Was this on purpose?



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux