Commit 5467801f1fcb ("gpio: Restrict usage of GPIO chip irq members before initialization") attempted to fix a race condition that lead to a NULL pointer, but in the process caused a regression for _AEI/_EVT declared GPIOs. This manifests in messages showing deferred probing while trying to allocate IRQs like so: amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x0000 to IRQ, err -517 amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x002C to IRQ, err -517 amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x003D to IRQ, err -517 [ .. more of the same .. ] The code for walking _AEI doesn't handle deferred probing and so this leads to non-functional GPIO interrupts. Fix this issue by moving the call to `acpi_gpiochip_request_interrupts` to occur after gc->irc.initialized is set.
Unified · Split
| @@ -1601,8 +1601,6 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, · 1600 unmodified lines | ||
| 1601 | 1601 | |
| 1602 | 1602 | gpiochip_set_irq_hooks(gc); |
| 1603 | 1603 | |
| 1604 | − acpi_gpiochip_request_interrupts(gc); | |
| 1605 | − | |
| 1606 | 1604 | /* |
| 1607 | 1605 | * Using barrier() here to prevent compiler from reordering |
| 1608 | 1606 | * gc->irq.initialized before initialization of above |
| @@ -1612,6 +1610,8 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, · 3 unmodified lines | ||
| 1612 | 1610 | |
| 1613 | 1611 | gc->irq.initialized = true; |
| 1614 | 1612 | |
| 1613 | + acpi_gpiochip_request_interrupts(gc); | |
| 1614 | + | |
| 1615 | 1615 | return 0; |
| 1616 | 1616 | } |
| 1617 | 1617 | |