summaryrefslogtreecommitdiff
path: root/scripts/objdump-func
diff options
context:
space:
mode:
authorJens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com>2026-11-09 14:50:42 +0100
committerLinus Walleij <linusw@kernel.org>2026-11-17 15:05:54 +0100
commit5cf0969621bc014b5305e6ff8b7e28f20060c3e8 (patch)
tree8965cfd9149d59f1cce9af8ad0a44cf9bec52029 /scripts/objdump-func
parent754c5f89ae2eafd6aabb4ef01917211faa0485ce (diff)
pinctrl: ocelot: do not use the chained irqchip behind a sleeping bus
Since the driver can use a regmap on a bus that can sleep, as for VSC7512 attached over SPI, it still registers the gpiochip as not sleeping and adds the chained irqchip when the node has an interrupt. The chained handler and the irq_chip callbacks run in atomic context and access the registers through that regmap, and consumers may use the lines of a gpiochip that is not marked as sleeping from atomic context. Mark the gpiochip as sleeping when the regmap can sleep, and do not register the chained irqchip in that case. The issue was found by code inspection and reproduced on a lan9668 board (pcb8385) with a lan9645x attached over SPI, whose pinctrl node has an interrupt, by requesting an edge interrupt on one of its GPIOs through the GPIO character device: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:623 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 420, name: gpiomon preempt_count: 1, expected: 0 locks held by gpiomon/420: 3, last CPU#0: #0: 84463cd0 (&gdev->srcu){.+.+}-{0:0}, at: lineinfo_get+0x13f/0x140 #1: 838bbd30 (request_class){+.+.}-{4:4}, at: __setup_irq+0xe8/0x5c0 #2: 838bbc70 (lock_class){-...}-{2:2}, at: __setup_irq+0x104/0x5c0 ... Call trace: ... mutex_lock_nested from regmap_update_bits_base+0x1c/0x80 regmap_update_bits_base from ocelot_irq_unmask+0x42/0x80 ocelot_irq_unmask from irq_enable+0x1e/0x80 irq_enable from irq_startup+0x64/0xc0 irq_startup from __setup_irq+0x38c/0x5c0 __setup_irq from request_threaded_irq+0x86/0x140 request_threaded_irq from edge_detector_setup+0x1d8/0x240 edge_detector_setup from linereq_create+0x3e2/0x540 linereq_create from gpio_ioctl+0xa4/0x240 With the fix the lan9645x gpiochip is registered as sleeping and without the chained irqchip, the request fails with -ENXIO instead and without lockdep reports. Fixes: 181f604b33cd ("pinctrl: ocelot: add ability to be used in a non-mmio configuration") Signed-off-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@microchip.com> Reviewed-by: Colin Foster <colin.foster@in-advantage.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
Diffstat (limited to 'scripts/objdump-func')
0 files changed, 0 insertions, 0 deletions