All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: acpi: Skip _AEI entries without a handler rather then aborting the scan
@ 2017-06-23  7:26 Hans de Goede
  2017-06-26 16:08 ` Mika Westerberg
  2017-06-29 12:55 ` Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Hans de Goede @ 2017-06-23  7:26 UTC (permalink / raw)
  To: Mika Westerberg, Heikki Krogerus, Linus Walleij
  Cc: Hans de Goede, Andy Shevchenko, linux-gpio

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(-)

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)
-- 
2.13.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio: acpi: Skip _AEI entries without a handler rather then aborting the scan
  2017-06-23  7:26 [PATCH] gpio: acpi: Skip _AEI entries without a handler rather then aborting the scan Hans de Goede
@ 2017-06-26 16:08 ` Mika Westerberg
  2017-06-27  9:12   ` Andy Shevchenko
  2017-06-29 12:55 ` Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Mika Westerberg @ 2017-06-26 16:08 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Heikki Krogerus, Linus Walleij, Andy Shevchenko, linux-gpio

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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio: acpi: Skip _AEI entries without a handler rather then aborting the scan
  2017-06-26 16:08 ` Mika Westerberg
@ 2017-06-27  9:12   ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2017-06-27  9:12 UTC (permalink / raw)
  To: Mika Westerberg, Hans de Goede; +Cc: Heikki Krogerus, Linus Walleij, linux-gpio

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)

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio: acpi: Skip _AEI entries without a handler rather then aborting the scan
  2017-06-23  7:26 [PATCH] gpio: acpi: Skip _AEI entries without a handler rather then aborting the scan Hans de Goede
  2017-06-26 16:08 ` Mika Westerberg
@ 2017-06-29 12:55 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2017-06-29 12:55 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Mika Westerberg, Heikki Krogerus, Andy Shevchenko, linux-gpio

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-29 12:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-23  7:26 [PATCH] gpio: acpi: Skip _AEI entries without a handler rather then aborting the scan Hans de Goede
2017-06-26 16:08 ` Mika Westerberg
2017-06-27  9:12   ` Andy Shevchenko
2017-06-29 12:55 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.