<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/dma, branch v5.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.4</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-10-05T08:24:17Z</updated>
<entry>
<title>dma-mapping: fix false positivse warnings in dma_common_free_remap()</title>
<updated>2019-10-05T08:24:17Z</updated>
<author>
<name>Andrey Smirnov</name>
<email>andrew.smirnov@gmail.com</email>
</author>
<published>2019-10-05T08:23:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2cf2aa6a69db0b17b3979144287af8775c1c1534'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>Merge tag 'powerpc-5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux</title>
<updated>2019-09-20T18:48:06Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-09-20T18:48:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=45824fc0da6e46cc5d563105e1eaaf3098a686f9'/>
<id>urn:sha1:45824fc0da6e46cc5d563105e1eaaf3098a686f9</id>
<content type='text'>
Pull powerpc updates from Michael Ellerman:
 "This is a bit late, partly due to me travelling, and partly due to a
  power outage knocking out some of my test systems *while* I was
  travelling.

   - Initial support for running on a system with an Ultravisor, which
     is software that runs below the hypervisor and protects guests
     against some attacks by the hypervisor.

   - Support for building the kernel to run as a "Secure Virtual
     Machine", ie. as a guest capable of running on a system with an
     Ultravisor.

   - Some changes to our DMA code on bare metal, to allow devices with
     medium sized DMA masks (&gt; 32 &amp;&amp; &lt; 59 bits) to use more than 2GB of
     DMA space.

   - Support for firmware assisted crash dumps on bare metal (powernv).

   - Two series fixing bugs in and refactoring our PCI EEH code.

   - A large series refactoring our exception entry code to use gas
     macros, both to make it more readable and also enable some future
     optimisations.

  As well as many cleanups and other minor features &amp; fixups.

  Thanks to: Adam Zerella, Alexey Kardashevskiy, Alistair Popple, Andrew
  Donnellan, Aneesh Kumar K.V, Anju T Sudhakar, Anshuman Khandual,
  Balbir Singh, Benjamin Herrenschmidt, Cédric Le Goater, Christophe
  JAILLET, Christophe Leroy, Christopher M. Riedl, Christoph Hellwig,
  Claudio Carvalho, Daniel Axtens, David Gibson, David Hildenbrand,
  Desnes A. Nunes do Rosario, Ganesh Goudar, Gautham R. Shenoy, Greg
  Kurz, Guerney Hunt, Gustavo Romero, Halil Pasic, Hari Bathini, Joakim
  Tjernlund, Jonathan Neuschafer, Jordan Niethe, Leonardo Bras, Lianbo
  Jiang, Madhavan Srinivasan, Mahesh Salgaonkar, Mahesh Salgaonkar,
  Masahiro Yamada, Maxiwell S. Garcia, Michael Anderson, Nathan
  Chancellor, Nathan Lynch, Naveen N. Rao, Nicholas Piggin, Oliver
  O'Halloran, Qian Cai, Ram Pai, Ravi Bangoria, Reza Arbab, Ryan Grimm,
  Sam Bobroff, Santosh Sivaraj, Segher Boessenkool, Sukadev Bhattiprolu,
  Thiago Bauermann, Thiago Jung Bauermann, Thomas Gleixner, Tom
  Lendacky, Vasant Hegde"

* tag 'powerpc-5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (264 commits)
  powerpc/mm/mce: Keep irqs disabled during lockless page table walk
  powerpc: Use ftrace_graph_ret_addr() when unwinding
  powerpc/ftrace: Enable HAVE_FUNCTION_GRAPH_RET_ADDR_PTR
  ftrace: Look up the address of return_to_handler() using helpers
  powerpc: dump kernel log before carrying out fadump or kdump
  docs: powerpc: Add missing documentation reference
  powerpc/xmon: Fix output of XIVE IPI
  powerpc/xmon: Improve output of XIVE interrupts
  powerpc/mm/radix: remove useless kernel messages
  powerpc/fadump: support holes in kernel boot memory area
  powerpc/fadump: remove RMA_START and RMA_END macros
  powerpc/fadump: update documentation about option to release opalcore
  powerpc/fadump: consider f/w load area
  powerpc/opalcore: provide an option to invalidate /sys/firmware/opal/core file
  powerpc/opalcore: export /sys/firmware/opal/core for analysing opal crashes
  powerpc/fadump: update documentation about CONFIG_PRESERVE_FA_DUMP
  powerpc/fadump: add support to preserve crash data on FADUMP disabled kernel
  powerpc/fadump: improve how crashed kernel's memory is reserved
  powerpc/fadump: consider reserved ranges while releasing memory
  powerpc/fadump: make crash memory ranges array allocation generic
  ...
</content>
</entry>
<entry>
<title>Merge tag 'dma-mapping-5.4' of git://git.infradead.org/users/hch/dma-mapping</title>
<updated>2019-09-19T20:27:23Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-09-19T20:27:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=671df189537883f36cf9c7d4f9495bfac0f86627'/>
<id>urn:sha1:671df189537883f36cf9c7d4f9495bfac0f86627</id>
<content type='text'>
Pull dma-mapping updates from Christoph Hellwig:

 - add dma-mapping and block layer helpers to take care of IOMMU merging
   for mmc plus subsequent fixups (Yoshihiro Shimoda)

 - rework handling of the pgprot bits for remapping (me)

 - take care of the dma direct infrastructure for swiotlb-xen (me)

 - improve the dma noncoherent remapping infrastructure (me)

 - better defaults for -&gt;mmap, -&gt;get_sgtable and -&gt;get_required_mask
   (me)

 - cleanup mmaping of coherent DMA allocations (me)

 - various misc cleanups (Andy Shevchenko, me)

* tag 'dma-mapping-5.4' of git://git.infradead.org/users/hch/dma-mapping: (41 commits)
  mmc: renesas_sdhi_internal_dmac: Add MMC_CAP2_MERGE_CAPABLE
  mmc: queue: Fix bigger segments usage
  arm64: use asm-generic/dma-mapping.h
  swiotlb-xen: merge xen_unmap_single into xen_swiotlb_unmap_page
  swiotlb-xen: simplify cache maintainance
  swiotlb-xen: use the same foreign page check everywhere
  swiotlb-xen: remove xen_swiotlb_dma_mmap and xen_swiotlb_dma_get_sgtable
  xen: remove the exports for xen_{create,destroy}_contiguous_region
  xen/arm: remove xen_dma_ops
  xen/arm: simplify dma_cache_maint
  xen/arm: use dev_is_dma_coherent
  xen/arm: consolidate page-coherent.h
  xen/arm: use dma-noncoherent.h calls for xen-swiotlb cache maintainance
  arm: remove wrappers for the generic dma remap helpers
  dma-mapping: introduce a dma_common_find_pages helper
  dma-mapping: always use VM_DMA_COHERENT for generic DMA remap
  vmalloc: lift the arm flag for coherent mappings to common code
  dma-mapping: provide a better default -&gt;get_required_mask
  dma-mapping: remove the dma_declare_coherent_memory export
  remoteproc: don't allow modular build
  ...
</content>
</entry>
<entry>
<title>Merge branches 'arm/omap', 'arm/exynos', 'arm/smmu', 'arm/mediatek', 'arm/qcom', 'arm/renesas', 'x86/amd', 'x86/vt-d' and 'core' into next</title>
<updated>2019-09-11T10:39:19Z</updated>
<author>
<name>Joerg Roedel</name>
<email>jroedel@suse.de</email>
</author>
<published>2019-09-11T10:39:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e95adb9add75affb98570a518c902f50e5fcce1b'/>
<id>urn:sha1:e95adb9add75affb98570a518c902f50e5fcce1b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>swiotlb: Split size parameter to map/unmap APIs</title>
<updated>2019-09-11T10:34:29Z</updated>
<author>
<name>Lu Baolu</name>
<email>baolu.lu@linux.intel.com</email>
</author>
<published>2019-09-06T06:14:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3fc1ca00653db6371585e3c21c4b873b2f20e60a'/>
<id>urn:sha1:3fc1ca00653db6371585e3c21c4b873b2f20e60a</id>
<content type='text'>
This splits the size parameter to swiotlb_tbl_map_single() and
swiotlb_tbl_unmap_single() into an alloc_size and a mapping_size
parameter, where the latter one is rounded up to the iommu page
size.

Suggested-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Lu Baolu &lt;baolu.lu@linux.intel.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: introduce a dma_common_find_pages helper</title>
<updated>2019-09-04T09:13:20Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-06-03T07:14:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5cf4537975bbd5691b9ddd015d540bb92f61e322'/>
<id>urn:sha1:5cf4537975bbd5691b9ddd015d540bb92f61e322</id>
<content type='text'>
A helper to find the backing page array based on a virtual address.
This also ensures we do the same vm_flags check everywhere instead
of slightly different or missing ones in a few places.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: always use VM_DMA_COHERENT for generic DMA remap</title>
<updated>2019-09-04T09:13:20Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-08-30T06:51:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=512317401f6a337e617ec284d20dec5fa3a951ec'/>
<id>urn:sha1:512317401f6a337e617ec284d20dec5fa3a951ec</id>
<content type='text'>
Currently the generic dma remap allocator gets a vm_flags passed by
the caller that is a little confusing.  We just introduced a generic
vmalloc-level flag to identify the dma coherent allocations, so use
that everywhere and remove the now pointless argument.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: provide a better default -&gt;get_required_mask</title>
<updated>2019-09-04T09:13:19Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-08-06T12:01:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=249baa54790171438524ba97e8e0485dd6aa2762'/>
<id>urn:sha1:249baa54790171438524ba97e8e0485dd6aa2762</id>
<content type='text'>
Most dma_map_ops instances are IOMMUs that work perfectly fine in 32-bits
of IOVA space, and the generic direct mapping code already provides its
own routines that is intelligent based on the amount of memory actually
present.  Wire up the dma-direct routine for the ARM direct mapping code
as well, and otherwise default to the constant 32-bit mask.  This way
we only need to override it for the occasional odd IOMMU that requires
64-bit IOVA support, or IOMMU drivers that are more efficient if they
can fall back to the direct mapping.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: remove the dma_declare_coherent_memory export</title>
<updated>2019-09-04T09:13:19Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-08-30T06:48:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d9295532d5725e5926d76470acdfd239c8d2aad3'/>
<id>urn:sha1:d9295532d5725e5926d76470acdfd239c8d2aad3</id>
<content type='text'>
dma_declare_coherent_memory is something that the platform setup code
(which pretty much means the device tree these days) need to do so that
drivers can use the memory as declared by the platform.  Drivers
themselves have no business calling this function.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: remove the dma_mmap_from_dev_coherent export</title>
<updated>2019-09-04T09:13:19Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2019-08-30T06:40:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7a01ee42209c00e551c7cfb581be7a207a376f00'/>
<id>urn:sha1:7a01ee42209c00e551c7cfb581be7a207a376f00</id>
<content type='text'>
dma_mmap_from_dev_coherent is only used by dma_map_ops instances,
none of which is modular.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
</feed>
