All of lore.kernel.org
 help / color / mirror / Atom feed
* dma-mapping cleanups
@ 2020-09-08 16:47 ` Christoph Hellwig
  0 siblings, 0 replies; 86+ messages in thread
From: Christoph Hellwig @ 2020-09-08 16:47 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu, Thomas Bogendoerfer, iommu
  Cc: Tomasz Figa, Joerg Roedel, Robin Murphy, linux-doc, linux-kernel,
	linux-ia64, linux-mips

Hi all,

this series contains just the cleanup parts from the previous
"a saner API for allocating DMA addressable pages" series.  The
intent is to get this in to reduce the amount of patchbombing
for iterations of the real API work.

^ permalink raw reply	[flat|nested] 86+ messages in thread
* Re: [PATCH 09/12] dma-direct: remove __dma_to_phys
@ 2020-09-09 23:46 kernel test robot
  0 siblings, 0 replies; 86+ messages in thread
From: kernel test robot @ 2020-09-09 23:46 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200908164758.3177341-10-hch@lst.de>
References: <20200908164758.3177341-10-hch@lst.de>
TO: Christoph Hellwig <hch@lst.de>

Hi Christoph,

I love your patch! Perhaps something to improve:

[auto build test WARNING on powerpc/next]
[also build test WARNING on char-misc/char-misc-testing iommu/next linus/master v5.9-rc4 next-20200909]
[cannot apply to ia64/next tip/x86/core swiotlb/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Christoph-Hellwig/MIPS-make-dma_sync_-_for_cpu-a-little-less-overzealous/20200909-120508
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
:::::: branch date: 20 hours ago
:::::: commit date: 20 hours ago
config: x86_64-randconfig-m001-20200909 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/xen/swiotlb-xen.c:315 xen_swiotlb_alloc_coherent() error: we previously assumed 'hwdev' could be null (see line 308)

# https://github.com/0day-ci/linux/commit/3e9f075c8a9790e7d58348f52270e7e57a721a31
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Christoph-Hellwig/MIPS-make-dma_sync_-_for_cpu-a-little-less-overzealous/20200909-120508
git checkout 3e9f075c8a9790e7d58348f52270e7e57a721a31
vim +/hwdev +315 drivers/xen/swiotlb-xen.c

dceb1a6819ab2c Christoph Hellwig     2017-05-21  275  
dceb1a6819ab2c Christoph Hellwig     2017-05-21  276  static void *
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  277  xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
baa676fcf8d555 Andrzej Pietrasiewicz 2012-03-27  278  			   dma_addr_t *dma_handle, gfp_t flags,
00085f1efa387a Krzysztof Kozlowski   2016-08-03  279  			   unsigned long attrs)
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  280  {
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  281  	void *ret;
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  282  	int order = get_order(size);
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  283  	u64 dma_mask = DMA_BIT_MASK(32);
6810df88dcfc22 Konrad Rzeszutek Wilk 2011-08-25  284  	phys_addr_t phys;
6810df88dcfc22 Konrad Rzeszutek Wilk 2011-08-25  285  	dma_addr_t dev_addr;
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  286  
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  287  	/*
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  288  	* Ignore region specifiers - the kernel's ideas of
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  289  	* pseudo-phys memory layout has nothing to do with the
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  290  	* machine physical layout.  We can't allocate highmem
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  291  	* because we can't return a pointer to it.
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  292  	*/
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  293  	flags &= ~(__GFP_DMA | __GFP_HIGHMEM);
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  294  
7250f422da0480 Joe Jin               2018-10-16  295  	/* Convert the size to actually allocated. */
7250f422da0480 Joe Jin               2018-10-16  296  	size = 1UL << (order + XEN_PAGE_SHIFT);
7250f422da0480 Joe Jin               2018-10-16  297  
1b65c4e5a9af1a Stefano Stabellini    2013-10-10  298  	/* On ARM this function returns an ioremap'ped virtual address for
1b65c4e5a9af1a Stefano Stabellini    2013-10-10  299  	 * which virt_to_phys doesn't return the corresponding physical
1b65c4e5a9af1a Stefano Stabellini    2013-10-10  300  	 * address. In fact on ARM virt_to_phys only works for kernel direct
1b65c4e5a9af1a Stefano Stabellini    2013-10-10  301  	 * mapped RAM memory. Also see comment below.
1b65c4e5a9af1a Stefano Stabellini    2013-10-10  302  	 */
1b65c4e5a9af1a Stefano Stabellini    2013-10-10  303  	ret = xen_alloc_coherent_pages(hwdev, size, dma_handle, flags, attrs);
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  304  
6810df88dcfc22 Konrad Rzeszutek Wilk 2011-08-25  305  	if (!ret)
6810df88dcfc22 Konrad Rzeszutek Wilk 2011-08-25  306  		return ret;
6810df88dcfc22 Konrad Rzeszutek Wilk 2011-08-25  307  
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11 @308  	if (hwdev && hwdev->coherent_dma_mask)
038d07a283d623 Christoph Hellwig     2018-03-19  309  		dma_mask = hwdev->coherent_dma_mask;
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  310  
91ffe4ad534ab2 Stefano Stabellini    2020-07-10  311  	/* At this point dma_handle is the dma address, next we are
1b65c4e5a9af1a Stefano Stabellini    2013-10-10  312  	 * going to set it to the machine address.
1b65c4e5a9af1a Stefano Stabellini    2013-10-10  313  	 * Do not use virt_to_phys(ret) because on ARM it doesn't correspond
1b65c4e5a9af1a Stefano Stabellini    2013-10-10  314  	 * to *dma_handle. */
91ffe4ad534ab2 Stefano Stabellini    2020-07-10 @315  	phys = dma_to_phys(hwdev, *dma_handle);
91ffe4ad534ab2 Stefano Stabellini    2020-07-10  316  	dev_addr = xen_phys_to_dma(hwdev, phys);
6810df88dcfc22 Konrad Rzeszutek Wilk 2011-08-25  317  	if (((dev_addr + size - 1 <= dma_mask)) &&
6810df88dcfc22 Konrad Rzeszutek Wilk 2011-08-25  318  	    !range_straddles_page_boundary(phys, size))
6810df88dcfc22 Konrad Rzeszutek Wilk 2011-08-25  319  		*dma_handle = dev_addr;
6810df88dcfc22 Konrad Rzeszutek Wilk 2011-08-25  320  	else {
1b65c4e5a9af1a Stefano Stabellini    2013-10-10  321  		if (xen_create_contiguous_region(phys, order,
69908907b02efe Stefano Stabellini    2013-10-09  322  						 fls64(dma_mask), dma_handle) != 0) {
1b65c4e5a9af1a Stefano Stabellini    2013-10-10  323  			xen_free_coherent_pages(hwdev, size, ret, (dma_addr_t)phys, attrs);
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  324  			return NULL;
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  325  		}
91ffe4ad534ab2 Stefano Stabellini    2020-07-10  326  		*dma_handle = phys_to_dma(hwdev, *dma_handle);
b877ac9815a8fe Juergen Gross         2019-06-14  327  		SetPageXenRemapped(virt_to_page(ret));
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  328  	}
6810df88dcfc22 Konrad Rzeszutek Wilk 2011-08-25  329  	memset(ret, 0, size);
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  330  	return ret;
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  331  }
b097186fd29d5b Konrad Rzeszutek Wilk 2010-05-11  332  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 50057 bytes --]

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

end of thread, other threads:[~2020-09-11  7:18 UTC | newest]

Thread overview: 86+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08 16:47 dma-mapping cleanups Christoph Hellwig
2020-09-08 16:47 ` Christoph Hellwig
2020-09-08 16:47 ` Christoph Hellwig
2020-09-08 16:47 ` [PATCH 01/12] MIPS: make dma_sync_*_for_cpu a little less overzealous Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47 ` [PATCH 02/12] MIPS/jazzdma: remove the unused vdma_remap function Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47 ` [PATCH 03/12] MIPS/jazzdma: decouple from dma-direct Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47 ` [PATCH 04/12] dma-mapping: fix DMA_OPS dependencies Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 18:04   ` Sergei Shtylyov
2020-09-08 18:04     ` Sergei Shtylyov
2020-09-08 18:04     ` Sergei Shtylyov
2020-09-11  7:10     ` Christoph Hellwig
2020-09-11  7:10       ` Christoph Hellwig
2020-09-11  7:10       ` Christoph Hellwig
2020-09-10 12:55   ` Robin Murphy
2020-09-10 12:55     ` Robin Murphy
2020-09-10 12:55     ` Robin Murphy
2020-09-11  7:09     ` Christoph Hellwig
2020-09-11  7:09       ` Christoph Hellwig
2020-09-11  7:09       ` Christoph Hellwig
2020-09-08 16:47 ` [PATCH 05/12] dma-mapping: add (back) arch_dma_mark_clean for ia64 Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47 ` [PATCH 06/12] dma-direct: remove dma_direct_{alloc,free}_pages Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-10 12:57   ` Robin Murphy
2020-09-10 12:57     ` Robin Murphy
2020-09-10 12:57     ` Robin Murphy
2020-09-08 16:47 ` [PATCH 07/12] dma-direct: lift gfp_t manipulation out of__dma_direct_alloc_pages Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-10 13:02   ` Robin Murphy
2020-09-10 13:02     ` Robin Murphy
2020-09-10 13:02     ` Robin Murphy
2020-09-08 16:47 ` [PATCH 08/12] dma-direct: use phys_to_dma_direct in dma_direct_alloc Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-10 13:03   ` Robin Murphy
2020-09-10 13:03     ` Robin Murphy
2020-09-10 13:03     ` Robin Murphy
2020-09-08 16:47 ` [PATCH 09/12] dma-direct: remove __dma_to_phys Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-10  9:45   ` Dan Carpenter
2020-09-10  9:45     ` Dan Carpenter
2020-09-11  7:12     ` Christoph Hellwig
2020-09-10 13:26   ` Robin Murphy
2020-09-10 13:26     ` Robin Murphy
2020-09-10 13:26     ` Robin Murphy
2020-09-11  7:14     ` Christoph Hellwig
2020-09-11  7:14       ` Christoph Hellwig
2020-09-11  7:14       ` Christoph Hellwig
2020-09-08 16:47 ` [PATCH 10/12] dma-direct: rename and cleanup __phys_to_dma Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-10 13:30   ` Robin Murphy
2020-09-10 13:30     ` Robin Murphy
2020-09-10 13:30     ` Robin Murphy
2020-09-08 16:47 ` [PATCH 11/12] dma-mapping: move dma_common_{mmap,get_sgtable} out of mapping.c Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` [PATCH 11/12] dma-mapping: move dma_common_{mmap, get_sgtable} " Christoph Hellwig
2020-09-10 13:34   ` [PATCH 11/12] dma-mapping: move dma_common_{mmap,get_sgtable} " Robin Murphy
2020-09-10 13:34     ` Robin Murphy
2020-09-10 13:34     ` [PATCH 11/12] dma-mapping: move dma_common_{mmap, get_sgtable} " Robin Murphy
2020-09-11  7:15     ` [PATCH 11/12] dma-mapping: move dma_common_{mmap,get_sgtable} " Christoph Hellwig
2020-09-11  7:15       ` Christoph Hellwig
2020-09-11  7:15       ` Christoph Hellwig
2020-09-08 16:47 ` [PATCH 12/12] dma-mapping: move the dma_declare_coherent_memory documentation Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-08 16:47   ` Christoph Hellwig
2020-09-10 13:51   ` Robin Murphy
2020-09-10 13:51     ` Robin Murphy
2020-09-10 13:51     ` Robin Murphy
2020-09-11  7:17     ` Christoph Hellwig
2020-09-11  7:17       ` Christoph Hellwig
2020-09-11  7:17       ` Christoph Hellwig
     [not found] ` <20200910141233.10768-1-hdanton@sina.com>
2020-09-11  7:07   ` [PATCH 03/12] MIPS/jazzdma: decouple from dma-direct Christoph Hellwig
2020-09-09 23:46 [PATCH 09/12] dma-direct: remove __dma_to_phys kernel test robot

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.