Thread (8 messages) 8 messages, 5 authors, 2021-09-22

Re: [PATCH regression fix] gpiolib: acpi: Make set-debounce-timeout failures non fatal

From: Hans de Goede <hidden>
Date: 2021-09-21 18:42:49
Also in: linux-gpio

Hi,

On 9/21/21 8:28 PM, Linus Walleij wrote:
On Mon, Aug 16, 2021 at 11:39 AM Hans de Goede [off-list ref] wrote:
quoted
Commit 8dcb7a15a585 ("gpiolib: acpi: Take into account debounce settings")
made the gpiolib-acpi code call gpio_set_debounce_timeout() when requesting
GPIOs.

This in itself is fine, but it also made gpio_set_debounce_timeout()
errors fatal, causing the requesting of the GPIO to fail. This is causing
regressions. E.g. on a HP ElitePad 1000 G2 various _AEI specified GPIO
ACPI event sources specify a debouncy timeout of 20 ms, but the
pinctrl-baytrail.c only supports certain fixed values, the closest
ones being 12 or 14 ms and pinctrl-baytrail.c responds with -EINVAL
when specified a value which is not one of the fixed values.

This is causing the acpi_request_own_gpiod() call to fail for 3
ACPI event sources on the HP ElitePad 1000 G2, which in turn is causing
e.g. the battery charging vs discharging status to never get updated,
even though a charger has been plugged-in or unplugged.

Make gpio_set_debounce_timeout() errors non fatal, warning about the
failure instead, to fix this regression.

Note we should probably also fix various pinctrl drivers to just
pick the first bigger discrete value rather then returning -EINVAL but
this will need to be done on a per driver basis, where as this fix
at least gets us back to where things were before and thus restores
functionality on devices where this was lost due to
gpio_set_debounce_timeout() errors.

Fixes: 8dcb7a15a585 ("gpiolib: acpi: Take into account debounce settings")
Signed-off-by: Hans de Goede <redacted>
Reviewed-by: Linus Walleij <redacted>

Bartosz will pick this up I think, I'm a bit off duty with GPIO right now.
Added Bartosz to the To: list, to make sure that he actually
sees this. I somehow did not add him in the To/Cc when sending out
the patch, sorry about that.

Regards,

Hans
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help