Skip to content

Commit cef2070

Browse files
jernejskjoergroedel
authored andcommitted
iommu/sun50i: Consider all fault sources for reset
We have to reset masters for all faults - permissions, L1 fault or L2 fault. Currently it's done only for permissions. If other type of fault happens, master is in locked up state. Fix that by really considering all fault sources. Fixes: 4100b8c ("iommu: Add Allwinner H6 IOMMU driver") Signed-off-by: Jernej Skrabec <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 9ad0c12 commit cef2070

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/iommu/sun50i-iommu.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,8 @@ static phys_addr_t sun50i_iommu_handle_perm_irq(struct sun50i_iommu *iommu)
869869

870870
static irqreturn_t sun50i_iommu_irq(int irq, void *dev_id)
871871
{
872+
u32 status, l1_status, l2_status, resets;
872873
struct sun50i_iommu *iommu = dev_id;
873-
u32 status;
874874

875875
spin_lock(&iommu->iommu_lock);
876876

@@ -880,6 +880,9 @@ static irqreturn_t sun50i_iommu_irq(int irq, void *dev_id)
880880
return IRQ_NONE;
881881
}
882882

883+
l1_status = iommu_read(iommu, IOMMU_L1PG_INT_REG);
884+
l2_status = iommu_read(iommu, IOMMU_L2PG_INT_REG);
885+
883886
if (status & IOMMU_INT_INVALID_L2PG)
884887
sun50i_iommu_handle_pt_irq(iommu,
885888
IOMMU_INT_ERR_ADDR_L2_REG,
@@ -893,7 +896,8 @@ static irqreturn_t sun50i_iommu_irq(int irq, void *dev_id)
893896

894897
iommu_write(iommu, IOMMU_INT_CLR_REG, status);
895898

896-
iommu_write(iommu, IOMMU_RESET_REG, ~status);
899+
resets = (status | l1_status | l2_status) & IOMMU_INT_MASTER_MASK;
900+
iommu_write(iommu, IOMMU_RESET_REG, ~resets);
897901
iommu_write(iommu, IOMMU_RESET_REG, IOMMU_RESET_RELEASE_ALL);
898902

899903
spin_unlock(&iommu->iommu_lock);

0 commit comments

Comments
 (0)