<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/kernel/dma/remap.c, branch v5.8</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>dma-remap: align the size in dma_common_*_remap()</title>
<updated>2020-06-23T12:14:41+00:00</updated>
<author>
<name>Eric Auger</name>
<email>eric.auger@redhat.com</email>
</author>
<published>2020-06-23T12:07:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8e36baf97b252cdcafa53589e8227cbb1e85f0b0'/>
<id>8e36baf97b252cdcafa53589e8227cbb1e85f0b0</id>
<content type='text'>
Running a guest with a virtio-iommu protecting virtio devices
is broken since commit 515e5b6d90d4 ("dma-mapping: use vmap insted
of reimplementing it"). Before the conversion, the size was
page aligned in __get_vm_area_node(). Doing so fixes the
regression.

Fixes: 515e5b6d90d4 ("dma-mapping: use vmap insted of reimplementing it")
Signed-off-by: Eric Auger &lt;eric.auger@redhat.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Running a guest with a virtio-iommu protecting virtio devices
is broken since commit 515e5b6d90d4 ("dma-mapping: use vmap insted
of reimplementing it"). Before the conversion, the size was
page aligned in __get_vm_area_node(). Doing so fixes the
regression.

Fixes: 515e5b6d90d4 ("dma-mapping: use vmap insted of reimplementing it")
Signed-off-by: Eric Auger &lt;eric.auger@redhat.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'dma-mapping-5.8' of git://git.infradead.org/users/hch/dma-mapping</title>
<updated>2020-06-06T18:43:23+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-06-06T18:43:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1ee18de92927f37e6948d5a6fc73cbf89f806905'/>
<id>1ee18de92927f37e6948d5a6fc73cbf89f806905</id>
<content type='text'>
Pull dma-mapping updates from Christoph Hellwig:

 - enhance the dma pool to allow atomic allocation on x86 with AMD SEV
   (David Rientjes)

 - two small cleanups (Jason Yan and Peter Collingbourne)

* tag 'dma-mapping-5.8' of git://git.infradead.org/users/hch/dma-mapping:
  dma-contiguous: fix comment for dma_release_from_contiguous
  dma-pool: scale the default DMA coherent pool size with memory capacity
  x86/mm: unencrypted non-blocking DMA allocations use coherent pools
  dma-pool: add pool sizes to debugfs
  dma-direct: atomic allocations must come from atomic coherent pools
  dma-pool: dynamically expanding atomic pools
  dma-pool: add additional coherent pools to map to gfp mask
  dma-remap: separate DMA atomic pools from direct remap code
  dma-debug: make __dma_entry_alloc_check_leak() static
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull dma-mapping updates from Christoph Hellwig:

 - enhance the dma pool to allow atomic allocation on x86 with AMD SEV
   (David Rientjes)

 - two small cleanups (Jason Yan and Peter Collingbourne)

* tag 'dma-mapping-5.8' of git://git.infradead.org/users/hch/dma-mapping:
  dma-contiguous: fix comment for dma_release_from_contiguous
  dma-pool: scale the default DMA coherent pool size with memory capacity
  x86/mm: unencrypted non-blocking DMA allocations use coherent pools
  dma-pool: add pool sizes to debugfs
  dma-direct: atomic allocations must come from atomic coherent pools
  dma-pool: dynamically expanding atomic pools
  dma-pool: add additional coherent pools to map to gfp mask
  dma-remap: separate DMA atomic pools from direct remap code
  dma-debug: make __dma_entry_alloc_check_leak() static
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-mapping: use vmap insted of reimplementing it</title>
<updated>2020-06-02T17:59:10+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-06-02T04:50:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=515e5b6d90d410a3b0b433853c367936830a45a4'/>
<id>515e5b6d90d410a3b0b433853c367936830a45a4</id>
<content type='text'>
Replace the open coded instance of vmap with the actual function.  In
the non-contiguous (IOMMU) case this requires an extra find_vm_area,
but given that this isn't a fast path function that is a small price
to pay.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Cc: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Gao Xiang &lt;xiang@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: "K. Y. Srinivasan" &lt;kys@microsoft.com&gt;
Cc: Laura Abbott &lt;labbott@redhat.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Michael Kelley &lt;mikelley@microsoft.com&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Nitin Gupta &lt;ngupta@vflare.org&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Cc: Stephen Hemminger &lt;sthemmin@microsoft.com&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Wei Liu &lt;wei.liu@kernel.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Paul Mackerras &lt;paulus@ozlabs.org&gt;
Cc: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Link: http://lkml.kernel.org/r/20200414131348.444715-6-hch@lst.de
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace the open coded instance of vmap with the actual function.  In
the non-contiguous (IOMMU) case this requires an extra find_vm_area,
but given that this isn't a fast path function that is a small price
to pay.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Cc: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Gao Xiang &lt;xiang@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: "K. Y. Srinivasan" &lt;kys@microsoft.com&gt;
Cc: Laura Abbott &lt;labbott@redhat.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Michael Kelley &lt;mikelley@microsoft.com&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Nitin Gupta &lt;ngupta@vflare.org&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Cc: Stephen Hemminger &lt;sthemmin@microsoft.com&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Wei Liu &lt;wei.liu@kernel.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Paul Mackerras &lt;paulus@ozlabs.org&gt;
Cc: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Link: http://lkml.kernel.org/r/20200414131348.444715-6-hch@lst.de
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-remap: separate DMA atomic pools from direct remap code</title>
<updated>2020-04-20T10:08:45+00:00</updated>
<author>
<name>David Rientjes</name>
<email>rientjes@google.com</email>
</author>
<published>2020-04-15T00:04:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e860c299ac0d738b44ff91693f11e63080a29698'/>
<id>e860c299ac0d738b44ff91693f11e63080a29698</id>
<content type='text'>
DMA atomic pools will be needed beyond only CONFIG_DMA_DIRECT_REMAP so
separate them out into their own file.

This also adds a new Kconfig option that can be subsequently used for
options, such as CONFIG_AMD_MEM_ENCRYPT, that will utilize the coherent
pools but do not have a dependency on direct remapping.

For this patch alone, there is no functional change introduced.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
[hch: fixup copyrights and remove unused includes]
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
DMA atomic pools will be needed beyond only CONFIG_DMA_DIRECT_REMAP so
separate them out into their own file.

This also adds a new Kconfig option that can be subsequently used for
options, such as CONFIG_AMD_MEM_ENCRYPT, that will utilize the coherent
pools but do not have a dependency on direct remapping.

For this patch alone, there is no functional change introduced.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
[hch: fixup copyrights and remove unused includes]
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/genalloc.c: rename addr_in_gen_pool to gen_pool_has_addr</title>
<updated>2019-12-05T03:44:13+00:00</updated>
<author>
<name>Huang Shijie</name>
<email>sjhuang@iluvatar.ai</email>
</author>
<published>2019-12-05T00:52:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=964975ac6677c97ae61ec9d6969dd5d03f18d1c3'/>
<id>964975ac6677c97ae61ec9d6969dd5d03f18d1c3</id>
<content type='text'>
Follow the kernel conventions, rename addr_in_gen_pool to
gen_pool_has_addr.

[sjhuang@iluvatar.ai: fix Documentation/ too]
 Link: http://lkml.kernel.org/r/20181229015914.5573-1-sjhuang@iluvatar.ai
Link: http://lkml.kernel.org/r/20181228083950.20398-1-sjhuang@iluvatar.ai
Signed-off-by: Huang Shijie &lt;sjhuang@iluvatar.ai&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow the kernel conventions, rename addr_in_gen_pool to
gen_pool_has_addr.

[sjhuang@iluvatar.ai: fix Documentation/ too]
 Link: http://lkml.kernel.org/r/20181229015914.5573-1-sjhuang@iluvatar.ai
Link: http://lkml.kernel.org/r/20181228083950.20398-1-sjhuang@iluvatar.ai
Signed-off-by: Huang Shijie &lt;sjhuang@iluvatar.ai&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-mapping: merge the generic remapping helpers into dma-direct</title>
<updated>2019-11-11T09:52:18+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-10-29T10:06:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3acac065508f6cc60ac9d3e4b7c6cc37fd91d531'/>
<id>3acac065508f6cc60ac9d3e4b7c6cc37fd91d531</id>
<content type='text'>
Integrate the generic dma remapping implementation into the main flow.
This prepares for architectures like xtensa that use an uncached
segment for pages in the kernel mapping, but can also remap highmem
from CMA.  To simplify that implementation we now always deduct the
page from the physical address via the DMA address instead of the
virtual address.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Integrate the generic dma remapping implementation into the main flow.
This prepares for architectures like xtensa that use an uncached
segment for pages in the kernel mapping, but can also remap highmem
from CMA.  To simplify that implementation we now always deduct the
page from the physical address via the DMA address instead of the
virtual address.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-direct: provide mmap and get_sgtable method overrides</title>
<updated>2019-11-11T09:52:15+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-10-29T10:01:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=34dc0ea6bc960f1f57b2148f01a3f4da23f87013'/>
<id>34dc0ea6bc960f1f57b2148f01a3f4da23f87013</id>
<content type='text'>
For dma-direct we know that the DMA address is an encoding of the
physical address that we can trivially decode.  Use that fact to
provide implementations that do not need the arch_dma_coherent_to_pfn
architecture hook.  Note that we still can only support mmap of
non-coherent memory only if the architecture provides a way to set an
uncached bit in the page tables.  This must be true for architectures
that use the generic remap helpers, but other architectures can also
manually select it.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For dma-direct we know that the DMA address is an encoding of the
physical address that we can trivially decode.  Use that fact to
provide implementations that do not need the arch_dma_coherent_to_pfn
architecture hook.  Note that we still can only support mmap of
non-coherent memory only if the architecture provides a way to set an
uncached bit in the page tables.  This must be true for architectures
that use the generic remap helpers, but other architectures can also
manually select it.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-direct: remove the dma_handle argument to __dma_direct_alloc_pages</title>
<updated>2019-11-07T16:25:57+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-10-29T08:57:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4e1003aa56a7d60ddb048e43a7a51368fcfe36af'/>
<id>4e1003aa56a7d60ddb048e43a7a51368fcfe36af</id>
<content type='text'>
The argument isn't used anywhere, so stop passing it.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The argument isn't used anywhere, so stop passing it.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-direct: remove __dma_direct_free_pages</title>
<updated>2019-11-07T16:25:40+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-10-29T08:57:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=acaade1af3587132e7ea585f470a95261e14f60c'/>
<id>acaade1af3587132e7ea585f470a95261e14f60c</id>
<content type='text'>
We can just call dma_free_contiguous directly instead of wrapping it.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We can just call dma_free_contiguous directly instead of wrapping it.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dma-mapping: fix false positivse warnings in dma_common_free_remap()</title>
<updated>2019-10-05T08:24:17+00:00</updated>
<author>
<name>Andrey Smirnov</name>
<email>andrew.smirnov@gmail.com</email>
</author>
<published>2019-10-05T08:23:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2cf2aa6a69db0b17b3979144287af8775c1c1534'/>
<id>2cf2aa6a69db0b17b3979144287af8775c1c1534</id>
<content type='text'>
Commit 5cf4537975bb ("dma-mapping: introduce a dma_common_find_pages
helper") changed invalid input check in dma_common_free_remap() from:

    if (!area || !area-&gt;flags != VM_DMA_COHERENT)

to

    if (!area || !area-&gt;flags != VM_DMA_COHERENT || !area-&gt;pages)

which seem to produce false positives for memory obtained via
dma_common_contiguous_remap()

This triggers the following warning message when doing "reboot" on ZII
VF610 Dev Board Rev B:

WARNING: CPU: 0 PID: 1 at kernel/dma/remap.c:112 dma_common_free_remap+0x88/0x8c
trying to free invalid coherent area: 9ef82980
Modules linked in:
CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 5.3.0-rc6-next-20190820 #119
Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
Backtrace:
[&lt;8010d1ec&gt;] (dump_backtrace) from [&lt;8010d588&gt;] (show_stack+0x20/0x24)
 r7:8015ed78 r6:00000009 r5:00000000 r4:9f4d9b14
[&lt;8010d568&gt;] (show_stack) from [&lt;8077e3f0&gt;] (dump_stack+0x24/0x28)
[&lt;8077e3cc&gt;] (dump_stack) from [&lt;801197a0&gt;] (__warn.part.3+0xcc/0xe4)
[&lt;801196d4&gt;] (__warn.part.3) from [&lt;80119830&gt;] (warn_slowpath_fmt+0x78/0x94)
 r6:00000070 r5:808e540c r4:81c03048
[&lt;801197bc&gt;] (warn_slowpath_fmt) from [&lt;8015ed78&gt;] (dma_common_free_remap+0x88/0x8c)
 r3:9ef82980 r2:808e53e0
 r7:00001000 r6:a0b1e000 r5:a0b1e000 r4:00001000
[&lt;8015ecf0&gt;] (dma_common_free_remap) from [&lt;8010fa9c&gt;] (remap_allocator_free+0x60/0x68)
 r5:81c03048 r4:9f4d9b78
[&lt;8010fa3c&gt;] (remap_allocator_free) from [&lt;801100d0&gt;] (__arm_dma_free.constprop.3+0xf8/0x148)
 r5:81c03048 r4:9ef82900
[&lt;8010ffd8&gt;] (__arm_dma_free.constprop.3) from [&lt;80110144&gt;] (arm_dma_free+0x24/0x2c)
 r5:9f563410 r4:80110120
[&lt;80110120&gt;] (arm_dma_free) from [&lt;8015d80c&gt;] (dma_free_attrs+0xa0/0xdc)
[&lt;8015d76c&gt;] (dma_free_attrs) from [&lt;8020f3e4&gt;] (dma_pool_destroy+0xc0/0x154)
 r8:9efa8860 r7:808f02f0 r6:808f02d0 r5:9ef82880 r4:9ef82780
[&lt;8020f324&gt;] (dma_pool_destroy) from [&lt;805525d0&gt;] (ehci_mem_cleanup+0x6c/0x150)
 r7:9f563410 r6:9efa8810 r5:00000000 r4:9efd0148
[&lt;80552564&gt;] (ehci_mem_cleanup) from [&lt;80558e0c&gt;] (ehci_stop+0xac/0xc0)
 r5:9efd0148 r4:9efd0000
[&lt;80558d60&gt;] (ehci_stop) from [&lt;8053c4bc&gt;] (usb_remove_hcd+0xf4/0x1b0)
 r7:9f563410 r6:9efd0074 r5:81c03048 r4:9efd0000
[&lt;8053c3c8&gt;] (usb_remove_hcd) from [&lt;8056361c&gt;] (host_stop+0x48/0xb8)
 r7:9f563410 r6:9efd0000 r5:9f5f4040 r4:9f5f5040
[&lt;805635d4&gt;] (host_stop) from [&lt;80563d0c&gt;] (ci_hdrc_host_destroy+0x34/0x38)
 r7:9f563410 r6:9f5f5040 r5:9efa8800 r4:9f5f4040
[&lt;80563cd8&gt;] (ci_hdrc_host_destroy) from [&lt;8055ef18&gt;] (ci_hdrc_remove+0x50/0x10c)
[&lt;8055eec8&gt;] (ci_hdrc_remove) from [&lt;804a2ed8&gt;] (platform_drv_remove+0x34/0x4c)
 r7:9f563410 r6:81c4f99c r5:9efa8810 r4:9efa8810
[&lt;804a2ea4&gt;] (platform_drv_remove) from [&lt;804a18a8&gt;] (device_release_driver_internal+0xec/0x19c)
 r5:00000000 r4:9efa8810
[&lt;804a17bc&gt;] (device_release_driver_internal) from [&lt;804a1978&gt;] (device_release_driver+0x20/0x24)
 r7:9f563410 r6:81c41ed0 r5:9efa8810 r4:9f4a1dac
[&lt;804a1958&gt;] (device_release_driver) from [&lt;804a01b8&gt;] (bus_remove_device+0xdc/0x108)
[&lt;804a00dc&gt;] (bus_remove_device) from [&lt;8049c204&gt;] (device_del+0x150/0x36c)
 r7:9f563410 r6:81c03048 r5:9efa8854 r4:9efa8810
[&lt;8049c0b4&gt;] (device_del) from [&lt;804a3368&gt;] (platform_device_del.part.2+0x20/0x84)
 r10:9f563414 r9:809177e0 r8:81cb07dc r7:81c78320 r6:9f563454 r5:9efa8800
 r4:9efa8800
[&lt;804a3348&gt;] (platform_device_del.part.2) from [&lt;804a3420&gt;] (platform_device_unregister+0x28/0x34)
 r5:9f563400 r4:9efa8800
[&lt;804a33f8&gt;] (platform_device_unregister) from [&lt;8055dce0&gt;] (ci_hdrc_remove_device+0x1c/0x30)
 r5:9f563400 r4:00000001
[&lt;8055dcc4&gt;] (ci_hdrc_remove_device) from [&lt;805652ac&gt;] (ci_hdrc_imx_remove+0x38/0x118)
 r7:81c78320 r6:9f563454 r5:9f563410 r4:9f541010
[&lt;8056538c&gt;] (ci_hdrc_imx_shutdown) from [&lt;804a2970&gt;] (platform_drv_shutdown+0x2c/0x30)
[&lt;804a2944&gt;] (platform_drv_shutdown) from [&lt;8049e4fc&gt;] (device_shutdown+0x158/0x1f0)
[&lt;8049e3a4&gt;] (device_shutdown) from [&lt;8013ac80&gt;] (kernel_restart_prepare+0x44/0x48)
 r10:00000058 r9:9f4d8000 r8:fee1dead r7:379ce700 r6:81c0b280 r5:81c03048
 r4:00000000
[&lt;8013ac3c&gt;] (kernel_restart_prepare) from [&lt;8013ad14&gt;] (kernel_restart+0x1c/0x60)
[&lt;8013acf8&gt;] (kernel_restart) from [&lt;8013af84&gt;] (__do_sys_reboot+0xe0/0x1d8)
 r5:81c03048 r4:00000000
[&lt;8013aea4&gt;] (__do_sys_reboot) from [&lt;8013b0ec&gt;] (sys_reboot+0x18/0x1c)
 r8:80101204 r7:00000058 r6:00000000 r5:00000000 r4:00000000
[&lt;8013b0d4&gt;] (sys_reboot) from [&lt;80101000&gt;] (ret_fast_syscall+0x0/0x54)
Exception stack(0x9f4d9fa8 to 0x9f4d9ff0)
9fa0:                   00000000 00000000 fee1dead 28121969 01234567 379ce700
9fc0: 00000000 00000000 00000000 00000058 00000000 00000000 00000000 00016d04
9fe0: 00028e0c 7ec87c64 000135ec 76c1f410

Restore original invalid input check in dma_common_free_remap() to
avoid this problem.

Fixes: 5cf4537975bb ("dma-mapping: introduce a dma_common_find_pages helper")
Signed-off-by: Andrey Smirnov &lt;andrew.smirnov@gmail.com&gt;
[hch: just revert the offending hunk instead of creating a new helper]
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 5cf4537975bb ("dma-mapping: introduce a dma_common_find_pages
helper") changed invalid input check in dma_common_free_remap() from:

    if (!area || !area-&gt;flags != VM_DMA_COHERENT)

to

    if (!area || !area-&gt;flags != VM_DMA_COHERENT || !area-&gt;pages)

which seem to produce false positives for memory obtained via
dma_common_contiguous_remap()

This triggers the following warning message when doing "reboot" on ZII
VF610 Dev Board Rev B:

WARNING: CPU: 0 PID: 1 at kernel/dma/remap.c:112 dma_common_free_remap+0x88/0x8c
trying to free invalid coherent area: 9ef82980
Modules linked in:
CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 5.3.0-rc6-next-20190820 #119
Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
Backtrace:
[&lt;8010d1ec&gt;] (dump_backtrace) from [&lt;8010d588&gt;] (show_stack+0x20/0x24)
 r7:8015ed78 r6:00000009 r5:00000000 r4:9f4d9b14
[&lt;8010d568&gt;] (show_stack) from [&lt;8077e3f0&gt;] (dump_stack+0x24/0x28)
[&lt;8077e3cc&gt;] (dump_stack) from [&lt;801197a0&gt;] (__warn.part.3+0xcc/0xe4)
[&lt;801196d4&gt;] (__warn.part.3) from [&lt;80119830&gt;] (warn_slowpath_fmt+0x78/0x94)
 r6:00000070 r5:808e540c r4:81c03048
[&lt;801197bc&gt;] (warn_slowpath_fmt) from [&lt;8015ed78&gt;] (dma_common_free_remap+0x88/0x8c)
 r3:9ef82980 r2:808e53e0
 r7:00001000 r6:a0b1e000 r5:a0b1e000 r4:00001000
[&lt;8015ecf0&gt;] (dma_common_free_remap) from [&lt;8010fa9c&gt;] (remap_allocator_free+0x60/0x68)
 r5:81c03048 r4:9f4d9b78
[&lt;8010fa3c&gt;] (remap_allocator_free) from [&lt;801100d0&gt;] (__arm_dma_free.constprop.3+0xf8/0x148)
 r5:81c03048 r4:9ef82900
[&lt;8010ffd8&gt;] (__arm_dma_free.constprop.3) from [&lt;80110144&gt;] (arm_dma_free+0x24/0x2c)
 r5:9f563410 r4:80110120
[&lt;80110120&gt;] (arm_dma_free) from [&lt;8015d80c&gt;] (dma_free_attrs+0xa0/0xdc)
[&lt;8015d76c&gt;] (dma_free_attrs) from [&lt;8020f3e4&gt;] (dma_pool_destroy+0xc0/0x154)
 r8:9efa8860 r7:808f02f0 r6:808f02d0 r5:9ef82880 r4:9ef82780
[&lt;8020f324&gt;] (dma_pool_destroy) from [&lt;805525d0&gt;] (ehci_mem_cleanup+0x6c/0x150)
 r7:9f563410 r6:9efa8810 r5:00000000 r4:9efd0148
[&lt;80552564&gt;] (ehci_mem_cleanup) from [&lt;80558e0c&gt;] (ehci_stop+0xac/0xc0)
 r5:9efd0148 r4:9efd0000
[&lt;80558d60&gt;] (ehci_stop) from [&lt;8053c4bc&gt;] (usb_remove_hcd+0xf4/0x1b0)
 r7:9f563410 r6:9efd0074 r5:81c03048 r4:9efd0000
[&lt;8053c3c8&gt;] (usb_remove_hcd) from [&lt;8056361c&gt;] (host_stop+0x48/0xb8)
 r7:9f563410 r6:9efd0000 r5:9f5f4040 r4:9f5f5040
[&lt;805635d4&gt;] (host_stop) from [&lt;80563d0c&gt;] (ci_hdrc_host_destroy+0x34/0x38)
 r7:9f563410 r6:9f5f5040 r5:9efa8800 r4:9f5f4040
[&lt;80563cd8&gt;] (ci_hdrc_host_destroy) from [&lt;8055ef18&gt;] (ci_hdrc_remove+0x50/0x10c)
[&lt;8055eec8&gt;] (ci_hdrc_remove) from [&lt;804a2ed8&gt;] (platform_drv_remove+0x34/0x4c)
 r7:9f563410 r6:81c4f99c r5:9efa8810 r4:9efa8810
[&lt;804a2ea4&gt;] (platform_drv_remove) from [&lt;804a18a8&gt;] (device_release_driver_internal+0xec/0x19c)
 r5:00000000 r4:9efa8810
[&lt;804a17bc&gt;] (device_release_driver_internal) from [&lt;804a1978&gt;] (device_release_driver+0x20/0x24)
 r7:9f563410 r6:81c41ed0 r5:9efa8810 r4:9f4a1dac
[&lt;804a1958&gt;] (device_release_driver) from [&lt;804a01b8&gt;] (bus_remove_device+0xdc/0x108)
[&lt;804a00dc&gt;] (bus_remove_device) from [&lt;8049c204&gt;] (device_del+0x150/0x36c)
 r7:9f563410 r6:81c03048 r5:9efa8854 r4:9efa8810
[&lt;8049c0b4&gt;] (device_del) from [&lt;804a3368&gt;] (platform_device_del.part.2+0x20/0x84)
 r10:9f563414 r9:809177e0 r8:81cb07dc r7:81c78320 r6:9f563454 r5:9efa8800
 r4:9efa8800
[&lt;804a3348&gt;] (platform_device_del.part.2) from [&lt;804a3420&gt;] (platform_device_unregister+0x28/0x34)
 r5:9f563400 r4:9efa8800
[&lt;804a33f8&gt;] (platform_device_unregister) from [&lt;8055dce0&gt;] (ci_hdrc_remove_device+0x1c/0x30)
 r5:9f563400 r4:00000001
[&lt;8055dcc4&gt;] (ci_hdrc_remove_device) from [&lt;805652ac&gt;] (ci_hdrc_imx_remove+0x38/0x118)
 r7:81c78320 r6:9f563454 r5:9f563410 r4:9f541010
[&lt;8056538c&gt;] (ci_hdrc_imx_shutdown) from [&lt;804a2970&gt;] (platform_drv_shutdown+0x2c/0x30)
[&lt;804a2944&gt;] (platform_drv_shutdown) from [&lt;8049e4fc&gt;] (device_shutdown+0x158/0x1f0)
[&lt;8049e3a4&gt;] (device_shutdown) from [&lt;8013ac80&gt;] (kernel_restart_prepare+0x44/0x48)
 r10:00000058 r9:9f4d8000 r8:fee1dead r7:379ce700 r6:81c0b280 r5:81c03048
 r4:00000000
[&lt;8013ac3c&gt;] (kernel_restart_prepare) from [&lt;8013ad14&gt;] (kernel_restart+0x1c/0x60)
[&lt;8013acf8&gt;] (kernel_restart) from [&lt;8013af84&gt;] (__do_sys_reboot+0xe0/0x1d8)
 r5:81c03048 r4:00000000
[&lt;8013aea4&gt;] (__do_sys_reboot) from [&lt;8013b0ec&gt;] (sys_reboot+0x18/0x1c)
 r8:80101204 r7:00000058 r6:00000000 r5:00000000 r4:00000000
[&lt;8013b0d4&gt;] (sys_reboot) from [&lt;80101000&gt;] (ret_fast_syscall+0x0/0x54)
Exception stack(0x9f4d9fa8 to 0x9f4d9ff0)
9fa0:                   00000000 00000000 fee1dead 28121969 01234567 379ce700
9fc0: 00000000 00000000 00000000 00000058 00000000 00000000 00000000 00016d04
9fe0: 00028e0c 7ec87c64 000135ec 76c1f410

Restore original invalid input check in dma_common_free_remap() to
avoid this problem.

Fixes: 5cf4537975bb ("dma-mapping: introduce a dma_common_find_pages helper")
Signed-off-by: Andrey Smirnov &lt;andrew.smirnov@gmail.com&gt;
[hch: just revert the offending hunk instead of creating a new helper]
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
