Skip to content

Commit

Permalink
regulator: stpmic1: Fix USB IRQ handler initialization
Browse files Browse the repository at this point in the history
Fix USB IRQ handler initialization.
Setting always-on on boost regulator generates a fault.

Unable to handle kernel NULL pointer dereference at virtual address 0000004c
pgd = 54d71286
[0000004c] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 1 PID: 72 Comm: irq/70-pmic_irq Not tainted 5.15.67ppav4.0 torvalds#188
Hardware name: STM32 (Device Tree Support)
PC is at blocking_notifier_call_chain+0x4/0x90
LR is at regulator_notifier_call_chain+0xc/0x14
...
(blocking_notifier_call_chain) from [<c062b368>] (regulator_notifier_call_chain+0xc/0x14)
(regulator_notifier_call_chain) from [<c0644a9c>] (stpmic1_boost_irq_handler+0x4c/0x84)
(stpmic1_boost_irq_handler) from [<c017fbc0>] (handle_nested_irq+0xc8/0x12c)
(handle_nested_irq) from [<c07160b0>] (regmap_irq_thread+0x46c/0x6d4)
(regmap_irq_thread) from [<c017c2dc>] (irq_thread_fn+0x1c/0x7c)
(irq_thread_fn) from [<c017c0bc>] (irq_thread+0x150/0x224)
(irq_thread) from [<c0147874>] (kthread+0x14c/0x164)
(kthread) from [<c0100130>] (ret_from_fork+0x14/0x24)

Signed-off-by: Pascal Paillet <[email protected]>
Change-Id: I23d72d24d2de029c516f4568dc518917cb2b95ca
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/312297
Reviewed-by: Patrick DELAUNAY <[email protected]>
ACI: CITOOLS <[email protected]>
ACI: CIBUILD <[email protected]>
Domain-Review: Patrick DELAUNAY <[email protected]>
  • Loading branch information
ppaillet authored and fourmone committed Jul 31, 2023
1 parent 1847a3c commit 73046e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/regulator/stpmic1_regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,8 @@ stpmic1_boost_register(struct platform_device *pdev, int id,
return rdev;
}

usb_data->boost_rdev = rdev;

/* setup an irq handler for over-current detection */
irq = of_irq_get(config.of_node, 0);
if (irq > 0) {
Expand Down Expand Up @@ -763,8 +765,6 @@ static int stpmic1_regulator_probe(struct platform_device *pdev)
stpmic1_boost_register(pdev, i, &stpmic1_matches[i],
&stpmic1_regulator_cfgs[i],
usb_data);

usb_data->boost_rdev = rdev;
} else {
rdev =
stpmic1_regulator_register(pdev, i, &stpmic1_matches[i],
Expand Down

0 comments on commit 73046e3

Please sign in to comment.