summaryrefslogtreecommitdiff
path: root/drivers/iommu/sun50i-iommu.c
diff options
context:
space:
mode:
authorJernej Skrabec <jernej.skrabec@gmail.com>2022-10-25 19:54:11 +0300
committerJoerg Roedel <jroedel@suse.de>2022-11-03 17:45:42 +0300
commit9ad0c1252e84dbc664f0462707182245ed603237 (patch)
tree6e442b810c04c8f1e1e7c57ddefecb8c2f42875e /drivers/iommu/sun50i-iommu.c
parent30a0b95b1335e12efef89dd78518ed3e4a71a763 (diff)
downloadlinux-9ad0c1252e84dbc664f0462707182245ed603237.tar.xz
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: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver") Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://lore.kernel.org/r/20221025165415.307591-2-jernej.skrabec@gmail.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/sun50i-iommu.c')
-rw-r--r--drivers/iommu/sun50i-iommu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
index cd9b74ee24de..270204a6ec4a 100644
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -27,6 +27,7 @@
#include <linux/types.h>
#define IOMMU_RESET_REG 0x010
+#define IOMMU_RESET_RELEASE_ALL 0xffffffff
#define IOMMU_ENABLE_REG 0x020
#define IOMMU_ENABLE_ENABLE BIT(0)
@@ -893,7 +894,7 @@ 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);
- iommu_write(iommu, IOMMU_RESET_REG, status);
+ iommu_write(iommu, IOMMU_RESET_REG, IOMMU_RESET_RELEASE_ALL);
spin_unlock(&iommu->iommu_lock);