Skip to content

Commit 82e5177

Browse files
YongWu-HFjoergroedel
authored andcommitted
iommu/mediatek: Always enable output PA over 32bits in isr
Currently the output PA[32:33] is contained by the flag IOVA_34. This is not right. the iova_34 has no relation with pa[32:33], the 32bits iova still could map to pa[32:33]. Move it out from the flag. No need fix tag since currently only mt8192 use the calulation and it always has this IOVA_34 flag. Prepare for the IOMMU that still use IOVA 32bits but its dram size may be over 4GB. Signed-off-by: Yong Wu <yong.wu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Link: https://lore.kernel.org/r/20220503071427.2285-15-yong.wu@mediatek.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent e6d25e7 commit 82e5177

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/iommu/mtk_iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,11 @@ static irqreturn_t mtk_iommu_isr(int irq, void *dev_id)
283283
write = fault_iova & F_MMU_FAULT_VA_WRITE_BIT;
284284
if (MTK_IOMMU_HAS_FLAG(data->plat_data, IOVA_34_EN)) {
285285
va34_32 = FIELD_GET(F_MMU_INVAL_VA_34_32_MASK, fault_iova);
286-
pa34_32 = FIELD_GET(F_MMU_INVAL_PA_34_32_MASK, fault_iova);
287286
fault_iova = fault_iova & F_MMU_INVAL_VA_31_12_MASK;
288287
fault_iova |= (u64)va34_32 << 32;
289-
fault_pa |= (u64)pa34_32 << 32;
290288
}
289+
pa34_32 = FIELD_GET(F_MMU_INVAL_PA_34_32_MASK, fault_iova);
290+
fault_pa |= (u64)pa34_32 << 32;
291291

292292
fault_port = F_MMU_INT_ID_PORT_ID(regval);
293293
if (MTK_IOMMU_HAS_FLAG(data->plat_data, HAS_SUB_COMM)) {

0 commit comments

Comments
 (0)