Patch "gpiolib: acpi: Make set-debounce-timeout failures non fatal" has been added to the 5.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    gpiolib: acpi: Make set-debounce-timeout failures non fatal

to the 5.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     gpiolib-acpi-make-set-debounce-timeout-failures-non-.patch
and it can be found in the queue-5.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 89c5f75daa3cce1e1606458f30182b4aeca7b9fc
Author: Hans de Goede <hdegoede@xxxxxxxxxx>
Date:   Mon Aug 16 12:41:19 2021 +0200

    gpiolib: acpi: Make set-debounce-timeout failures non fatal
    
    [ Upstream commit cef0d022f55364d69017daeb9443bd31510ad6a2 ]
    
    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 24 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")
    Depends-on: 2e2b496cebef ("gpiolib: acpi: Extract acpi_request_own_gpiod() helper")
    Reviewed-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
    Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Acked-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
    Signed-off-by: Bartosz Golaszewski <brgl@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 411525ac4cc4..47712b6903b5 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -313,9 +313,11 @@ static struct gpio_desc *acpi_request_own_gpiod(struct gpio_chip *chip,
 
 	ret = gpio_set_debounce_timeout(desc, agpio->debounce_timeout);
 	if (ret)
-		gpiochip_free_own_desc(desc);
+		dev_warn(chip->parent,
+			 "Failed to set debounce-timeout for pin 0x%04X, err %d\n",
+			 pin, ret);
 
-	return ret ? ERR_PTR(ret) : desc;
+	return desc;
 }
 
 static bool acpi_gpio_in_ignore_list(const char *controller_in, int pin_in)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux