iommu/sun50i: Consider all fault sources for reset
[ Upstream commitcef20703e2] 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:4100b8c229("iommu: Add Allwinner H6 IOMMU driver") Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://lore.kernel.org/r/20221025165415.307591-3-jernej.skrabec@gmail.com Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
160b92ab4a
commit
3a63c4ff57
1 changed files with 6 additions and 2 deletions
|
|
@ -881,8 +881,8 @@ static phys_addr_t sun50i_iommu_handle_perm_irq(struct sun50i_iommu *iommu)
|
|||
|
||||
static irqreturn_t sun50i_iommu_irq(int irq, void *dev_id)
|
||||
{
|
||||
u32 status, l1_status, l2_status, resets;
|
||||
struct sun50i_iommu *iommu = dev_id;
|
||||
u32 status;
|
||||
|
||||
spin_lock(&iommu->iommu_lock);
|
||||
|
||||
|
|
@ -892,6 +892,9 @@ static irqreturn_t sun50i_iommu_irq(int irq, void *dev_id)
|
|||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
l1_status = iommu_read(iommu, IOMMU_L1PG_INT_REG);
|
||||
l2_status = iommu_read(iommu, IOMMU_L2PG_INT_REG);
|
||||
|
||||
if (status & IOMMU_INT_INVALID_L2PG)
|
||||
sun50i_iommu_handle_pt_irq(iommu,
|
||||
IOMMU_INT_ERR_ADDR_L2_REG,
|
||||
|
|
@ -905,7 +908,8 @@ static irqreturn_t sun50i_iommu_irq(int irq, void *dev_id)
|
|||
|
||||
iommu_write(iommu, IOMMU_INT_CLR_REG, status);
|
||||
|
||||
iommu_write(iommu, IOMMU_RESET_REG, ~status);
|
||||
resets = (status | l1_status | l2_status) & IOMMU_INT_MASTER_MASK;
|
||||
iommu_write(iommu, IOMMU_RESET_REG, ~resets);
|
||||
iommu_write(iommu, IOMMU_RESET_REG, IOMMU_RESET_RELEASE_ALL);
|
||||
|
||||
spin_unlock(&iommu->iommu_lock);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue