1. 09 4月, 2021 1 次提交
  2. 09 3月, 2021 1 次提交
    • Q
      gpiolib: free device name on error path to fix kmemleak · 0dc6680f
      Quanyang Wang 提交于
      stable inclusion
      from stable-5.10.15
      commit 8847a756e1df06767e64717f79e19f48b6524c44
      bugzilla: 48167
      
      --------------------------------
      
      commit c351bb64 upstream.
      
      In gpiochip_add_data_with_key, we should check the return value of
      dev_set_name to ensure that device name is allocated successfully
      and then add a label on the error path to free device name to fix
      kmemleak as below:
      
      unreferenced object 0xc2d6fc40 (size 64):
        comm "kworker/0:1", pid 16, jiffies 4294937425 (age 65.120s)
        hex dump (first 32 bytes):
          67 70 69 6f 63 68 69 70 30 00 1a c0 54 63 1a c0  gpiochip0...Tc..
          0c ed 84 c0 48 ed 84 c0 3c ee 84 c0 10 00 00 00  ....H...<.......
        backtrace:
          [<962810f7>] kobject_set_name_vargs+0x2c/0xa0
          [<f50797e6>] dev_set_name+0x2c/0x5c
          [<94abbca9>] gpiochip_add_data_with_key+0xfc/0xce8
          [<5c4193e0>] omap_gpio_probe+0x33c/0x68c
          [<3402f137>] platform_probe+0x58/0xb8
          [<7421e210>] really_probe+0xec/0x3b4
          [<000f8ada>] driver_probe_device+0x58/0xb4
          [<67e0f7f7>] bus_for_each_drv+0x80/0xd0
          [<4de545dc>] __device_attach+0xe8/0x15c
          [<2e4431e7>] bus_probe_device+0x84/0x8c
          [<c18b1de9>] device_add+0x384/0x7c0
          [<5aff2995>] of_platform_device_create_pdata+0x8c/0xb8
          [<061c3483>] of_platform_bus_create+0x198/0x230
          [<5ee6d42a>] of_platform_populate+0x60/0xb8
          [<2647300f>] sysc_probe+0xd18/0x135c
          [<3402f137>] platform_probe+0x58/0xb8
      Signed-off-by: NQuanyang Wang <quanyang.wang@windriver.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
      0dc6680f
  3. 12 1月, 2021 1 次提交
  4. 02 12月, 2020 1 次提交
  5. 05 11月, 2020 1 次提交
  6. 30 9月, 2020 2 次提交
    • K
      gpiolib: cdev: support setting debounce · 65cff704
      Kent Gibson 提交于
      Add support for setting debounce on a line via the GPIO uAPI.
      Where debounce is not supported by hardware, a software debounce is
      provided.
      
      The implementation of the software debouncer waits for the line to be
      stable for the debounce period before determining if a level change,
      and a corresponding edge event, has occurred.  This provides maximum
      protection against glitches, but also introduces a debounce_period
      latency to edge events.
      
      The software debouncer is integrated with the edge detection as it
      utilises the line interrupt, and integration is simpler than getting
      the two to interwork.  Where software debounce AND edge detection is
      required, the debouncer provides both.
      Signed-off-by: NKent Gibson <warthog618@gmail.com>
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      65cff704
    • K
      gpiolib: cdev: support edge detection for uAPI v2 · 73e03419
      Kent Gibson 提交于
      Add support for edge detection to lines requested using
      GPIO_V2_GET_LINE_IOCTL.
      
      The edge_detector implementation is based on the v1 lineevent
      implementation.  Unlike the v1 implementation, an overflow of the event
      buffer results in discarding older events, rather than the most
      recent, so the final event in a burst will correspond to the current
      state of the line.
      Signed-off-by: NKent Gibson <warthog618@gmail.com>
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      73e03419
  7. 17 9月, 2020 1 次提交
  8. 14 9月, 2020 3 次提交
  9. 11 9月, 2020 1 次提交
  10. 12 7月, 2020 2 次提交
  11. 30 6月, 2020 1 次提交
  12. 21 6月, 2020 1 次提交
  13. 03 6月, 2020 1 次提交
  14. 29 5月, 2020 2 次提交
  15. 27 5月, 2020 1 次提交
  16. 18 5月, 2020 1 次提交
  17. 16 5月, 2020 1 次提交
  18. 13 5月, 2020 1 次提交
  19. 28 4月, 2020 2 次提交
  20. 23 4月, 2020 2 次提交
  21. 01 4月, 2020 1 次提交
  22. 31 3月, 2020 1 次提交
  23. 28 3月, 2020 4 次提交
  24. 27 3月, 2020 1 次提交
  25. 25 3月, 2020 1 次提交
  26. 20 3月, 2020 1 次提交
  27. 11 3月, 2020 1 次提交
    • L
      gpiolib: Fix irq_disable() semantics · 8959b304
      Linus Walleij 提交于
      The implementation if .irq_disable() which kicks in between
      the gpiolib and the driver is not properly mimicking the
      expected semantics of the irqchip core: the irqchip will
      call .irq_disable() if that exists, else it will call
      mask_irq() which first checks if .irq_mask() is defined
      before calling it.
      
      Since we are calling it unconditionally, we get this bug
      from drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c, as it only
      defines .irq_mask_ack and not .irq_mask:
      
        Unable to handle kernel NULL pointer dereference at virtual address 00000000
        pgd = (ptrval)
        (...)
        PC is at 0x0
        LR is at gpiochip_irq_disable+0x20/0x30
      
      Fix this by only calling .irq_mask() if it exists.
      
      Cc: Brian Masney <masneyb@onstation.org>
      Cc: Hans Verkuil <hans.verkuil@cisco.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      Fixes: 461c1a7d ("gpiolib: override irq_enable/disable")
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Link: https://lore.kernel.org/r/20200306132326.1329640-1-linus.walleij@linaro.org
      8959b304
  28. 03 3月, 2020 1 次提交
  29. 02 3月, 2020 2 次提交