Skip to content

Commit

Permalink
iommu/sun50i: Change the readl timeout to the atomic variant
Browse files Browse the repository at this point in the history
The flush_all_tlb call back can be called from an atomic context, so using
readl_poll_timeout that embeds a udelay doesn't work.

Fixes: 4100b8c ("iommu: Add Allwinner H6 IOMMU driver")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20200628180844.79205-1-maxime@cerno.tech
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Maxime Ripard authored and Joerg Roedel committed Jun 30, 2020
1 parent 9ebcfad commit bc8784f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/iommu/sun50i-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ static int sun50i_iommu_flush_all_tlb(struct sun50i_iommu *iommu)
IOMMU_TLB_FLUSH_MICRO_TLB(1) |
IOMMU_TLB_FLUSH_MICRO_TLB(0));

ret = readl_poll_timeout(iommu->base + IOMMU_TLB_FLUSH_REG,
reg, !reg,
1, 2000);
ret = readl_poll_timeout_atomic(iommu->base + IOMMU_TLB_FLUSH_REG,
reg, !reg,
1, 2000);
if (ret)
dev_warn(iommu->dev, "TLB Flush timed out!\n");

Expand Down

0 comments on commit bc8784f

Please sign in to comment.