pinctrl: baytrail: Set IRQCHIP_SET_TYPE_MASKED flag on the irqchip
Subsystems (4)
PATCH 1/1 pinctrl: baytrail: Set IRQCHIP_SET_TYPE_MASKED flag on the irqchip
The byt_irq_type function ends with the IRQ masked, this means that calls to irq_set_irq_type() while the IRQ is enabled end up masking it, which is wrong. Add the IRQCHIP_SET_TYPE_MASKED flag to fix this.
This will make the IRQ core call mask() + unmask() on the IRQ around a set_type() call when the IRQ is enabled at the type of the call.
Note in practice irq_set_irq_type() getting called while the IRQ is enabled almost never happens. I hit this with a buggy DSDT where a wrongly active (_STA returns 0xf) I2C ACPI devices point to an IRQ already in use by an _AEI handler, leading to the irq_set_irq_type() call in acpi_dev_gpio_irq_get_by() getting called while the IRQ is enabled.
--- drivers/pinctrl/intel/pinctrl-baytrail.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-baytrail.c +2 -1
@@ -1554,7 +1554,8 @@ static int byt_gpio_probe(struct intel_pinctrl *vg) vg->irqchip.irq_mask = byt_irq_mask, vg->irqchip.irq_unmask = byt_irq_unmask, vg->irqchip.irq_set_type = byt_irq_type, - vg->irqchip.flags =IRQCHIP_SKIP_SET_WAKE , + vg->irqchip.flags =IRQCHIP_SKIP_SET_WAKE | +IRQCHIP_SET_TYPE_MASKED , girq = &gc->irq; girq->chip = &vg->irqchip;
Signature · 1 line
2.33.1
Quoted 7 lines · Hans de Goede
The
byt_irq_typefunction ends with the IRQ masked, this means that calls toirq_set_irq_type()while the IRQ is enabled end up masking it, which is wrong. Add theIRQCHIP_SET_TYPE_MASKEDflag to fix this.This will make the IRQ core call
mask()+unmask()on the IRQ around aset_type()call when the IRQ is enabled at the type of the call.
Quoted 7 lines
Note in practice
irq_set_irq_type()getting called while the IRQ is enabled almost never happens. I hit this with a buggy DSDT where a wrongly active (_STAreturns0xf) I2C ACPI devices point to an IRQ already in use by an_AEIhandler, leading to theirq_set_irq_type()call inacpi_dev_gpio_irq_get_by()getting called while the IRQ is enabled.Signed-off-by Hans de Goede <[email protected]>
Quoted 14 lines · Mika Westerberg
Quoted 13 lines · Hans de Goede
The
byt_irq_typefunction ends with the IRQ masked, this means that calls toirq_set_irq_type()while the IRQ is enabled end up masking it, which is wrong. Add theIRQCHIP_SET_TYPE_MASKEDflag to fix this.This will make the IRQ core call
mask()+unmask()on the IRQ around aset_type()call when the IRQ is enabled at the type of the call.Note in practice
irq_set_irq_type()getting called while the IRQ is enabled almost never happens. I hit this with a buggy DSDT where a wrongly active (_STAreturns0xf) I2C ACPI devices point to an IRQ already in use by an_AEIhandler, leading to theirq_set_irq_type()call inacpi_dev_gpio_irq_get_by()getting called while the IRQ is enabled.
Quoted 3 lines
Quoted 1 line
Signed-off-by Hans de Goede <[email protected]>Acked-by Mika Westerberg <[email protected]>
Pushed to my review and testing queue, thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko