iommu/sun50i: fix protection flag check
Subsystems (2)
PATCH 1/1 iommu/sun50i: fix protection flag check
From: David Stevens <[email protected]>
Fix RW protection check when making a pte, so that it properly checks that both R and W flags are set, instead of either R or W.
Signed-off-by David Stevens <[email protected]>
--- drivers/iommu/sun50i-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/sun50i-iommu.c +1 -1
@@ -271,7 +271,7 @@ static u32 sun50i_mk_pte(phys_addr_t page, int prot)enum sun50i_iommu_aci aci;u32 flags =0 ; -if (prot & (IOMMU_READ |IOMMU_WRITE )) +if ((prot &IOMMU_READ ) && (prot &IOMMU_WRITE )) aci =SUN50I_IOMMU_ACI_RD_WR ;else if (prot &IOMMU_READ ) aci =SUN50I_IOMMU_ACI_RD ;
Signature · 1 line
2.32.0.402.g57bb445576-goog
Quoted 6 lines · David Stevens
From: David Stevens <[email protected]>
Fix RW protection check when making a pte, so that it properly checks that both R and W flags are set, instead of either R or W.
Signed-off-by David Stevens <[email protected]>
Acked-by Maxime Ripard <[email protected]>
Thanks!
Maxime