iommu/sun50i: Change the readl timeout to the atomic variant
Subsystems (2)
PATCH 1/2 iommu/sun50i: Change the readl timeout to the atomic variant
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 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")
Signed-off-by Maxime Ripard <[email protected]>
--- drivers/iommu/sun50i-iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iommu/sun50i-iommu.c +3 -3
@@ -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" );
Signature · 7 lines
2.26.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 2/2 iommu/sun50i: Remove unused variable
The pte_dma variable in the unmap callback is set but never used. Remove it.
Fixes 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")
Reported-by kernel test robot <[email protected]>
Signed-off-by Maxime Ripard <[email protected]>
--- drivers/iommu/sun50i-iommu.c | 2 -- 1 file changed, 2 deletions(-)
drivers/iommu/sun50i-iommu.c +0 -2
@@ -556,7 +556,6 @@ static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova {struct sun50i_iommu_domain *sun50i_domain =to_sun50i_domain (domain);phys_addr_t pt_phys; -dma_addr_t pte_dma;u32 *pte_addr;u32 dte;
@@ -566,7 +565,6 @@ static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova pt_phys =sun50i_dte_get_pt_address (dte); pte_addr = (u32 *)phys_to_virt (pt_phys) +sun50i_iova_get_pte_index (iova); - pte_dma = pt_phys +sun50i_iova_get_pte_index (iova) *PT_ENTRY_SIZE ;if (!sun50i_pte_is_page_valid (*pte_addr))return 0 ;
Signature · 7 lines
2.26.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 5 lines · Maxime Ripard
The
flush_all_tlbcall back can be called from an atomic context, so usingreadl_poll_timeoutthat embeds a udelay doesn't work.Fixes 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")Signed-off-by Maxime Ripard <[email protected]>
Applied both for v5.8, thanks.
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu