]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
gpiolib: acpi: Switch to cansleep version of GPIO library call
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 13 Aug 2018 16:00:27 +0000 (19:00 +0300)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:51:59 +0000 (19:51 -0600)
commit5f5d05a47b1f998d511fb143f6da2bb44a508794
treedfdfb8f0092a30f20e0407a057805d30b10c9824
parent151ade241cb0b879bebf9e8f7b131cb9456fe374
gpiolib: acpi: Switch to cansleep version of GPIO library call

BugLink: https://bugs.launchpad.net/bugs/1836426
[ Upstream commit 993b9bc5c47fda86f8ab4e53d68c6fea5ff2764a ]

The commit ca876c7483b6

  ("gpiolib-acpi: make sure we trigger edge events at least once on boot")

added a initial value check for pin which is about to be locked as IRQ.
Unfortunately, not all GPIO drivers can do that atomically. Thus,
switch to cansleep version of the call. Otherwise we have a warning:

...
  WARNING: CPU: 2 PID: 1408 at drivers/gpio/gpiolib.c:2883 gpiod_get_value+0x46/0x50
...
  RIP: 0010:gpiod_get_value+0x46/0x50
...

The change tested on Intel Broxton with Whiskey Cove PMIC GPIO controller.

Fixes: ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events at least once on boot")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/gpio/gpiolib-acpi.c