1. 27 Jul, 2015 1 commit
    • Sebastian Andrzej Siewior's avatar
      gpio: omap: use raw locks for locking · 4dbada2b
      Sebastian Andrzej Siewior authored
      
      This patch converts gpio_bank.lock from a spin_lock into a
      raw_spin_lock. The call path is to access this lock is always under a
      raw_spin_lock, for instance
      - __setup_irq() holds &desc->lock with irq off
        + __irq_set_trigger()
         + omap_gpio_irq_type()
      
      - handle_level_irq() (runs with irqs off therefore raw locks)
        + mask_ack_irq()
         + omap_gpio_mask_irq()
      
      This fixes the obvious backtrace on -RT. However the locking vs context
      is not and this is not limited to -RT:
      - omap_gpio_irq_type() is called with IRQ off and has an conditional
        call to pm_runtime_get_sync() which may sleep. Either it may happen or
        it may not happen but pm_runtime_get_sync() should not be called with
        irqs off.
      
      - omap_gpio_debounce() is holding the lock with IRQs off.
        + omap2_set_gpio_debounce()
         + clk_prepare_enable()
          + clk_prepare() this one might sleep.
        The number of users of gpiod_set_debounce() / gpio_set_debounce()
        looks low but still this is not good.
      Acked-by: default avatarJavier Martinez Canillas <javier@dowhile0.org>
      Acked-by: default avatarSantosh Shilimkar <ssantosh@kernel.org>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      4dbada2b
  2. 14 Jul, 2015 2 commits
  3. 01 Jun, 2015 5 commits
  4. 06 May, 2015 2 commits
  5. 27 Mar, 2015 8 commits
  6. 09 Mar, 2015 1 commit
  7. 26 Jan, 2015 1 commit
    • Tony Lindgren's avatar
      gpio: omap: Fix bad device access with setup_irq() · 3d009c8c
      Tony Lindgren authored
      
      Similar to omap_gpio_irq_type() let's make sure that the GPIO
      is usable as an interrupt if the platform init code did not
      call gpio_request(). Otherwise we can get invalid device access
      after setup_irq():
      
      WARNING: CPU: 0 PID: 1 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x214/0x340()
      44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4CFG (Idle): Data Access in Supervisor mode during Functional access
      ...
      [<c05f21e4>] (__irq_svc) from [<c05f1974>] (_raw_spin_unlock_irqrestore+0x34/0x44)
      [<c05f1974>] (_raw_spin_unlock_irqrestore) from [<c00914a8>] (__setup_irq+0x244/0x530)
      [<c00914a8>] (__setup_irq) from [<c00917d4>] (setup_irq+0x40/0x8c)
      [<c00917d4>] (setup_irq) from [<c0039c8c>] (omap_system_dma_probe+0x1d4/0x2b4)
      [<c0039c8c>] (omap_system_dma_probe) from [<c03b2200>] (platform_drv_probe+0x44/0xa4)
      ...
      
      We can fix this the same way omap_gpio_irq_type() is handling it.
      
      Note that the long term solution is to change the gpio-omap driver
      to handle the banks as separate driver instances. This will allow
      us to rely on just runtime PM for tracking the bank specific state.
      Reported-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Cc: Javier Martinez Canillas <javier@dowhile0.org>
      Cc: Kevin Hilman <khilman@kernel.org>
      Cc: Santosh Shilimkar <ssantosh@kernel.org>
      Tested-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      3d009c8c
  8. 04 Dec, 2014 1 commit
  9. 28 Oct, 2014 1 commit
  10. 23 Sep, 2014 2 commits
  11. 09 Jul, 2014 3 commits
  12. 16 May, 2014 1 commit
  13. 03 May, 2014 1 commit
  14. 28 Apr, 2014 4 commits
  15. 24 Feb, 2014 1 commit
  16. 25 Nov, 2013 1 commit
  17. 16 Oct, 2013 1 commit
  18. 01 Oct, 2013 2 commits
  19. 16 Aug, 2013 2 commits