Skip to contentSkip to conversation

gpiolib: Forbid irqchip default trigger for ACPI enumerated devices

PATCH In review Mika Westerberg 3 participants 4 messages Sep 12, 2016 – Nov 24, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpiolib: Forbid irqchip default trigger for ACPI enumerated devices

Follow DT and forbid default trigger if the GPIO irqchip device is enumerated from ACPI. Triggering for these devices will be configured automatically from ACPI interrupt resources provided by the BIOS.

---
This is on top of Marc's patch here:

https://lkml.org/lkml/2016/9/7/121

 drivers/gpio/gpiolib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib.c +6 -1
index 5707b5d12b28..0efb67f387ea 100644
@@ -1618,13 +1618,18 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
 		of_node = gpiochip->of_node;
 #endif
 	/*
-	 * Specifying a default trigger is a terrible idea if DT is
+	 * Specifying a default trigger is a terrible idea if DT or ACPI is
 	 * used to configure the interrupts, as you may end-up with
 	 * conflicting triggers. Tell the user, and reset to NONE.
 	 */
 	if (WARN(of_node && type != IRQ_TYPE_NONE,
 		 "%s: Ignoring %d default trigger\n", of_node->full_name, type))
 		type = IRQ_TYPE_NONE;
+	if (has_acpi_companion(gpiochip->parent) && type != IRQ_TYPE_NONE) {
+		acpi_handle_warn(ACPI_HANDLE(gpiochip->parent),
+				 "Ignoring %d default trigger\n", type);
+		type = IRQ_TYPE_NONE;
+	}
 
 	gpiochip->irqchip = irqchip;
 	gpiochip->irq_handler = handler;
Signature · 1 line
2.9.3
#1 lore raw
Quoted 29 lines · Mika Westerberg

Follow DT and forbid default trigger if the GPIO irqchip device is enumerated from ACPI. Triggering for these devices will be configured automatically from ACPI interrupt resources provided by the BIOS.

---
This is on top of Marc's patch here:

https://lkml.org/lkml/2016/9/7/121

 drivers/gpio/gpiolib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib.c +1 -1
index 5707b5d12b28..0efb67f387ea 100644
@@ -1618,13 +1618,18 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
 		of_node = gpiochip->of_node;
 #endif
 	/*
-	 * Specifying a default trigger is a terrible idea if DT is
+	 * Specifying a default trigger is a terrible idea if DT or ACPI is
 	 * used to configure the interrupts, as you may end-up with
 	 * conflicting triggers. Tell the user, and reset to NONE.
 	 */
 	if (WARN(of_node && type != IRQ_TYPE_NONE,

drivers/gpio/gpiolib.c int _gpiochip_irqchip_add(struct gpio_chip *gpiochip, · line 1635

Quoted 10 lines
drivers/gpio/gpiolib.c +5 -0
 		 "%s: Ignoring %d default trigger\n", of_node->full_name, type))
 		type = IRQ_TYPE_NONE;
+	if (has_acpi_companion(gpiochip->parent) && type != IRQ_TYPE_NONE) {
+		acpi_handle_warn(ACPI_HANDLE(gpiochip->parent),
+				 "Ignoring %d default trigger\n", type);
+		type = IRQ_TYPE_NONE;
+	}
 
 	gpiochip->irqchip = irqchip;
 	gpiochip->irq_handler = handler;

Has this gone anywhere already?

Thanks,
Rafael

#2 lore raw
Quoted 37 lines · Rafael J. Wysocki
Quoted 36 lines · Mika Westerberg

Follow DT and forbid default trigger if the GPIO irqchip device is enumerated from ACPI. Triggering for these devices will be configured automatically from ACPI interrupt resources provided by the BIOS.

---
This is on top of Marc's patch here:

https://lkml.org/lkml/2016/9/7/121

 drivers/gpio/gpiolib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib.c +6 -1
index 5707b5d12b28..0efb67f387ea 100644
@@ -1618,13 +1618,18 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
 		of_node = gpiochip->of_node;
 #endif
 	/*
-	 * Specifying a default trigger is a terrible idea if DT is
+	 * Specifying a default trigger is a terrible idea if DT or ACPI is
 	 * used to configure the interrupts, as you may end-up with
 	 * conflicting triggers. Tell the user, and reset to NONE.
 	 */
 	if (WARN(of_node && type != IRQ_TYPE_NONE,
 		 "%s: Ignoring %d default trigger\n", of_node->full_name, type))
 		type = IRQ_TYPE_NONE;
+	if (has_acpi_companion(gpiochip->parent) && type != IRQ_TYPE_NONE) {
+		acpi_handle_warn(ACPI_HANDLE(gpiochip->parent),
+				 "Ignoring %d default trigger\n", type);
+		type = IRQ_TYPE_NONE;
+	}
 
Quoted 5 lines

drivers/gpio/gpiolib.c int _gpiochip_irqchip_add(struct gpio_chip *gpiochip, · line 1635

Quoted 3 lines
drivers/gpio/gpiolib.c +0 -0
 	gpiochip->irqchip = irqchip;
 	gpiochip->irq_handler = handler;

Has this gone anywhere already?

Yes, it should be in the mainline kernel with commit id 0a1e005374910180c30247386992565b05109eac.

#3 lore raw
Quoted 38 lines · Mika Westerberg
Quoted 37 lines · Rafael J. Wysocki
Quoted 36 lines · Mika Westerberg

Follow DT and forbid default trigger if the GPIO irqchip device is enumerated from ACPI. Triggering for these devices will be configured automatically from ACPI interrupt resources provided by the BIOS.

---
This is on top of Marc's patch here:

https://lkml.org/lkml/2016/9/7/121

 drivers/gpio/gpiolib.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib.c +6 -1
index 5707b5d12b28..0efb67f387ea 100644
@@ -1618,13 +1618,18 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
            of_node = gpiochip->of_node;
 #endif
    /*
-    * Specifying a default trigger is a terrible idea if DT is
+    * Specifying a default trigger is a terrible idea if DT or ACPI is
     * used to configure the interrupts, as you may end-up with
     * conflicting triggers. Tell the user, and reset to NONE.
     */
    if (WARN(of_node && type != IRQ_TYPE_NONE,
             "%s: Ignoring %d default trigger\n", of_node->full_name, type))
            type = IRQ_TYPE_NONE;
+   if (has_acpi_companion(gpiochip->parent) && type != IRQ_TYPE_NONE) {
+           acpi_handle_warn(ACPI_HANDLE(gpiochip->parent),
+                            "Ignoring %d default trigger\n", type);
+           type = IRQ_TYPE_NONE;
+   }
 
Quoted 8 lines
Quoted 5 lines

drivers/gpio/gpiolib.c int _gpiochip_irqchip_add(struct gpio_chip *gpiochip, · line 1635

Quoted 3 lines
drivers/gpio/gpiolib.c +0 -0
    gpiochip->irqchip = irqchip;
    gpiochip->irq_handler = handler;

Has this gone anywhere already?

Yes, it should be in the mainline kernel with commit id 0a1e005374910180c30247386992565b05109eac.

OK, thanks!