1. 25 Feb, 2016 2 commits
    • Geert Uytterhoeven's avatar
      gpio: rcar: Add Runtime PM handling for interrupts · 29821c2c
      Geert Uytterhoeven authored
      The R-Car GPIO driver handles Runtime PM for requested GPIOs only.
      
      When using a GPIO purely as an interrupt source, no Runtime PM handling
      is done, and the GPIO module's clock may not be enabled.
      
      To fix this:
        - Add .irq_request_resources() and .irq_release_resources() callbacks
          to handle Runtime PM when an interrupt is requested,
        - Add irq_bus_lock() and sync_unlock() callbacks to handle Runtime PM
          when e.g. disabling/enabling an interrupt, or configuring the
          interrupt type.
      
      Fixes: d5c3d846 "net: phy: Avoid polling PHY with PHY_IGNORE_INTERRUPTS"
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      29821c2c
    • Geert Uytterhoeven's avatar
      gpio: Propagate all errors in devm_get_gpiod_from_child() · 40c8eaba
      Geert Uytterhoeven authored
      devm_get_gpiod_from_child() tries several property suffixes to find a
      GPIO descriptor. If all suffixes fail and no probe deferral has been
      detected, it returns the error of the last try.
      
      However, if any but the last try fails with a real error (e.g. -EBUSY),
      this error is not propagated, and -ENOENT will be returned.
      This confuses drivers that e.g. want to detect if a GPIO is already in
      use.
      
      To fix this, change the loop logic to continue on -ENOENT, which
      indicates the property was not found and the next suffix should be
      tried, and propagate all other detected errors.
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      40c8eaba
  2. 23 Feb, 2016 1 commit
  3. 22 Feb, 2016 1 commit
  4. 20 Feb, 2016 2 commits
    • Linus Walleij's avatar
      Revert "gpio: remove broken irq_to_gpio() interface" · 2307f3aa
      Linus Walleij authored
      This reverts commit ee2204a3.
      2307f3aa
    • Bamvor Jian Zhang's avatar
      gpiolib: fix crash when gpiochip removed · bd203bd5
      Bamvor Jian Zhang authored
      Commit cb464a88e1ed ("gpio: make the gpiochip a real device") call
      gpiochip_sysfs_unregister after the gpiochip is empty. It lead to the
      following crash:
      
      [  163.503994] Unable to handle kernel NULL pointer dereference at virtual address 0000007c
      [...]
      [  163.525394] [<ffffffc0003719a0>] gpiochip_sysfs_unregister+0x44/0xa4
      [  163.525611] [<ffffffc00036f6a0>] gpiochip_remove+0x24/0x154
      [  163.525861] [<ffffffbffc00f0a4>] mockup_gpio_remove+0x38/0x64 [gpio_mockup]
      [  163.526101] [<ffffffc00042b4b4>] platform_drv_remove+0x24/0x64
      [  163.526313] [<ffffffc000429cc8>] __device_release_driver+0x7c/0xfc
      [  163.526525] [<ffffffc000429e54>] driver_detach+0xbc/0xc0
      [  163.526700] [<ffffffc000429014>] bus_remove_driver+0x58/0xac
      [  163.526883] [<ffffffc00042a4cc>] driver_unregister+0x2c/0x4c
      [  163.527067] [<ffffffc00042b5c0>] platform_driver_unregister+0x10/0x18
      [  163.527284] [<ffffffbffc00f340>] mock_device_exit+0x10/0x38 [gpio_mockup]
      [  163.527593] [<ffffffc00011cefc>] SyS_delete_module+0x1b8/0x1fc
      [  163.527799] [<ffffffc000085d8c>] __sys_trace_return+0x0/0x4
      [  163.528049] Code: 940d74b4 f9019abf aa1303e0 940d7439 (7940fac0)
      [  163.536273] ---[ end trace 3d1329be504af609 ]---
      
      This patch fix this by changing the code back.
      Signed-off-by: default avatarBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      bd203bd5
  5. 19 Feb, 2016 26 commits
  6. 18 Feb, 2016 5 commits
  7. 16 Feb, 2016 3 commits