Skip to content

Commit 2f1b11c

Browse files
committed
Merge tag 'pinctrl-v4.14-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: "Two last minute fixes for pin controllers, both regressions in specific drivers: - Fix a touchpad pin control issue on the AMD affecting Asus laptops - Fix an interrupt handling regression on the MCP23s08" * tag 'pinctrl-v4.14-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: mcp23s08: fix interrupt handling regression pinctrl/amd: fix masking of GPIO interrupts
2 parents 468b0e0 + 5986170 commit 2f1b11c

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

drivers/pinctrl/pinctrl-amd.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,16 @@ static irqreturn_t amd_gpio_irq_handler(int irq, void *dev_id)
534534
continue;
535535
irq = irq_find_mapping(gc->irqdomain, irqnr + i);
536536
generic_handle_irq(irq);
537-
/* Clear interrupt */
537+
538+
/* Clear interrupt.
539+
* We must read the pin register again, in case the
540+
* value was changed while executing
541+
* generic_handle_irq() above.
542+
*/
543+
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
544+
regval = readl(regs + i);
538545
writel(regval, regs + i);
546+
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
539547
ret = IRQ_HANDLED;
540548
}
541549
}

drivers/pinctrl/pinctrl-mcp23s08.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,10 @@ static int mcp23s08_get(struct gpio_chip *chip, unsigned offset)
407407
ret = mcp_read(mcp, MCP_GPIO, &status);
408408
if (ret < 0)
409409
status = 0;
410-
else
410+
else {
411+
mcp->cached_gpio = status;
411412
status = !!(status & (1 << offset));
412-
413-
mcp->cached_gpio = status;
413+
}
414414

415415
mutex_unlock(&mcp->lock);
416416
return status;

0 commit comments

Comments
 (0)