Files
linux/drivers/gpio
Hans de Goede 23572a68e8 gpiolib-acpi: Only defer request_irq for GpioInt ACPI event handlers
commit e59f5e08ec upstream.

Commit 78d3a92edb ("gpiolib-acpi: Register GpioInt ACPI event handlers
from a late_initcall") deferred the entire acpi_gpiochip_request_interrupt
call for each event resource.

This means it also delays the gpiochip_request_own_desc(..., "ACPI:Event")
call. This is a problem if some AML code reads the GPIO pin before we
run the deferred acpi_gpiochip_request_interrupt, because in that case
acpi_gpio_adr_space_handler() will already have called
gpiochip_request_own_desc(..., "ACPI:OpRegion") causing the call from
acpi_gpiochip_request_interrupt to fail with -EBUSY and we will fail to
register an event handler.

acpi_gpio_adr_space_handler is prepared for acpi_gpiochip_request_interrupt
already having claimed the pin, but the other way around does not work.

One example of a problem this causes, is the event handler for the OTG
ID pin on a Prowise PT301 tablet not registering, keeping the port stuck
in whatever mode it was in during boot and e.g. only allowing charging
after a reboot.

This commit fixes this by only deferring the request_irq call and the
initial run of edge-triggered IRQs instead of deferring all of
acpi_gpiochip_request_interrupt.

Cc: stable@vger.kernel.org
Fixes: 78d3a92edb ("gpiolib-acpi: Register GpioInt ACPI event ...")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-29 13:39:09 +01:00
..
2017-08-14 15:01:13 +02:00
2016-03-30 10:38:51 +02:00
2018-05-16 10:10:26 +02:00
2016-01-05 11:21:05 +01:00
2016-02-16 00:19:53 +01:00
2017-05-22 17:18:19 +02:00
2016-12-30 09:18:10 +01:00
2017-08-31 13:57:57 +02:00
2016-09-13 10:35:56 +02:00
2016-12-30 09:18:10 +01:00
2017-08-14 15:03:39 +02:00
2017-03-16 21:52:10 +01:00
2017-08-23 09:21:54 +02:00