Skip to content

Commit 4cbb264

Browse files
ribaldabroonie
authored andcommitted
ASoC: mediatek: mt8173: Enable IRQ when pdata is ready
If the device does not come straight from reset, we might receive an IRQ before we are ready to handle it. Fixes: [ 2.334737] Unable to handle kernel read from unreadable memory at virtual address 00000000000001e4 [ 2.522601] Call trace: [ 2.525040] regmap_read+0x1c/0x80 [ 2.528434] mt8173_afe_irq_handler+0x40/0xf0 ... [ 2.598921] start_kernel+0x338/0x42c Signed-off-by: Ricardo Ribalda <[email protected]> Fixes: ee0bcaf ("ASoC: mediatek: Add AFE platform driver") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent cecf817 commit 4cbb264

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sound/soc/mediatek/mt8173/mt8173-afe-pcm.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,16 +1070,6 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
10701070

10711071
afe->dev = &pdev->dev;
10721072

1073-
irq_id = platform_get_irq(pdev, 0);
1074-
if (irq_id <= 0)
1075-
return irq_id < 0 ? irq_id : -ENXIO;
1076-
ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler,
1077-
0, "Afe_ISR_Handle", (void *)afe);
1078-
if (ret) {
1079-
dev_err(afe->dev, "could not request_irq\n");
1080-
return ret;
1081-
}
1082-
10831073
afe->base_addr = devm_platform_ioremap_resource(pdev, 0);
10841074
if (IS_ERR(afe->base_addr))
10851075
return PTR_ERR(afe->base_addr);
@@ -1185,6 +1175,16 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
11851175
if (ret)
11861176
goto err_cleanup_components;
11871177

1178+
irq_id = platform_get_irq(pdev, 0);
1179+
if (irq_id <= 0)
1180+
return irq_id < 0 ? irq_id : -ENXIO;
1181+
ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler,
1182+
0, "Afe_ISR_Handle", (void *)afe);
1183+
if (ret) {
1184+
dev_err(afe->dev, "could not request_irq\n");
1185+
goto err_pm_disable;
1186+
}
1187+
11881188
dev_info(&pdev->dev, "MT8173 AFE driver initialized.\n");
11891189
return 0;
11901190

0 commit comments

Comments
 (0)