All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: Remove pointless WARN_ON in DMA teardown
@ 2016-10-26 18:19 Robin Murphy
  2016-10-26 18:26 ` Will Deacon
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Robin Murphy @ 2016-10-26 18:19 UTC (permalink / raw)
  To: linux-arm-kernel

We expect arch_teardown_dma_ops() to be called very late in a device's
life, after it has been removed from its bus, and thus after the IOMMU
bus notifier has run. As such, even if this funny little check did make
sense, it's unlikely to achieve what it thinks it's trying to do anyway.
It's a residual trace of an earlier implementation which didn't belong
here from the start; belatedly snuff it out.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 arch/arm64/mm/dma-mapping.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index 5cd0a383b14b..290a84f3351f 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -940,11 +940,6 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
 
 void arch_teardown_dma_ops(struct device *dev)
 {
-	struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
-
-	if (WARN_ON(domain))
-		iommu_detach_device(domain, dev);
-
 	dev->archdata.dma_ops = NULL;
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] arm64: Remove pointless WARN_ON in DMA teardown
  2016-10-26 18:19 [PATCH] arm64: Remove pointless WARN_ON in DMA teardown Robin Murphy
@ 2016-10-26 18:26 ` Will Deacon
  2016-10-27  2:32 ` Sricharan
  2016-10-30 14:26 ` Catalin Marinas
  2 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2016-10-26 18:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 26, 2016 at 07:19:31PM +0100, Robin Murphy wrote:
> We expect arch_teardown_dma_ops() to be called very late in a device's
> life, after it has been removed from its bus, and thus after the IOMMU
> bus notifier has run. As such, even if this funny little check did make
> sense, it's unlikely to achieve what it thinks it's trying to do anyway.
> It's a residual trace of an earlier implementation which didn't belong
> here from the start; belatedly snuff it out.
> 
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> ---
>  arch/arm64/mm/dma-mapping.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
> index 5cd0a383b14b..290a84f3351f 100644
> --- a/arch/arm64/mm/dma-mapping.c
> +++ b/arch/arm64/mm/dma-mapping.c
> @@ -940,11 +940,6 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
>  
>  void arch_teardown_dma_ops(struct device *dev)
>  {
> -	struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
> -
> -	if (WARN_ON(domain))
> -		iommu_detach_device(domain, dev);
> -
>  	dev->archdata.dma_ops = NULL;
>  }

Acked-by: Will Deacon <will.deacon@arm.com>

I guess Catalin will pick this up when he starts queueing things for
4.10.

Will

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm64: Remove pointless WARN_ON in DMA teardown
  2016-10-26 18:19 [PATCH] arm64: Remove pointless WARN_ON in DMA teardown Robin Murphy
  2016-10-26 18:26 ` Will Deacon
@ 2016-10-27  2:32 ` Sricharan
  2016-10-30 14:26 ` Catalin Marinas
  2 siblings, 0 replies; 4+ messages in thread
From: Sricharan @ 2016-10-27  2:32 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

>
>We expect arch_teardown_dma_ops() to be called very late in a device's
>life, after it has been removed from its bus, and thus after the IOMMU
>bus notifier has run. As such, even if this funny little check did make
>sense, it's unlikely to achieve what it thinks it's trying to do anyway.
>It's a residual trace of an earlier implementation which didn't belong
>here from the start; belatedly snuff it out.
>
>Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>---
> arch/arm64/mm/dma-mapping.c | 5 -----
> 1 file changed, 5 deletions(-)
>
>diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
>index 5cd0a383b14b..290a84f3351f 100644
>--- a/arch/arm64/mm/dma-mapping.c
>+++ b/arch/arm64/mm/dma-mapping.c
>@@ -940,11 +940,6 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
>
> void arch_teardown_dma_ops(struct device *dev)
> {
>-	struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
>-
>-	if (WARN_ON(domain))
>-		iommu_detach_device(domain, dev);
>-

Thanks!!, clears my doubt that i had for quite sometime.

Regards,
 Sricharan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm64: Remove pointless WARN_ON in DMA teardown
  2016-10-26 18:19 [PATCH] arm64: Remove pointless WARN_ON in DMA teardown Robin Murphy
  2016-10-26 18:26 ` Will Deacon
  2016-10-27  2:32 ` Sricharan
@ 2016-10-30 14:26 ` Catalin Marinas
  2 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2016-10-30 14:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 26, 2016 at 07:19:31PM +0100, Robin Murphy wrote:
> We expect arch_teardown_dma_ops() to be called very late in a device's
> life, after it has been removed from its bus, and thus after the IOMMU
> bus notifier has run. As such, even if this funny little check did make
> sense, it's unlikely to achieve what it thinks it's trying to do anyway.
> It's a residual trace of an earlier implementation which didn't belong
> here from the start; belatedly snuff it out.
> 
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>

Queued for 4.10. Thanks.

-- 
Catalin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-30 14:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-26 18:19 [PATCH] arm64: Remove pointless WARN_ON in DMA teardown Robin Murphy
2016-10-26 18:26 ` Will Deacon
2016-10-27  2:32 ` Sricharan
2016-10-30 14:26 ` Catalin Marinas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.