Commit 44bf661
pinctrl: renesas: rzg2l: Fix ISEL restore on resume
Commit 1d2da79 ("pinctrl: renesas: rzg2l: Avoid configuring ISEL in
gpio_irq_{en,dis}able*()") dropped the configuration of ISEL from
struct irq_chip::{irq_enable, irq_disable} APIs and moved it to
struct gpio_chip::irq::{child_to_parent_hwirq,
child_irq_domain_ops::free} APIs to fix spurious IRQs.
After commit 1d2da79 ("pinctrl: renesas: rzg2l: Avoid configuring ISEL
in gpio_irq_{en,dis}able*()"), ISEL was no longer configured properly on
resume. This is because the pinctrl resume code used
struct irq_chip::irq_enable (called from rzg2l_gpio_irq_restore()) to
reconfigure the wakeup interrupts. Some drivers (e.g. Ethernet) may also
reconfigure non-wakeup interrupts on resume through their own code,
eventually calling struct irq_chip::irq_enable.
Fix this by adding ISEL configuration back into the
struct irq_chip::irq_enable API and on resume path for wakeup interrupts.
As struct irq_chip::irq_enable needs now to lock to update the ISEL,
convert the struct rzg2l_pinctrl::lock to a raw spinlock and replace the
locking API calls with the raw variants. Otherwise the lockdep reports
invalid wait context when probing the adv7511 module on RZ/G2L:
[ BUG: Invalid wait context ]
6.17.0-rc5-next-20250911-00001-gfcfac22533c9 #18 Not tainted
-----------------------------
(udev-worker)/165 is trying to lock:
ffff00000e3664a8 (&pctrl->lock){....}-{3:3}, at: rzg2l_gpio_irq_enable+0x38/0x78
other info that might help us debug this:
context-{5:5}
3 locks held by (udev-worker)/165:
#0: ffff00000e890108 (&dev->mutex){....}-{4:4}, at: __driver_attach+0x90/0x1ac
#1: ffff000011c07240 (request_class){+.+.}-{4:4}, at: __setup_irq+0xb4/0x6dc
#2: ffff000011c070c8 (lock_class){....}-{2:2}, at: __setup_irq+0xdc/0x6dc
stack backtrace:
CPU: 1 UID: 0 PID: 165 Comm: (udev-worker) Not tainted 6.17.0-rc5-next-20250911-00001-gfcfac22533c9 #18 PREEMPT
Hardware name: Renesas SMARC EVK based on r9a07g044l2 (DT)
Call trace:
show_stack+0x18/0x24 (C)
dump_stack_lvl+0x90/0xd0
dump_stack+0x18/0x24
__lock_acquire+0xa14/0x20b4
lock_acquire+0x1c8/0x354
_raw_spin_lock_irqsave+0x60/0x88
rzg2l_gpio_irq_enable+0x38/0x78
irq_enable+0x40/0x8c
__irq_startup+0x78/0xa4
irq_startup+0x108/0x16c
__setup_irq+0x3c0/0x6dc
request_threaded_irq+0xec/0x1ac
devm_request_threaded_irq+0x80/0x134
adv7511_probe+0x928/0x9a4 [adv7511]
i2c_device_probe+0x22c/0x3dc
really_probe+0xbc/0x2a0
__driver_probe_device+0x78/0x12c
driver_probe_device+0x40/0x164
__driver_attach+0x9c/0x1ac
bus_for_each_dev+0x74/0xd0
driver_attach+0x24/0x30
bus_add_driver+0xe4/0x208
driver_register+0x60/0x128
i2c_register_driver+0x48/0xd0
adv7511_init+0x5c/0x1000 [adv7511]
do_one_initcall+0x64/0x30c
do_init_module+0x58/0x23c
load_module+0x1bcc/0x1d40
init_module_from_file+0x88/0xc4
idempotent_init_module+0x188/0x27c
__arm64_sys_finit_module+0x68/0xac
invoke_syscall+0x48/0x110
el0_svc_common.constprop.0+0xc0/0xe0
do_el0_svc+0x1c/0x28
el0_svc+0x4c/0x160
el0t_64_sync_handler+0xa0/0xe4
el0t_64_sync+0x198/0x19c
Having ISEL configuration back into the struct irq_chip::irq_enable API
should be safe with respect to spurious IRQs, as in the probe case IRQs
are enabled anyway in struct gpio_chip::irq::child_to_parent_hwirq. No
spurious IRQs were detected on suspend/resume, boot, ethernet link
insert/remove tests (executed on RZ/G3S). Boot, ethernet link
insert/remove tests were also executed successfully on RZ/G2L.
Fixes: 1d2da79 ("pinctrl: renesas: rzg2l: Avoid configuring ISEL in gpio_irq_{en,dis}able*(")
Cc: [email protected]
Signed-off-by: Claudiu Beznea <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Geert Uytterhoeven <[email protected]>1 parent 3a86608 commit 44bf661
1 file changed
+44
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
| 546 | + | |
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
570 | | - | |
| 570 | + | |
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
| |||
882 | 882 | | |
883 | 883 | | |
884 | 884 | | |
885 | | - | |
| 885 | + | |
886 | 886 | | |
887 | 887 | | |
888 | | - | |
| 888 | + | |
889 | 889 | | |
890 | 890 | | |
891 | 891 | | |
| |||
1121 | 1121 | | |
1122 | 1122 | | |
1123 | 1123 | | |
1124 | | - | |
| 1124 | + | |
1125 | 1125 | | |
1126 | 1126 | | |
1127 | 1127 | | |
| |||
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
1137 | | - | |
| 1137 | + | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
| |||
1687 | 1687 | | |
1688 | 1688 | | |
1689 | 1689 | | |
1690 | | - | |
| 1690 | + | |
1691 | 1691 | | |
1692 | 1692 | | |
1693 | 1693 | | |
1694 | 1694 | | |
1695 | 1695 | | |
1696 | 1696 | | |
1697 | | - | |
| 1697 | + | |
1698 | 1698 | | |
1699 | 1699 | | |
1700 | 1700 | | |
| |||
1709 | 1709 | | |
1710 | 1710 | | |
1711 | 1711 | | |
1712 | | - | |
| 1712 | + | |
1713 | 1713 | | |
1714 | 1714 | | |
1715 | 1715 | | |
1716 | 1716 | | |
1717 | 1717 | | |
1718 | 1718 | | |
1719 | 1719 | | |
1720 | | - | |
| 1720 | + | |
1721 | 1721 | | |
1722 | 1722 | | |
1723 | 1723 | | |
| |||
1761 | 1761 | | |
1762 | 1762 | | |
1763 | 1763 | | |
1764 | | - | |
| 1764 | + | |
1765 | 1765 | | |
1766 | 1766 | | |
1767 | 1767 | | |
| |||
1770 | 1770 | | |
1771 | 1771 | | |
1772 | 1772 | | |
1773 | | - | |
| 1773 | + | |
1774 | 1774 | | |
1775 | 1775 | | |
1776 | 1776 | | |
| |||
2429 | 2429 | | |
2430 | 2430 | | |
2431 | 2431 | | |
2432 | | - | |
2433 | | - | |
| 2432 | + | |
| 2433 | + | |
2434 | 2434 | | |
2435 | 2435 | | |
2436 | 2436 | | |
2437 | 2437 | | |
2438 | 2438 | | |
2439 | | - | |
2440 | 2439 | | |
2441 | 2440 | | |
2442 | 2441 | | |
| |||
2445 | 2444 | | |
2446 | 2445 | | |
2447 | 2446 | | |
2448 | | - | |
2449 | 2447 | | |
2450 | 2448 | | |
2451 | 2449 | | |
2452 | 2450 | | |
2453 | | - | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
2454 | 2461 | | |
2455 | 2462 | | |
2456 | 2463 | | |
| |||
2462 | 2469 | | |
2463 | 2470 | | |
2464 | 2471 | | |
2465 | | - | |
| 2472 | + | |
2466 | 2473 | | |
2467 | 2474 | | |
| 2475 | + | |
2468 | 2476 | | |
2469 | 2477 | | |
2470 | 2478 | | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
2471 | 2483 | | |
2472 | 2484 | | |
2473 | 2485 | | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
2474 | 2491 | | |
2475 | 2492 | | |
2476 | 2493 | | |
| |||
2616 | 2633 | | |
2617 | 2634 | | |
2618 | 2635 | | |
2619 | | - | |
| 2636 | + | |
2620 | 2637 | | |
2621 | 2638 | | |
2622 | | - | |
2623 | | - | |
| 2639 | + | |
| 2640 | + | |
2624 | 2641 | | |
2625 | 2642 | | |
2626 | 2643 | | |
| |||
2950 | 2967 | | |
2951 | 2968 | | |
2952 | 2969 | | |
2953 | | - | |
| 2970 | + | |
2954 | 2971 | | |
2955 | 2972 | | |
2956 | 2973 | | |
| |||
3093 | 3110 | | |
3094 | 3111 | | |
3095 | 3112 | | |
3096 | | - | |
| 3113 | + | |
3097 | 3114 | | |
3098 | 3115 | | |
3099 | 3116 | | |
| |||
3138 | 3155 | | |
3139 | 3156 | | |
3140 | 3157 | | |
3141 | | - | |
| 3158 | + | |
3142 | 3159 | | |
3143 | 3160 | | |
3144 | 3161 | | |
| |||
3187 | 3204 | | |
3188 | 3205 | | |
3189 | 3206 | | |
3190 | | - | |
| 3207 | + | |
3191 | 3208 | | |
3192 | 3209 | | |
3193 | 3210 | | |
3194 | 3211 | | |
3195 | 3212 | | |
3196 | 3213 | | |
3197 | | - | |
| 3214 | + | |
3198 | 3215 | | |
3199 | 3216 | | |
3200 | 3217 | | |
| |||
0 commit comments