To improve performance, the Raspberry Pi GPIO driver removed the mutex
lock but left the lockdep assertion in place. When LOCKDEP is enabled,
this causes a warning because the lock is no longer held:
  Call trace:
   gpiochip_add_data_with_key+0x7b4/0xf68
   brcmstb_gpio_probe+0x2fc/0x4a0
   platform_probe+0x70/0xe8
   really_probe+0xc4/0x2c8
   __driver_probe_device+0x80/0x130
   driver_probe_device+0x44/0x180
   __driver_attach+0xa0/0x1c0

Remove the lockdep assertion when REJECT_HOTPLUG_TAX is defined to
eliminate the false warning.

Fixes: 8faa733240c1 ("gpiolib: Avoid the hotplug performance reduction")
Signed-off-by: Xiaolei Wang <[email protected]>
---
 drivers/gpio/gpiolib.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 58fb9afb2eec..5da246f932cd 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -450,7 +450,9 @@ static int gpiodev_add_to_list_unlocked(struct gpio_device 
*gdev)
 {
        struct gpio_device *prev, *next;
 
+#ifndef REJECT_HOTPLUG_TAX
        lockdep_assert_held(&gpio_devices_lock);
+#endif
 
        if (list_empty(&gpio_devices)) {
                /* initial entry in list */
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#15936): 
https://lists.yoctoproject.org/g/linux-yocto/message/15936
Mute This Topic: https://lists.yoctoproject.org/mt/116249709/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to