Re: [PATCH v3 3/8] irqchip/qcom-pdc: Remove pdc_enable_intr() wrapper
From: Val Packett
Date: Sun Jun 28 2026 - 13:55:29 EST
On 6/16/26 6:25 AM, Maulik Shah wrote:
pdc->enable_intr() function already points to respective version
specific enable function. pdc_enable_intr() now only kept as wrapper.
Remove the wrapper and invoke pdc->enable_intr() from caller.
Locking in pdc_enable_intr() applies lock to all pdc->enable_intr()
however its only required for pdc_enable_intr_bank() which uses
a shared bank across all interrupts. pdc_enable_intr_cfg() do not
required locking as IRQ_CFG registers are one per interrupt. Move
locking accordingly.
Signed-off-by: Maulik Shah <maulik.shah@xxxxxxxxxxxxxxxx>
---
drivers/irqchip/qcom-pdc.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c
index b9acb0f25c9c..6c556464d37c 100644
--- a/drivers/irqchip/qcom-pdc.c
+++ b/drivers/irqchip/qcom-pdc.c
@@ -206,6 +206,8 @@ static void pdc_enable_intr_bank(int pin_out, bool on)
index = FIELD_GET(IRQ_ENABLE_BANK_INDEX_MASK, pin_out);
mask = FIELD_GET(IRQ_ENABLE_BANK_BIT_MASK, pin_out);
+ guard(raw_spinlock)(&pdc->lock);
[..]
whoops..
[ 0.197090] BUG: spinlock bad magic on CPU#7, swapper/0/1
[ 0.197104] lock: 0xffff0001022e37b0, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
[ 0.197122] CPU: 7 UID: 0 PID: 1 Comm: swapper/0 Not tainted 7.1.0-next-20260626-uwu+ #128 PREEMPT(full)
[ 0.197129] Hardware name: motorola Motorola Edge 30 (Tianma)/Motorola Edge 30 (Tianma), BIOS 2026.07-rc2-g432bcf301c03-dirty 07/01/2026
[ 0.197133] Call trace:
[ 0.197135] show_stack+0x24/0x38 (C)
[ 0.197148] __dump_stack+0x28/0x38
[ 0.197156] dump_stack_lvl+0x7c/0xa8
[ 0.197165] dump_stack+0x18/0x30
[ 0.197172] spin_dump+0x7c/0x98
[ 0.197179] do_raw_spin_lock+0xa4/0x140
[ 0.197189] _raw_spin_lock+0x2c/0x40
[ 0.197195] pdc_enable_intr_bank+0x40/0x128
[ 0.197201] qcom_pdc_probe+0x3bc/0x520
Gotta also move the spinlock init to before the call to pdc_setup_pin_mapping..
~val