Skip to content

Commit 00ef888

Browse files
ribaldajoergroedel
authored andcommitted
iommu/mediatek: Fix crash on isr after kexec()
If the system is rebooted via isr(), the IRQ handler might be triggered before the domain is initialized. Resulting on an invalid memory access error. Fix: [ 0.500930] Unable to handle kernel read from unreadable memory at virtual address 0000000000000070 [ 0.501166] Call trace: [ 0.501174] report_iommu_fault+0x28/0xfc [ 0.501180] mtk_iommu_isr+0x10c/0x1c0 Signed-off-by: Ricardo Ribalda <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ joro: Fixed spelling in commit message ] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 9ff894e commit 00ef888

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static irqreturn_t mtk_iommu_isr(int irq, void *dev_id)
462462
fault_larb = data->plat_data->larbid_remap[fault_larb][sub_comm];
463463
}
464464

465-
if (report_iommu_fault(&dom->domain, bank->parent_dev, fault_iova,
465+
if (!dom || report_iommu_fault(&dom->domain, bank->parent_dev, fault_iova,
466466
write ? IOMMU_FAULT_WRITE : IOMMU_FAULT_READ)) {
467467
dev_err_ratelimited(
468468
bank->parent_dev,

0 commit comments

Comments
 (0)