Commit b74952ab authored by Ricardo Ribalda's avatar Ricardo Ribalda Committed by Matthias Brugger

soc: mediatek: mtk-svs: Enable the IRQ later

If the system does not come from reset (like when is booted via
kexec()), the peripheral might triger an IRQ before the data structures
are initialised.

Fixes:

[    0.227710] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000f08
[    0.227913] Call trace:
[    0.227918]  svs_isr+0x8c/0x538
Signed-off-by: default avatarRicardo Ribalda <ribalda@chromium.org>
Link: https://lore.kernel.org/r/20221127-mtk-svs-v2-0-145b07663ea8@chromium.orgSigned-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
parent 4ea6aa89
...@@ -2385,14 +2385,6 @@ static int svs_probe(struct platform_device *pdev) ...@@ -2385,14 +2385,6 @@ static int svs_probe(struct platform_device *pdev)
goto svs_probe_free_resource; goto svs_probe_free_resource;
} }
ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr,
IRQF_ONESHOT, svsp->name, svsp);
if (ret) {
dev_err(svsp->dev, "register irq(%d) failed: %d\n",
svsp_irq, ret);
goto svs_probe_free_resource;
}
svsp->main_clk = devm_clk_get(svsp->dev, "main"); svsp->main_clk = devm_clk_get(svsp->dev, "main");
if (IS_ERR(svsp->main_clk)) { if (IS_ERR(svsp->main_clk)) {
dev_err(svsp->dev, "failed to get clock: %ld\n", dev_err(svsp->dev, "failed to get clock: %ld\n",
...@@ -2414,6 +2406,14 @@ static int svs_probe(struct platform_device *pdev) ...@@ -2414,6 +2406,14 @@ static int svs_probe(struct platform_device *pdev)
goto svs_probe_clk_disable; goto svs_probe_clk_disable;
} }
ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr,
IRQF_ONESHOT, svsp->name, svsp);
if (ret) {
dev_err(svsp->dev, "register irq(%d) failed: %d\n",
svsp_irq, ret);
goto svs_probe_iounmap;
}
ret = svs_start(svsp); ret = svs_start(svsp);
if (ret) { if (ret) {
dev_err(svsp->dev, "svs start fail: %d\n", ret); dev_err(svsp->dev, "svs start fail: %d\n", ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment