* [PATCH 1/2] iommu/sun50i: Change the readl timeout to the atomic variant
@ 2020-06-28 18:08 Maxime Ripard
2020-06-28 18:08 ` [PATCH 2/2] iommu/sun50i: Remove unused variable Maxime Ripard
2020-06-30 10:05 ` [PATCH 1/2] iommu/sun50i: Change the readl timeout to the atomic variant Joerg Roedel
0 siblings, 2 replies; 3+ messages in thread
From: Maxime Ripard @ 2020-06-28 18:08 UTC (permalink / raw)
To: Joerg Roedel, Chen-Yu Tsai, Maxime Ripard; +Cc: iommu, linux-arm-kernel
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 <maxime@cerno.tech>
---
drivers/iommu/sun50i-iommu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
index fce605e96aa2..a1563b54c743 100644
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -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");
--
2.26.2
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] iommu/sun50i: Remove unused variable
2020-06-28 18:08 [PATCH 1/2] iommu/sun50i: Change the readl timeout to the atomic variant Maxime Ripard
@ 2020-06-28 18:08 ` Maxime Ripard
2020-06-30 10:05 ` [PATCH 1/2] iommu/sun50i: Change the readl timeout to the atomic variant Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2020-06-28 18:08 UTC (permalink / raw)
To: Joerg Roedel, Chen-Yu Tsai, Maxime Ripard
Cc: iommu, kernel test robot, linux-arm-kernel
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 <lkp@intel.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
drivers/iommu/sun50i-iommu.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
index a1563b54c743..3b1bf2fb94f5 100644
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -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;
--
2.26.2
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] iommu/sun50i: Change the readl timeout to the atomic variant
2020-06-28 18:08 [PATCH 1/2] iommu/sun50i: Change the readl timeout to the atomic variant Maxime Ripard
2020-06-28 18:08 ` [PATCH 2/2] iommu/sun50i: Remove unused variable Maxime Ripard
@ 2020-06-30 10:05 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2020-06-30 10:05 UTC (permalink / raw)
To: Maxime Ripard; +Cc: Chen-Yu Tsai, iommu, linux-arm-kernel
On Sun, Jun 28, 2020 at 08:08:43PM +0200, Maxime Ripard wrote:
> 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 <maxime@cerno.tech>
Applied both for v5.8, thanks.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-30 10:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28 18:08 [PATCH 1/2] iommu/sun50i: Change the readl timeout to the atomic variant Maxime Ripard
2020-06-28 18:08 ` [PATCH 2/2] iommu/sun50i: Remove unused variable Maxime Ripard
2020-06-30 10:05 ` [PATCH 1/2] iommu/sun50i: Change the readl timeout to the atomic variant Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).