1. 26 Feb, 2024 2 commits
    • Bartosz Golaszewski's avatar
      gpio: sim: add lockdep asserts · 11498d99
      Bartosz Golaszewski authored
      We have three functions in gpio-sim that are called with the device lock
      already held. We use the "_unlocked" suffix in their names to indicate
      that. This has proven to be confusing though as the naming convention in
      the kernel varies between using "_locked" or "_unlocked" for this
      purpose. Naming convention also doesn't enforce anything. Let's remove
      the suffix and add lockdep annotation at the top of these functions.
      
      This makes it clear the function requires a lock to be held (and which
      one specifically!) as well as results in a warning if it's not the case.
      The only place where the information is lost is the place where the
      function is called but the caller doesn't care about that information
      anyway.
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      11498d99
    • Stephen Boyd's avatar
      gpio: Add ChromeOS EC GPIO driver · f837fe1b
      Stephen Boyd authored
      The ChromeOS embedded controller (EC) supports setting the state of
      GPIOs when the system is unlocked, and getting the state of GPIOs in all
      cases. The GPIOs are on the EC itself, so the EC acts similar to a GPIO
      expander. Add a driver to get and set the GPIOs on the EC through the
      host command interface.
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      f837fe1b
  2. 20 Feb, 2024 1 commit
  3. 19 Feb, 2024 1 commit
    • Xiaolei Wang's avatar
      gpio: fix memory leak in gpiod_request_commit() · 24ba441d
      Xiaolei Wang authored
      Since commit 1f2bcb8c ("gpio: protect the descriptor label with
      SRCU"), desc_set_label() already allocates memory for the label, so there
      is no need to allocate it again. If we do, we leak it.
      
      unreferenced object 0xffff0000c3e4d0c0 (size 32):
        comm "kworker/u16:4", pid 60, jiffies 4294894555
        hex dump (first 32 bytes):
          72 65 67 75 6c 61 74 6f 72 2d 63 61 6e 32 2d 73  regulator-can2-s
          74 62 79 00 00 00 ff ff ff ff ff ff eb db ff ff  tby.............
        backtrace (crc 2c3a0350):
          [<00000000e93c5cf4>] kmemleak_alloc+0x34/0x40
          [<0000000097a2657f>] __kmalloc_node_track_caller+0x2c4/0x524
          [<000000000dd1c057>] kstrdup+0x4c/0x98
          [<00000000b513a96a>] kstrdup_const+0x34/0x40
          [<000000008a7f0feb>] gpiod_request_commit+0xdc/0x358
          [<00000000fc71ad64>] gpiod_request+0xd8/0x204
          [<00000000fa24b091>] gpiod_find_and_request+0x170/0x780
          [<0000000086ecf92d>] gpiod_get_index+0x70/0xe0
          [<000000004aef97f9>] gpiod_get_optional+0x18/0x30
          [<00000000312f1b25>] reg_fixed_voltage_probe+0x58c/0xad8
          [<00000000e6f47635>] platform_probe+0xc4/0x198
          [<00000000cf78fbdb>] really_probe+0x204/0x5a8
          [<00000000e28d05ec>] __driver_probe_device+0x158/0x2c4
          [<00000000e4fe452b>] driver_probe_device+0x60/0x18c
          [<00000000479fcf5d>] __device_attach_driver+0x168/0x208
          [<000000007d389f38>] bus_for_each_drv+0x104/0x190
      
      Fixes: 1f2bcb8c ("gpio: protect the descriptor label with SRCU")
      Signed-off-by: default avatarXiaolei Wang <xiaolei.wang@windriver.com>
      [Bartosz: tweaked the commit message]
      Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
      24ba441d
  4. 17 Feb, 2024 1 commit
  5. 16 Feb, 2024 1 commit
  6. 15 Feb, 2024 6 commits
  7. 14 Feb, 2024 3 commits
  8. 12 Feb, 2024 25 commits