gpio: acpi: Skip _AEI entries without a handler rather then aborting the scan
diff mbox

Message ID 20170623072613.3768-1-hdegoede@redhat.com
State New
Headers show

Commit Message

Hans de Goede June 23, 2017, 7:26 a.m. UTC
acpi_walk_resources will stop as soon as the callback passed in returns
an error status. On a x86 tablet I have the first GpioInt in the _AEI
resource list has no handler defined in the DSDT, causing
acpi_walk_resources to abort scanning the rest of the resource list,
which does define valid ACPI GPIO events.

This commit changes the return for not finding a handler from
AE_BAD_PARAMETER to AE_OK so that the rest of the resource list will
get scanned normally in case of missing event handlers.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpio/gpiolib-acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mika Westerberg June 26, 2017, 4:08 p.m. UTC | #1
On Fri, Jun 23, 2017 at 09:26:13AM +0200, Hans de Goede wrote:
> acpi_walk_resources will stop as soon as the callback passed in returns
> an error status. On a x86 tablet I have the first GpioInt in the _AEI
> resource list has no handler defined in the DSDT, causing
> acpi_walk_resources to abort scanning the rest of the resource list,
> which does define valid ACPI GPIO events.
> 
> This commit changes the return for not finding a handler from
> AE_BAD_PARAMETER to AE_OK so that the rest of the resource list will
> get scanned normally in case of missing event handlers.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Shevchenko June 27, 2017, 9:12 a.m. UTC | #2
On Mon, 2017-06-26 at 19:08 +0300, Mika Westerberg wrote:
> On Fri, Jun 23, 2017 at 09:26:13AM +0200, Hans de Goede wrote:
> > acpi_walk_resources will stop as soon as the callback passed in
> > returns
> > an error status. On a x86 tablet I have the first GpioInt in the
> > _AEI
> > resource list has no handler defined in the DSDT, causing
> > acpi_walk_resources to abort scanning the rest of the resource list,
> > which does define valid ACPI GPIO events.
> > 
> > This commit changes the return for not finding a handler from
> > AE_BAD_PARAMETER to AE_OK so that the rest of the resource list will
> > get scanned normally in case of missing event handlers.
> > 
> > Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> 
> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

(based on private discussion with Mika)
Linus Walleij June 29, 2017, 12:55 p.m. UTC | #3
On Fri, Jun 23, 2017 at 9:26 AM, Hans de Goede <hdegoede@redhat.com> wrote:

> acpi_walk_resources will stop as soon as the callback passed in returns
> an error status. On a x86 tablet I have the first GpioInt in the _AEI
> resource list has no handler defined in the DSDT, causing
> acpi_walk_resources to abort scanning the rest of the resource list,
> which does define valid ACPI GPIO events.
>
> This commit changes the return for not finding a handler from
> AE_BAD_PARAMETER to AE_OK so that the rest of the resource list will
> get scanned normally in case of missing event handlers.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Patch applied for fixes with the ACKs.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 5b77248666fa..fd53e9ada7dd 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -201,7 +201,7 @@  static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
 			handler = acpi_gpio_irq_handler_evt;
 	}
 	if (!handler)
-		return AE_BAD_PARAMETER;
+		return AE_OK;
 
 	pin = acpi_gpiochip_pin_to_gpio_offset(chip->gpiodev, pin);
 	if (pin < 0)