All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the swiotlb tree with the dma-mapping tree
@ 2021-08-19  1:13 Stephen Rothwell
  2021-08-19  7:03 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2021-08-19  1:13 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk, Christoph Hellwig
  Cc: Claire Chang, Konrad Rzeszutek Wilk, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2192 bytes --]

Hi all,

Today's linux-next merge of the swiotlb tree got a conflict in:

  kernel/dma/direct.c

between commit:

  faf4ef823ac5 ("dma-direct: add support for dma_coherent_default_memory")

from the dma-mapping tree and commit:

  f4111e39a52a ("swiotlb: Add restricted DMA alloc/free support")

from the swiotlb tree.

I fixed it up (see below, though more may be needed) and can carry the
fix as necessary. This is now fixed as far as linux-next is concerned,
but any non trivial conflicts should be mentioned to your upstream
maintainer when your tree is submitted for merging.  You may also want
to consider cooperating with the maintainer of the conflicting tree to
minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc kernel/dma/direct.c
index 8dca4f97d12d,2de33e5d302b..000000000000
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@@ -155,15 -174,10 +174,16 @@@ void *dma_direct_alloc(struct device *d
  	}
  
  	if (!IS_ENABLED(CONFIG_ARCH_HAS_DMA_SET_UNCACHED) &&
 -	    !IS_ENABLED(CONFIG_DMA_DIRECT_REMAP) && !dev_is_dma_coherent(dev) &&
 +	    !IS_ENABLED(CONFIG_DMA_DIRECT_REMAP) &&
 +	    !IS_ENABLED(CONFIG_DMA_GLOBAL_POOL) &&
- 	    !dev_is_dma_coherent(dev))
++	    !dev_is_dma_coherent(dev) &&
+ 	    !is_swiotlb_for_alloc(dev))
  		return arch_dma_alloc(dev, size, dma_handle, gfp, attrs);
  
 +	if (IS_ENABLED(CONFIG_DMA_GLOBAL_POOL) &&
 +	    !dev_is_dma_coherent(dev))
 +		return dma_alloc_from_global_coherent(dev, size, dma_handle);
 +
  	/*
  	 * Remapping or decrypting memory may block. If either is required and
  	 * we can't block, allocate the memory from the atomic pools.
@@@ -259,9 -278,8 +284,10 @@@ void dma_direct_free(struct device *dev
  	}
  
  	if (!IS_ENABLED(CONFIG_ARCH_HAS_DMA_SET_UNCACHED) &&
 -	    !IS_ENABLED(CONFIG_DMA_DIRECT_REMAP) && !dev_is_dma_coherent(dev) &&
 +	    !IS_ENABLED(CONFIG_DMA_DIRECT_REMAP) &&
 +	    !IS_ENABLED(CONFIG_DMA_GLOBAL_POOL) &&
- 	    !dev_is_dma_coherent(dev)) {
++	    !dev_is_dma_coherent(dev) &&
+ 	    !is_swiotlb_for_alloc(dev)) {
  		arch_dma_free(dev, size, cpu_addr, dma_addr, attrs);
  		return;
  	}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: manual merge of the swiotlb tree with the dma-mapping tree
  2021-08-19  1:13 linux-next: manual merge of the swiotlb tree with the dma-mapping tree Stephen Rothwell
@ 2021-08-19  7:03 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2021-08-19  7:03 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Konrad Rzeszutek Wilk, Christoph Hellwig, Claire Chang,
	Konrad Rzeszutek Wilk, Linux Kernel Mailing List,
	Linux Next Mailing List

On Thu, Aug 19, 2021 at 11:13:12AM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the swiotlb tree got a conflict in:
> 
>   kernel/dma/direct.c
> 
> between commit:
> 
>   faf4ef823ac5 ("dma-direct: add support for dma_coherent_default_memory")
> 
> from the dma-mapping tree and commit:
> 
>   f4111e39a52a ("swiotlb: Add restricted DMA alloc/free support")
> 
> from the swiotlb tree.
> 
> I fixed it up (see below, though more may be needed) and can carry the

Thanks, the fix looks good.

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

end of thread, other threads:[~2021-08-19  7:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19  1:13 linux-next: manual merge of the swiotlb tree with the dma-mapping tree Stephen Rothwell
2021-08-19  7:03 ` Christoph Hellwig

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.