summaryrefslogtreecommitdiff
path: root/scripts/basic/split-include.c
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2026-10-13 14:01:10 +0800
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-10-15 14:21:15 +0200
commitb7719c575dec69146f6d537fd616b27083c0cf45 (patch)
tree04c3b888c46c54f693a44abd26b1d00d3e674934 /scripts/basic/split-include.c
parent38d44f78f041ffe60c8e2443b99434a199e7541d (diff)
downloadlinux-b7719c575dec69146f6d537fd616b27083c0cf45.tar.gz
linux-b7719c575dec69146f6d537fd616b27083c0cf45.zip
gpio: mxc: fix both_edges bit operations
gpio_set_irq_type() can be called concurrently for different pins on the same port. The IRQ core serializes per irq descriptor, but different pins have different descriptors, so on SMP systems two concurrent gpio_set_irq_type() calls for pins on the same port run without mutual exclusion. The read-modify-write of port->both_edges is performed outside the port-wide scoped_guard(gpio_generic_lock_irqsave) section, so concurrent updates for different pins can overwrite each other, causing missed interrupts or stuck IRQ lines on dual-edge triggered pins. The original uniprocessor MXC SoCs were not affected; the race became reachable on multi-core i.MX7 and i.MX8 SoCs that reuse this driver. Convert both_edges from u32 to unsigned long and use set_bit(), clear_bit(), and test_bit() to make the modifications atomic. Fixes: 910862ec092c ("mxc: emulate GPIO interrupt on both-edges") Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://patch.msgid.link/20261013-gpio-mxc-cleanup-v7-2-c4d769587d3e@nxp.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions