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
16011601
16021602 gpiochip_set_irq_hooks(gc);
16031603
1604− acpi_gpiochip_request_interrupts(gc);
1605−
16061604 /*
16071605 * Using barrier() here to prevent compiler from reordering
16081606 * gc->irq.initialized before initialization of above
@@ -1612,6 +1610,8 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, · 3 unmodified lines
16121610
16131611 gc->irq.initialized = true;
16141612
1613+ acpi_gpiochip_request_interrupts(gc);
1614+
16151615 return 0;
16161616 }
16171617

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