gpio: initialize descriptor SRCU structure before adding OF-based chips
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 12 Feb 2024 21:39:20 +0000 (22:39 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 14 Feb 2024 08:34:03 +0000 (09:34 +0100)
commitba5c5effe02c4ae06291c7c5e67de8fedad3cf9a
tree1cccf841eef0e4814810cabc9638272461635209
parent5e6284444024cf7e7d0ae538df8037a3a5efbec8
gpio: initialize descriptor SRCU structure before adding OF-based chips

In certain situations we may end up taking the GPIO descriptor SRCU read
lock in of_gpiochip_add() before the SRCU struct is initialized. Move
the initialization before the call to of_gpiochip_add().

Fixes: be711caa87c5 ("gpio: add SRCU infrastructure to struct gpio_desc")
Fixes: 1f2bcb8c8ccd ("gpio: protect the descriptor label with SRCU")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202402122228.e607a080-lkp@intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib.c