Skip to content

Commit 9ad0c12

Browse files
jernejskjoergroedel
authored andcommitted
iommu/sun50i: Fix reset release
Reset signal is asserted by writing 0 to the corresponding locations of masters we want to reset. So in order to deassert all reset signals, we should write 1's to all locations. Current code writes 1's to locations of masters which were just reset which is good. However, at the same time it also writes 0's to other locations and thus asserts reset signals of remaining masters. Fix code by writing all 1's when we want to deassert all reset signals. This bug was discovered when working with Cedrus (video decoder). When it faulted, display went blank due to reset signal assertion. 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 30a0b95 commit 9ad0c12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iommu/sun50i-iommu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/types.h>
2828

2929
#define IOMMU_RESET_REG 0x010
30+
#define IOMMU_RESET_RELEASE_ALL 0xffffffff
3031
#define IOMMU_ENABLE_REG 0x020
3132
#define IOMMU_ENABLE_ENABLE BIT(0)
3233

@@ -893,7 +894,7 @@ static irqreturn_t sun50i_iommu_irq(int irq, void *dev_id)
893894
iommu_write(iommu, IOMMU_INT_CLR_REG, status);
894895

895896
iommu_write(iommu, IOMMU_RESET_REG, ~status);
896-
iommu_write(iommu, IOMMU_RESET_REG, status);
897+
iommu_write(iommu, IOMMU_RESET_REG, IOMMU_RESET_RELEASE_ALL);
897898

898899
spin_unlock(&iommu->iommu_lock);
899900

0 commit comments

Comments
 (0)