Failed IRQ assignment for INT0002 on Braswell
Hi, Hans.
v4.13 kernel introduced new fancy warning in the dmesg:
===
kernel: acpi INT0002:00: Device [GPED] is in always present list
kernel: genirq: Flags mismatch irq 9. 00010084 (INT0002) vs. 00002080 (acpi)
kernel: INT0002 Virtual GPIO INT0002:00: Error requesting IRQ 9: -16
kernel: INT0002 Virtual GPIO: probe of INT0002:00 failed with error -16
===
Looking at git log, I've found that this driver was indeed introduced in v4.13 by the following commit:
===
commit 63dada87f7ef7d4a536765c816fbbe7c4b9f3c85
Author: Hans de Goede <[email protected]> Date: Mon Jun 12 22:55:46 2017 +0200
platform/x86: Add driver for ACPI INT0002 Virtual GPIO device
===
I've checked DSDT disassembly for this device, and here is relevant snippet [1]. The only thing I currently understand there is that IRQ 9 is hard coded (line 64), but I'm not sure where those flags come from.
The hardware in J3710 CPU on ASRock J3710-ITX motherboard.
Next, I've found that you also faced this warning and posted some RFC patch [2], but unfortunately I do not see what that discussion ended up with.
It is not that I really need GPIO on this board, but it would be nice to get rid of this warning. Could you please point me to a possible fix or a way for further investigation?
Thanks.
Regards,
Oleksandr
[1] https://gist.github.com/2c69d6e4eb4b5c256601847a9c6aec45
[2] https://patchwork.kernel.org/patch/9671783/
Hi,
Quoted 26 lines · Oleksandr Natalenko
Hi, Hans.
v4.13 kernel introduced new fancy warning in the dmesg:
===
kernel: acpi INT0002:00: Device [GPED] is in always present list
kernel: genirq: Flags mismatch irq 9. 00010084 (INT0002) vs. 00002080 (acpi)
kernel: INT0002 Virtual GPIO INT0002:00: Error requesting IRQ 9: -16
kernel: INT0002 Virtual GPIO: probe of INT0002:00 failed with error -16
===Looking at git log, I've found that this driver was indeed introduced in v4.13 by the following commit:
===
commit63dada87f7ef7d4a536765c816fbbe7c4b9f3c85Author: Hans de Goede <[email protected]> Date: Mon Jun 12 22:55:46 2017 +0200platform/x86: Add driver for ACPI INT0002 Virtual GPIO device
===I've checked DSDT disassembly for this device, and here is relevant snippet [1]. The only thing I currently understand there is that IRQ 9 is hard coded (line 64), but I'm not sure where those flags come from.
Quoted 8 lines
The hardware in J3710 CPU on ASRock J3710-ITX motherboard.
Next, I've found that you also faced this warning and posted some RFC patch [2], but unfortunately I do not see what that discussion ended up with.
It is not that I really need GPIO on this board, but it would be nice to get rid of this warning. Could you please point me to a possible fix or a way for further investigation?
This should be fixed by:
Which is in 4.13, but the trigger-type does not seem to be the problem in your case, the problem likely is the ONESHOT flag:
#define IRQF_ONESHOT 0x00002000
Which appears to be set in the flags for the acpi irq handler:
Quoted 1 line
kernel: genirq: Flags mismatch irq 9. 00010084 (INT0002) vs. 00002080 (acpi)
But that irq is requested here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/acpi/osl.c#n570
:
if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) {
printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq);
...And IRQF_ONESHOT is not passed, so I do not understand where the 00002000 in the acpi irq handler flags is coming from ...
Regards,
Hans
Hi, Hans.
Quoted 21 lines · On středa 22. listopadu 2017 11:48:50 CET Hans de Goede wrote:
/* snip */
This should be fixed by:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/ke
rnel/irq?id=382bd4de61827dbaaf5fb4fb7b1f4be4a86505e7Which is in 4.13, but the trigger-type does not seem to be the problem in your case, the problem likely is the ONESHOT flag:
#define
IRQF_ONESHOT0x00002000Which appears to be set in the flags for the acpi irq handler:
Quoted 2 lines
kernel: genirq: Flags mismatch irq 9. 00010084 (INT0002) vs. 00002080 (acpi)
But that irq is requested here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/driv
ers/acpi/osl.c#n570
Quoted 6 lines
if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) { printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq); ...And
IRQF_ONESHOTis not passed, so I do not understand where the 00002000 in the acpi irq handler flags is coming from ...
Well, looks like I know where this flag comes from. I boot this machine with "threadirqs", and IRQF_ONESHOT description says:
===
52 * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler
finished.
53 * Used by threaded interrupts which need to keep the 54 * irq line disabled until the threaded handler has been
run.
===
If I boot the machine without "threadirqs", looks like the device is set up okay. The only message I get in the kernel log is:
===
kernel: acpi INT0002:00: Device [GPED] is in always present list
===
Grepping for IRQ 9:
===
kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
kernel: ACPI: IRQ9 used by override.
===
and 9th interrupt shows this device:
===
9: 0 0 0 0 IO-APIC 9-fasteoi
acpi, INT0002
===
Any idea why "threadirqs" makes this fail?
Thanks.
Regards,
Oleksandr
Hi,
Quoted 56 lines · Oleksandr Natalenko
Hi, Hans.
Quoted 21 lines · On středa 22. listopadu 2017 11:48:50 CET Hans de Goede wrote:
/* snip */
This should be fixed by:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/ke
rnel/irq?id=382bd4de61827dbaaf5fb4fb7b1f4be4a86505e7Which is in 4.13, but the trigger-type does not seem to be the problem in your case, the problem likely is the ONESHOT flag:
#define
IRQF_ONESHOT0x00002000Which appears to be set in the flags for the acpi irq handler:
Quoted 2 lines
kernel: genirq: Flags mismatch irq 9. 00010084 (INT0002) vs. 00002080 (acpi)
But that irq is requested here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/driv
ers/acpi/osl.c#n570Quoted 6 lines
if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) { printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq); ...And
IRQF_ONESHOTis not passed, so I do not understand where the 00002000 in the acpi irq handler flags is coming from ...Well, looks like I know where this flag comes from. I boot this machine with "threadirqs", and
IRQF_ONESHOTdescription says:===
52 *IRQF_ONESHOT- Interrupt is not reenabled after the hardirq handler
finished.53 * Used by threaded interrupts which need to keep the 54 * irq line disabled until the threaded handler has beenrun.
===If I boot the machine without "threadirqs", looks like the device is set up okay. The only message I get in the kernel log is:
===
kernel: acpi INT0002:00: Device [GPED] is in always present list
===Grepping for IRQ 9:
===
kernel: ACPI:INT_SRC_OVR(bus 0bus_irq9global_irq9 high level)
kernel: ACPI: IRQ9 used by override.
===
Quoted 8 lines
and 9th interrupt shows this device:
===
9: 0 0 0 0 IO-APIC 9-fasteoi
acpi, INT0002
===Any idea why "threadirqs" makes this fail?
Yes, I think this is caused by the int0002 vgpio driver unnecessarily passing the IRQF_NO_THREAD flag, attached is a patch which should fix this, can you give this a try ?
Regards,
Hans
From a68410ecefc73b538f8123c59bd6d2aade4600ba Mon Sep 17 00:00:00 2001
From: Hans de Goede <[email protected]>
Date: Wed, 22 Nov 2017 16:36:05 +0100
Subject: [PATCH v2] platform/x86: intel_int0002_vgpio: Remove IRQF_NO_THREAD
irq flag
Remove the IRQF_NO_THREAD irq flag, there is no need for it and it breaks irq-sharing with the "acpi" irq when passing "threadirqs" on the kernel cmdline, as the acpi/osl.c code does not pass IRQF_NO_THREAD.
--- drivers/platform/x86/intel_int0002_vgpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel_int0002_vgpio.c +1 -1
@@ -180,7 +180,7 @@ static int int0002_probe(struct platform_device *pdev)* to gpiochip_set_chained_irqchip, because the irq is shared. */ ret =devm_request_irq (dev, irq, int0002_irq, -IRQF_SHARED |IRQF_NO_THREAD ,"INT0002" , chip); +IRQF_SHARED ,"INT0002" , chip);if (ret) {dev_err (dev,"Error requesting IRQ %d: %d\n" , irq, ret);return ret;
Signature · 1 line
2.14.3
Hi, Hans.
With this patch applied the warning is not emitted anymore with threadirqs enabled, and relevant kthread (irq/9-INT0002) is created.
Feel free to add Reported-by/Tested-by from me once you do a submission.
Thanks.
Regards,
Oleksandr
Quoted 84 lines · On středa 22. listopadu 2017 16:50:33 CET Hans de Goede wrote:
Hi,
Quoted 65 lines · Oleksandr Natalenko
Hi, Hans.
Quoted 20 lines · On středa 22. listopadu 2017 11:48:50 CET Hans de Goede wrote:
/* snip */
This should be fixed by:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit
/ke rnel/irq?id=382bd4de61827dbaaf5fb4fb7b1f4be4a86505e7Which is in 4.13, but the trigger-type does not seem to be the problem in your case, the problem likely is the ONESHOT flag:
#define
IRQF_ONESHOT0x00002000Which appears to be set in the flags for the acpi irq handler:
Quoted 2 lines
kernel: genirq: Flags mismatch irq 9. 00010084 (INT0002) vs. 00002080 (acpi)
But that irq is requested here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/d
riv ers/acpi/osl.c#n570Quoted 7 lines
if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) { printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq); ...And
IRQF_ONESHOTis not passed, so I do not understand where the 00002000 in the acpi irq handler flags is coming from ...Well, looks like I know where this flag comes from. I boot this machine with "threadirqs", and
IRQF_ONESHOTdescription says:===
52 *
IRQF_ONESHOT- Interrupt is not reenabled after the hardirq handlerfinished.
53 * Used by threaded interrupts which need to keep the 54 * irq line disabled until the threaded handler hasbeen
run.
===If I boot the machine without "threadirqs", looks like the device is set up
okay. The only message I get in the kernel log is:===
kernel: acpi INT0002:00: Device [GPED] is in always present list
===Grepping for IRQ 9:
===
kernel: ACPI:INT_SRC_OVR(bus 0bus_irq9global_irq9 high level)
kernel: ACPI: IRQ9 used by override.
===and 9th interrupt shows this device:
Quoted 8 lines
===
9: 0 0 0 0 IO-APIC 9-fasteoi
acpi, INT0002
===Any idea why "threadirqs" makes this fail?
Yes, I think this is caused by the int0002 vgpio driver unnecessarily passing the
IRQF_NO_THREADflag, attached is a patch which should fix this, can you give this a try ?Regards,
Hans
Quoted 7 lines · Oleksandr Natalenko
Hi, Hans.
With this patch applied the warning is not emitted anymore with threadirqs enabled, and relevant kthread (irq/9-INT0002) is created.
Feel free to add Reported-by/Tested-by from me once you do a submission.
First of all, please stop top-posting.
Second, we are using patchwork which can automatically add tags based on given in followup emails.
So, if you wish to see your tag in the commit message at the end, please, send a reply with
Reported-by:
Tested-by:
tags.
Thanks.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Oleksandr Natalenko
Tested-byQuoted 17 lines · On čtvrtek 23. listopadu 2017 22:08:29 CET Andy Shevchenko wrote:
On Wed, Nov 22, 2017 at 8:13 PM, Oleksandr Natalenko
Quoted 6 lines · <[email protected]> wrote:
Hi, Hans.
With this patch applied the warning is not emitted anymore with threadirqs enabled, and relevant kthread (irq/9-INT0002) is created.
Feel free to add Reported-by/Tested-by from me once you do a submission.
First of all, please stop top-posting.
Second, we are using patchwork which can automatically add tags based on given in followup emails.
So, if you wish to see your tag in the commit message at the end, please, send a reply with
Quoted 6 lines
Reported-by:
Tested-by:tags.
Thanks.
Right.
Quoted 21 lines · Oleksandr Natalenko
Quoted 20 lines · On čtvrtek 23. listopadu 2017 22:08:29 CET Andy Shevchenko wrote:
On Wed, Nov 22, 2017 at 8:13 PM, Oleksandr Natalenko
Quoted 6 lines · <[email protected]> wrote:
Hi, Hans.
With this patch applied the warning is not emitted anymore with threadirqs enabled, and relevant kthread (irq/9-INT0002) is created.
Feel free to add Reported-by/Tested-by from me once you do a submission.
First of all, please stop top-posting.
Second, we are using patchwork which can automatically add tags based on given in followup emails.
So, if you wish to see your tag in the commit message at the end, please, send a reply withReported-by:
Tested-by:
Quoted 8 lines
Quoted 3 lines
tags.
Thanks.
Right.
Reported-by Oleksandr Natalenko <[email protected]>Tested-by Oleksandr Natalenko <[email protected]>
Pushed to my review and testing queue, thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko