Skip to contentSkip to conversation

platform/x86: intel: int0002_vgpio: Pass IRQF_ONESHOT to request_irq()

PATCH In review Hans de Goede 2 participants 4 messages Feb 10, 2024 – Feb 19, 2024 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: intel: int0002_vgpio: Pass IRQF_ONESHOT to request_irq()

Since commit 7a36b901a6eb ("ACPI: OSL: Use a threaded interrupt handler for SCI") the ACPI OSL code passes IRQF_ONESHOT when requesting the SCI.

Since the INT0002 GPIO is typically shared with the ACPI SCI the INT0002 driver must pass the same flags.

This fixes the INT0002 driver failing to probe due to following error + as well as removing the backtrace that follows this error:

"genirq: Flags mismatch irq 9. 00000084 (INT0002) vs. 00002080 (acpi)"

Fixes 7a36b901a6eb ("ACPI: OSL: Use a threaded interrupt handler for SCI")
---
 drivers/platform/x86/intel/int0002_vgpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel/int0002_vgpio.c +1 -1
index b6708bab7c53..527d8fbc7cc1 100644
@@ -196,7 +196,7 @@ static int int0002_probe(struct platform_device *pdev)
 	 * IRQs into gpiolib.
 	 */
 	ret = devm_request_irq(dev, irq, int0002_irq,
-			       IRQF_SHARED, "INT0002", chip);
+			       IRQF_ONESHOT | IRQF_SHARED, "INT0002", chip);
 	if (ret) {
 		dev_err(dev, "Error requesting IRQ %d: %d\n", irq, ret);
 		return ret;
Signature · 1 line
2.43.0
#1 lore raw
Quoted 11 lines · Hans de Goede

Since commit 7a36b901a6eb ("ACPI: OSL: Use a threaded interrupt handler for SCI") the ACPI OSL code passes IRQF_ONESHOT when requesting the SCI.

Since the INT0002 GPIO is typically shared with the ACPI SCI the INT0002 driver must pass the same flags.

This fixes the INT0002 driver failing to probe due to following error + as well as removing the backtrace that follows this error:

"genirq: Flags mismatch irq 9. 00000084 (INT0002) vs. 00002080 (acpi)"

While this seems the correct fix, I'm wondering why this driver can't instead subscribe to a GPE event. See how gpio-sch does this.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw

Hi,

Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Hans de Goede

Since commit 7a36b901a6eb ("ACPI: OSL: Use a threaded interrupt handler for SCI") the ACPI OSL code passes IRQF_ONESHOT when requesting the SCI.

Since the INT0002 GPIO is typically shared with the ACPI SCI the INT0002 driver must pass the same flags.

Quoted 7 lines
Quoted 4 lines

This fixes the INT0002 driver failing to probe due to following error + as well as removing the backtrace that follows this error:

"genirq: Flags mismatch irq 9. 00000084 (INT0002) vs. 00002080 (acpi)"

While this seems the correct fix, I'm wondering why this driver can't instead subscribe to a GPE event. See how gpio-sch does this.

This is modelled in ACPI as a separate device with its own IRQ, so we are just following how this is modelled in ACPI here.

And IIRC I think not all BYT/CHT devices which use this driver hac a SCI defined in their ACPI tables and without a SCI there are no GPE events.

Regards,

Hans

#3 lore raw
In reply to Hans de Goede

Hi,

Quoted 6 lines · Hans de Goede

Since commit 7a36b901a6eb ("ACPI: OSL: Use a threaded interrupt handler for SCI") the ACPI OSL code passes IRQF_ONESHOT when requesting the SCI.

Since the INT0002 GPIO is typically shared with the ACPI SCI the INT0002 driver must pass the same flags.

Quoted 7 lines

This fixes the INT0002 driver failing to probe due to following error + as well as removing the backtrace that follows this error:

"genirq: Flags mismatch irq 9. 00000084 (INT0002) vs. 00002080 (acpi)"

Fixes 7a36b901a6eb ("ACPI: OSL: Use a threaded interrupt handler for SCI")

I've added this to my review-hans (soon to be fixes) branch now.

Regards,

Hans

Quoted 17 lines
---
 drivers/platform/x86/intel/int0002_vgpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel/int0002_vgpio.c +1 -1
index b6708bab7c53..527d8fbc7cc1 100644
@@ -196,7 +196,7 @@ static int int0002_probe(struct platform_device *pdev)
 	 * IRQs into gpiolib.
 	 */
 	ret = devm_request_irq(dev, irq, int0002_irq,
-			       IRQF_SHARED, "INT0002", chip);
+			       IRQF_ONESHOT | IRQF_SHARED, "INT0002", chip);
 	if (ret) {
 		dev_err(dev, "Error requesting IRQ %d: %d\n", irq, ret);
 		return ret;