All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Christoph Hellwig <hch@lst.de>
Cc: Claire Chang <tientzu@chromium.org>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the swiotlb tree with the dma-mapping tree
Date: Thu, 19 Aug 2021 11:13:12 +1000	[thread overview]
Message-ID: <20210819111312.697fc48f@canb.auug.org.au> (raw)

[-- 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 --]

             reply	other threads:[~2021-08-19  1:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  1:13 Stephen Rothwell [this message]
2021-08-19  7:03 ` linux-next: manual merge of the swiotlb tree with the dma-mapping tree Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210819111312.697fc48f@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=hch@lst.de \
    --cc=konrad.wilk@oracle.com \
    --cc=konrad@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=tientzu@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.