iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: only select ARCH_HAS_UNCACHED_SEGMENT for non-coherent platforms
@ 2019-06-30 16:48 Christoph Hellwig
  2019-06-30 17:57 ` Guenter Roeck
  2019-07-03 12:47 ` Paul Burton
  0 siblings, 2 replies; 3+ messages in thread
From: Christoph Hellwig @ 2019-06-30 16:48 UTC (permalink / raw)
  To: paul.burton; +Cc: iommu, linux-mips, linux

While mips might architecturally have the uncached segment all the time,
the infrastructure to use it is only need on platforms where DMA is
at least partially incoherent.  Only select it for those configuration
to fix a build failure as the arch_dma_prep_coherent symbol is also only
provided for non-coherent platforms.

Fixes: 2e96e04d25 ("MIPS: use the generic uncached segment support in dma-direct")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/mips/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 61a390c2f2c1..caf480275a31 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -8,7 +8,6 @@ config MIPS
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
 	select ARCH_HAS_UBSAN_SANITIZE_ALL
-	select ARCH_HAS_UNCACHED_SEGMENT
 	select ARCH_SUPPORTS_UPROBES
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_CMPXCHG_LOCKREF if 64BIT
@@ -1120,6 +1119,7 @@ config DMA_NONCOHERENT
 	bool
 	select ARCH_HAS_DMA_MMAP_PGPROT
 	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
+	select ARCH_HAS_UNCACHED_SEGMENT
 	select NEED_DMA_MAP_STATE
 	select ARCH_HAS_DMA_COHERENT_TO_PFN
 	select DMA_NONCOHERENT_CACHE_SYNC
-- 
2.20.1

_______________________________________________
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] MIPS: only select ARCH_HAS_UNCACHED_SEGMENT for non-coherent platforms
  2019-06-30 16:48 [PATCH] MIPS: only select ARCH_HAS_UNCACHED_SEGMENT for non-coherent platforms Christoph Hellwig
@ 2019-06-30 17:57 ` Guenter Roeck
  2019-07-03 12:47 ` Paul Burton
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2019-06-30 17:57 UTC (permalink / raw)
  To: Christoph Hellwig, paul.burton; +Cc: iommu, linux-mips

On 6/30/19 9:48 AM, Christoph Hellwig wrote:
> While mips might architecturally have the uncached segment all the time,
> the infrastructure to use it is only need on platforms where DMA is
> at least partially incoherent.  Only select it for those configuration
> to fix a build failure as the arch_dma_prep_coherent symbol is also only
> provided for non-coherent platforms.
> 
> Fixes: 2e96e04d25 ("MIPS: use the generic uncached segment support in dma-direct")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

This patch fixes

kernel/dma/direct.c:144: undefined reference to `arch_dma_prep_coherent'

Tested-by: Guenter Roeck <linux@roeck-us.net>

Mips images still don't boot in -next after this patch is applied, so
"Tested-by:" only means that affected configurations now build without
link error, not that they actually work.

Guenter

>   arch/mips/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index 61a390c2f2c1..caf480275a31 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -8,7 +8,6 @@ config MIPS
>   	select ARCH_HAS_ELF_RANDOMIZE
>   	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
>   	select ARCH_HAS_UBSAN_SANITIZE_ALL
> -	select ARCH_HAS_UNCACHED_SEGMENT
>   	select ARCH_SUPPORTS_UPROBES
>   	select ARCH_USE_BUILTIN_BSWAP
>   	select ARCH_USE_CMPXCHG_LOCKREF if 64BIT
> @@ -1120,6 +1119,7 @@ config DMA_NONCOHERENT
>   	bool
>   	select ARCH_HAS_DMA_MMAP_PGPROT
>   	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
> +	select ARCH_HAS_UNCACHED_SEGMENT
>   	select NEED_DMA_MAP_STATE
>   	select ARCH_HAS_DMA_COHERENT_TO_PFN
>   	select DMA_NONCOHERENT_CACHE_SYNC
> 

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH] MIPS: only select ARCH_HAS_UNCACHED_SEGMENT for non-coherent platforms
  2019-06-30 16:48 [PATCH] MIPS: only select ARCH_HAS_UNCACHED_SEGMENT for non-coherent platforms Christoph Hellwig
  2019-06-30 17:57 ` Guenter Roeck
@ 2019-07-03 12:47 ` Paul Burton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Burton @ 2019-07-03 12:47 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: iommu, linux-mips, linux

Hi Christoph,

On Sun, Jun 30, 2019 at 06:48:05PM +0200, Christoph Hellwig wrote:
> While mips might architecturally have the uncached segment all the time,
> the infrastructure to use it is only need on platforms where DMA is
> at least partially incoherent.  Only select it for those configuration
> to fix a build failure as the arch_dma_prep_coherent symbol is also only
> provided for non-coherent platforms.
> 
> Fixes: 2e96e04d25 ("MIPS: use the generic uncached segment support in dma-direct")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Acked-by: Paul Burton <paul.burton@mips.com>

Thanks,
    Paul
_______________________________________________
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:[~2019-07-03 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-30 16:48 [PATCH] MIPS: only select ARCH_HAS_UNCACHED_SEGMENT for non-coherent platforms Christoph Hellwig
2019-06-30 17:57 ` Guenter Roeck
2019-07-03 12:47 ` Paul Burton

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).