diff mbox series

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

Message ID 20240210110149.12803-1-hdegoede@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Hans de Goede
Headers show
Series platform/x86: intel: int0002_vgpio: Pass IRQF_ONESHOT to request_irq() | expand

Commit Message

Hans de Goede Feb. 10, 2024, 11:01 a.m. UTC
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")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/intel/int0002_vgpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Feb. 10, 2024, 3:06 p.m. UTC | #1
On Sat, Feb 10, 2024 at 1:01 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> 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.
Hans de Goede Feb. 12, 2024, 9:37 a.m. UTC | #2
Hi,

On 2/10/24 16:06, Andy Shevchenko wrote:
> On Sat, Feb 10, 2024 at 1:01 PM Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> 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.

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
Hans de Goede Feb. 19, 2024, 11:37 a.m. UTC | #3
Hi,

On 2/10/24 12:01, Hans de Goede wrote:
> 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")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

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

Regards,

Hans



> ---
>  drivers/platform/x86/intel/int0002_vgpio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/intel/int0002_vgpio.c b/drivers/platform/x86/intel/int0002_vgpio.c
> index b6708bab7c53..527d8fbc7cc1 100644
> --- a/drivers/platform/x86/intel/int0002_vgpio.c
> +++ b/drivers/platform/x86/intel/int0002_vgpio.c
> @@ -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;
diff mbox series

Patch

diff --git a/drivers/platform/x86/intel/int0002_vgpio.c b/drivers/platform/x86/intel/int0002_vgpio.c
index b6708bab7c53..527d8fbc7cc1 100644
--- a/drivers/platform/x86/intel/int0002_vgpio.c
+++ b/drivers/platform/x86/intel/int0002_vgpio.c
@@ -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;