mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 08:19:28 +00:00
gpio/lynxpoint: check if the interrupt is enabled in IRQ handler
Checking LP_INT_STAT is not enough in the interrupt handler because its contents get updated regardless of whether the pin has interrupt enabled or not. This causes the driver to loop forever for GPIOs that are pulled up. Fix this by checking the interrupt enable bit for the pin as well. Cc: stable@vger.kernel.org Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
d0e639c9e0
commit
03d152d558
1 changed files with 3 additions and 2 deletions
|
@ -248,14 +248,15 @@ static void lp_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
|
||||||
struct lp_gpio *lg = irq_data_get_irq_handler_data(data);
|
struct lp_gpio *lg = irq_data_get_irq_handler_data(data);
|
||||||
struct irq_chip *chip = irq_data_get_irq_chip(data);
|
struct irq_chip *chip = irq_data_get_irq_chip(data);
|
||||||
u32 base, pin, mask;
|
u32 base, pin, mask;
|
||||||
unsigned long reg, pending;
|
unsigned long reg, ena, pending;
|
||||||
unsigned virq;
|
unsigned virq;
|
||||||
|
|
||||||
/* check from GPIO controller which pin triggered the interrupt */
|
/* check from GPIO controller which pin triggered the interrupt */
|
||||||
for (base = 0; base < lg->chip.ngpio; base += 32) {
|
for (base = 0; base < lg->chip.ngpio; base += 32) {
|
||||||
reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT);
|
reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT);
|
||||||
|
ena = lp_gpio_reg(&lg->chip, base, LP_INT_ENABLE);
|
||||||
|
|
||||||
while ((pending = inl(reg))) {
|
while ((pending = (inl(reg) & inl(ena)))) {
|
||||||
pin = __ffs(pending);
|
pin = __ffs(pending);
|
||||||
mask = BIT(pin);
|
mask = BIT(pin);
|
||||||
/* Clear before handling so we don't lose an edge */
|
/* Clear before handling so we don't lose an edge */
|
||||||
|
|
Loading…
Reference in a new issue