1. 26 3月, 2021 3 次提交
  2. 16 3月, 2021 1 次提交
  3. 12 3月, 2021 1 次提交
  4. 08 3月, 2021 3 次提交
  5. 09 2月, 2021 1 次提交
  6. 01 2月, 2021 1 次提交
  7. 29 1月, 2021 1 次提交
    • Q
      gpiolib: free device name on error path to fix kmemleak · c351bb64
      Quanyang Wang 提交于
      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>
      c351bb64
  8. 27 1月, 2021 1 次提交
    • S
      gpiolib: Bind gpio_device to a driver to enable fw_devlink=on by default · 4731210c
      Saravana Kannan 提交于
      There are multiple instances of GPIO device tree nodes of the form:
      
      foo {
      	compatible = "acme,foo";
      	...
      
      	gpio0: gpio0@xxxxxxxx {
      		compatible = "acme,bar";
      		...
      		gpio-controller;
      	};
      
      	gpio1: gpio1@xxxxxxxx {
      		compatible = "acme,bar";
      		...
      		gpio-controller;
      	};
      
      	...
      }
      
      bazz {
      	my-gpios = <&gpio0 ...>;
      }
      
      Case 1: The driver for "foo" populates struct device for these gpio*
      nodes and then probes them using a driver that binds with "acme,bar".
      This driver for "acme,bar" then registers the gpio* nodes with gpiolib.
      This lines up with how DT nodes with the "compatible" property are
      typically converted to struct devices and then registered with driver
      core to probe them. This also allows the gpio* devices to hook into all
      the driver core capabilities like runtime PM, probe deferral,
      suspend/resume ordering, device links, etc.
      
      Case 2: The driver for "foo" doesn't populate struct devices for these
      gpio* nodes before registering them with gpiolib. Instead it just loops
      through its child nodes and directly registers the gpio* nodes with
      gpiolib.
      
      Drivers that follow case 2 cause problems with fw_devlink=on. This is
      because fw_devlink will prevent bazz from probing until there's a struct
      device that has gpio0 as its fwnode (because bazz lists gpio0 as a GPIO
      supplier). Once the struct device is available, fw_devlink will create a
      device link with gpio0 device as the supplier and bazz device as the
      consumer. After this point, since the gpio0 device will never bind to a
      driver, the device link will prevent bazz device from ever probing.
      
      Finding and refactoring all the instances of drivers that follow case 2
      will cause a lot of code churn and it is not something that can be done
      in one shot. In some instances it might not even be possible to refactor
      them cleanly. Examples of such instances are [1] [2].
      
      This patch works around this problem and avoids all the code churn by
      simply setting the fwnode of the gpio_device and creating a stub driver
      to bind to the gpio_device. This allows all the consumers to continue
      probing when the driver follows case 2.
      
      [1] - https://lore.kernel.org/lkml/20201014191235.7f71fcb4@xhacker.debian/
      [2] - https://lore.kernel.org/lkml/e28e1f38d87c12a3c714a6573beba6e1@kernel.org/
      
      Fixes: e5904747 ("driver core: Set fw_devlink=on by default")
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
      Cc: Kever Yang <kever.yang@rock-chips.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      Signed-off-by: NSaravana Kannan <saravanak@google.com>
      Link: https://lore.kernel.org/r/20210122193600.1415639-1-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4731210c
  9. 19 1月, 2021 1 次提交
  10. 05 1月, 2021 1 次提交
  11. 12 12月, 2020 1 次提交
  12. 06 12月, 2020 1 次提交
  13. 02 12月, 2020 2 次提交
  14. 16 11月, 2020 7 次提交
  15. 05 11月, 2020 1 次提交
  16. 28 10月, 2020 2 次提交
  17. 26 10月, 2020 3 次提交
  18. 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
  19. 17 9月, 2020 1 次提交
  20. 14 9月, 2020 3 次提交
  21. 11 9月, 2020 1 次提交
  22. 12 7月, 2020 2 次提交