History

gpio: Request interrupts after IRQ is initialized

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.

Mario Limonciello committed 4 years ago

Commit 06fb4ec1 parent 4e339e51 file · +2 −2Browse files

Unified · Split

drivers/gpio/gpiolib.c+2−2
@@ -1601,8 +1601,6 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, · 1600 unmodified lines
1601 1601
1602 gpiochip_set_irq_hooks(gc);1602 gpiochip_set_irq_hooks(gc);
1603 1603
1604 acpi_gpiochip_request_interrupts(gc);
1605
1606 /*1604 /*
1607 * Using barrier() here to prevent compiler from reordering1605 * Using barrier() here to prevent compiler from reordering
1608 * gc->irq.initialized before initialization of above1606 * 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 gc->irq.initialized = true;1611 gc->irq.initialized = true;
1614 1612
1613 acpi_gpiochip_request_interrupts(gc);
1614
1615 return 0;1615 return 0;
1616}1616}
1617 1617

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t