Open PandorasFox opened 4 years ago
That's a bit weird. Looking at https://elixir.bootlin.com/linux/v5.4.8/source/drivers/gpio/gpiolib.c#L3811 would suggest that the gpiochip might not be fully set up yet, which would be collaborated by your finding that it's a race condition. It's interesting because I had a conversation with Hans de Goede regarding the button driver, who mentioned that in x86 GPIOs should be fully set up once "normal" modules load (https://lkml.org/lkml/2019/10/5/104, although that's related to gpiod_get in that case). Even more so because the surface_sam_ssh module is loaded via late_initcall, so even later due to some DMA setup issues we had before. I guess that would kind of suggest something going wrong in the GPIO driver again. I'm not quite sure yet though.
Occasionally (say, 1 in every 10 boots) my SL3A will get ENXIO returned on the gpiod_to_irq in the ssh module.
Using my usb keyboard to unload/reload the module has it init properly later, so I'm assuming that it's just a weird race condition.