1. 19 4月, 2022 1 次提交
  2. 16 3月, 2022 1 次提交
  3. 08 3月, 2022 1 次提交
  4. 07 3月, 2022 2 次提交
  5. 24 2月, 2022 1 次提交
    • S
      gpio: Return EPROBE_DEFER if gc->to_irq is NULL · ae42f928
      Shreeya Patel 提交于
      We are racing the registering of .to_irq when probing the
      i2c driver. This results in random failure of touchscreen
      devices.
      
      Following explains the race condition better.
      
      [gpio driver] gpio driver registers gpio chip
      [gpio consumer] gpio is acquired
      [gpio consumer] gpiod_to_irq() fails with -ENXIO
      [gpio driver] gpio driver registers irqchip
      gpiod_to_irq works at this point, but -ENXIO is fatal
      
      We could see the following errors in dmesg logs when gc->to_irq is NULL
      
      [2.101857] i2c_hid i2c-FTS3528:00: HID over i2c has not been provided an Int IRQ
      [2.101953] i2c_hid: probe of i2c-FTS3528:00 failed with error -22
      
      To avoid this situation, defer probing until to_irq is registered.
      Returning -EPROBE_DEFER would be the first step towards avoiding
      the failure of devices due to the race in registration of .to_irq.
      Final solution to this issue would be to avoid using gc irq members
      until they are fully initialized.
      
      This issue has been reported many times in past and people have been
      using workarounds like changing the pinctrl_amd to built-in instead
      of loading it as a module or by adding a softdep for pinctrl_amd into
      the config file.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209413Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NShreeya Patel <shreeya.patel@collabora.com>
      Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
      ae42f928
  6. 08 2月, 2022 3 次提交
  7. 17 12月, 2021 3 次提交
  8. 06 12月, 2021 2 次提交
  9. 03 12月, 2021 1 次提交
  10. 27 10月, 2021 1 次提交
  11. 30 7月, 2021 1 次提交
  12. 28 5月, 2021 2 次提交
  13. 12 5月, 2021 1 次提交
  14. 26 3月, 2021 5 次提交
  15. 16 3月, 2021 1 次提交
  16. 12 3月, 2021 1 次提交
  17. 08 3月, 2021 3 次提交
  18. 09 2月, 2021 1 次提交
  19. 01 2月, 2021 1 次提交
  20. 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
  21. 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
  22. 19 1月, 2021 1 次提交
  23. 05 1月, 2021 1 次提交
  24. 12 12月, 2020 1 次提交
  25. 06 12月, 2020 1 次提交
  26. 02 12月, 2020 2 次提交