gpiolib: acpi: Print pin number on acpi_gpiochip_alloc_event errors
PATCH 1/1 gpiolib: acpi: Print pin number on acpi_gpiochip_alloc_event errors
Print pin number on acpi_gpiochip_alloc_event errors, to help debugging these.
--- drivers/gpio/gpiolib-acpi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpio/gpiolib-acpi.c +6 -3
@@ -230,19 +230,22 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares, desc =gpiochip_request_own_desc (chip, pin,"ACPI:Event" ,GPIO_ACTIVE_HIGH ,GPIOD_IN );if (IS_ERR (desc)) { -dev_err (chip->parent,"Failed to request GPIO\n" ); +dev_err (chip->parent, +"Failed to request GPIO for pin 0x%02X\n" , pin);return AE_ERROR ; } ret =gpiochip_lock_as_irq (chip, pin);if (ret) { -dev_err (chip->parent,"Failed to lock GPIO as interrupt\n" ); +dev_err (chip->parent, +"Failed to lock GPIO pin 0x%02X as interrupt\n" , pin); goto fail_free_desc; } irq =gpiod_to_irq (desc);if (irq <0 ) { -dev_err (chip->parent,"Failed to translate GPIO to IRQ\n" ); +dev_err (chip->parent, +"Failed to translate GPIO pin 0x%02X to IRQ\n" , pin); goto fail_unlock_irq; }
Signature · 1 line
2.23.0
Quoted 2 lines · Hans de Goede
Print pin number on
acpi_gpiochip_alloc_eventerrors, to help debugging these.
I'm not sure which one is better decimal or hex, perhaps Mika can help me, in any case
Quoted 38 lines
Signed-off-by Hans de Goede <[email protected]>--- drivers/gpio/gpiolib-acpi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpio/gpiolib-acpi.c +6
-3@@ -230,19 +230,22 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares, desc =gpiochip_request_own_desc (chip, pin,"ACPI:Event" ,GPIO_ACTIVE_HIGH ,GPIOD_IN );if (IS_ERR (desc)) { -dev_err (chip->parent,"Failed to request GPIO\n" ); +dev_err (chip->parent, +"Failed to request GPIO for pin 0x%02X\n" , pin);return AE_ERROR ; } ret =gpiochip_lock_as_irq (chip, pin);if (ret) { -dev_err (chip->parent,"Failed to lock GPIO as interrupt\n" ); +dev_err (chip->parent, +"Failed to lock GPIO pin 0x%02X as interrupt\n" , pin); goto fail_free_desc; } irq =gpiod_to_irq (desc);if (irq <0 ) { -dev_err (chip->parent,"Failed to translate GPIO to IRQ\n" ); +dev_err (chip->parent, +"Failed to translate GPIO pin 0x%02X to IRQ\n" , pin); goto fail_unlock_irq; }Signature · 1 line
2.23.0
Signature · 2 lines
With Best Regards, Andy Shevchenko
Hi,
Quoted 5 lines · Andy Shevchenko
Quoted 2 lines · Hans de Goede
Print pin number on
acpi_gpiochip_alloc_eventerrors, to help debugging these.I'm not sure which one is better decimal or hex, perhaps Mika can help me, in any case
They are listed as hex in the dis-assembled DSTD.
Regards,
Hans
Quoted 41 lines
Reviewed-by Andy Shevchenko <[email protected]>Quoted 38 lines
Signed-off-by Hans de Goede <[email protected]>--- drivers/gpio/gpiolib-acpi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpio/gpiolib-acpi.c +6
-3@@ -230,19 +230,22 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares, desc =gpiochip_request_own_desc (chip, pin,"ACPI:Event" ,GPIO_ACTIVE_HIGH ,GPIOD_IN );if (IS_ERR (desc)) { -dev_err (chip->parent,"Failed to request GPIO\n" ); +dev_err (chip->parent, +"Failed to request GPIO for pin 0x%02X\n" , pin);return AE_ERROR ; } ret =gpiochip_lock_as_irq (chip, pin);if (ret) { -dev_err (chip->parent,"Failed to lock GPIO as interrupt\n" ); +dev_err (chip->parent, +"Failed to lock GPIO pin 0x%02X as interrupt\n" , pin); goto fail_free_desc; } irq =gpiod_to_irq (desc);if (irq <0 ) { -dev_err (chip->parent,"Failed to translate GPIO to IRQ\n" ); +dev_err (chip->parent, +"Failed to translate GPIO pin 0x%02X to IRQ\n" , pin); goto fail_unlock_irq; }Signature · 1 line
2.23.0
Quoted 8 lines · Hans de Goede
Quoted 5 lines · Andy Shevchenko
Quoted 2 lines · Hans de Goede
Print pin number on
acpi_gpiochip_alloc_eventerrors, to help debugging these.I'm not sure which one is better decimal or hex, perhaps Mika can help me, in any case
They are listed as hex in the dis-assembled DSTD.
Oh, now I noticed the potential issue. The pin can be 16-bit, you pring here only for the case when we have evname. Maybe do something similar in these messages? Print event name for pin inside byte range and value otherwise?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Quoted 2 lines · Hans de Goede
Print pin number on
acpi_gpiochip_alloc_eventerrors, to help debugging these.I'm not sure which one is better decimal or hex, perhaps Mika can help me, in any case
Reviewed-by Andy Shevchenko <[email protected]>
I have to withdraw this due to potential issue found.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Hi,
Quoted 6 lines · Andy Shevchenko
Quoted 5 lines · Hans de Goede
Quoted 4 lines · Andy Shevchenko
Quoted 2 lines · Hans de Goede
Print pin number on
acpi_gpiochip_alloc_eventerrors, to help debugging these.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
I'm not sure which one is better decimal or hex, perhaps Mika can help me, in any case
They are listed as hex in the dis-assembled DSTD.
Oh, now I noticed the potential issue. The pin can be 16-bit, you pring here only for the case when we have evname. Maybe do something similar in these messages? Print event name for pin inside byte range and value otherwise?
I'm preparing a v2 now, together with another related, less cosmetic patch. I will switch to a 16 bit printf format for v2.
Regards,
Hans