• Dmitry Osipenko's avatar
    gpio: tegra: Use raw_spinlock · 37174f33
    Dmitry Osipenko authored
    Use raw_spinlock in order to fix spurious messages about invalid context
    when spinlock debugging is enabled. This happens because there is a legit
    nested raw_spinlock->spinlock locking usage within IRQ-related code. IRQ
    core uses raw spinlock and then Tegra GPIO driver uses a nested spinlock.
    The debug code can't recognize and handle this case, hence we need to use
    raw spinlock in the GPIO driver.
    
     [ BUG: Invalid wait context ]
     ...
      (dump_stack) from (__lock_acquire)
      (__lock_acquire) from (lock_acquire)
      (lock_acquire) from (_raw_spin_lock_irqsave)
      (_raw_spin_lock_irqsave) from (tegra_gpio_irq_set_type)
      (tegra_gpio_irq_set_type) from (__irq_set_trigger)
      (__irq_set_trigger) from (__setup_irq)
      (__setup_irq) from (request_threaded_irq)
      (request_threaded_irq) from (devm_request_threaded_irq)
      (devm_request_threaded_irq) from (elants_i2c_probe)
      (elants_i2c_probe) from (i2c_device_probe)
     ...
    Tested-by: default avatarPeter Geis <pgwipeout@gmail.com>
    Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
    Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
    37174f33
gpio-tegra.c 18.7 KB