<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/dma, branch v3.13</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=v3.13</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.13'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-01-02T22:40:30Z</updated>
<entry>
<title>drivers/dma/ioat/dma.c: check DMA mapping error in ioat_dma_self_test()</title>
<updated>2014-01-02T22:40:30Z</updated>
<author>
<name>Jiang Liu</name>
<email>jiang.liu@linux.intel.com</email>
</author>
<published>2014-01-02T20:58:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3532e5660fa4b610b982fe5c09d3e8ab065c55dc'/>
<id>urn:sha1:3532e5660fa4b610b982fe5c09d3e8ab065c55dc</id>
<content type='text'>
Check DMA mapping return values in function ioat_dma_self_test() to get
rid of following warning message.

  ------------[ cut here ]------------
  WARNING: CPU: 0 PID: 1203 at lib/dma-debug.c:937 check_unmap+0x4c0/0x9a0()
  ioatdma 0000:00:04.0: DMA-API: device driver failed to check map error[device address=0x000000085191b000] [size=2000 bytes] [mapped as single]
  Modules linked in: ioatdma(+) mac_hid wmi acpi_pad lp parport hidd_generic usbhid hid ixgbe isci dca libsas ahci ptp libahci scsi_transport_sas meegaraid_sas pps_core mdio
  CPU: 0 PID: 1203 Comm: systemd-udevd Not tainted 3.13.0-rc4+ #8
  Hardware name: Intel Corporation BRICKLAND/BRICKLAND, BIOS BRIVTIIN1.86B.0044.L09.1311181644 11/18/2013
  Call Trace:
    dump_stack+0x4d/0x66
    warn_slowpath_common+0x7d/0xa0
    warn_slowpath_fmt+0x4c/0x50
    check_unmap+0x4c0/0x9a0
    debug_dma_unmap_page+0x81/0x90
    ioat_dma_self_test+0x3d2/0x680 [ioatdma]
    ioat3_dma_self_test+0x12/0x30 [ioatdma]
    ioat_probe+0xf4/0x110 [ioatdma]
    ioat3_dma_probe+0x268/0x410 [ioatdma]
    ioat_pci_probe+0x122/0x1b0 [ioatdma]
    local_pci_probe+0x45/0xa0
    pci_device_probe+0xd9/0x130
    driver_probe_device+0x171/0x490
    __driver_attach+0x93/0xa0
    bus_for_each_dev+0x6b/0xb0
    driver_attach+0x1e/0x20
    bus_add_driver+0x1f8/0x2b0
    driver_register+0x81/0x110
    __pci_register_driver+0x60/0x70
    ioat_init_module+0x89/0x1000 [ioatdma]
    do_one_initcall+0xe2/0x250
    load_module+0x2313/0x2a00
    SyS_init_module+0xd9/0x130
    system_call_fastpath+0x1a/0x1f
  ---[ end trace 990c591681d27c31 ]---
  Mapped at:
    debug_dma_map_page+0xbe/0x180
    ioat_dma_self_test+0x1ab/0x680 [ioatdma]
    ioat3_dma_self_test+0x12/0x30 [ioatdma]
    ioat_probe+0xf4/0x110 [ioatdma]
    ioat3_dma_probe+0x268/0x410 [ioatdma]

Signed-off-by: Jiang Liu &lt;jiang.liu@linux.intel.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
Cc: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>net_dma: mark broken</title>
<updated>2013-12-18T20:53:43Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2013-12-17T18:09:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=77873803363c9e831fc1d1e6895c084279090c22'/>
<id>urn:sha1:77873803363c9e831fc1d1e6895c084279090c22</id>
<content type='text'>
net_dma can cause data to be copied to a stale mapping if a
copy-on-write fault occurs during dma.  The application sees missing
data.

The following trace is triggered by modifying the kernel to WARN if it
ever triggers copy-on-write on a page that is undergoing dma:

 WARNING: CPU: 24 PID: 2529 at lib/dma-debug.c:485 debug_dma_assert_idle+0xd2/0x120()
 ioatdma 0000:00:04.0: DMA-API: cpu touching an active dma mapped page [pfn=0x16bcd9]
 Modules linked in: iTCO_wdt iTCO_vendor_support ioatdma lpc_ich pcspkr dca
 CPU: 24 PID: 2529 Comm: linbug Tainted: G        W    3.13.0-rc1+ #353
  00000000000001e5 ffff88016f45f688 ffffffff81751041 ffff88017ab0ef70
  ffff88016f45f6d8 ffff88016f45f6c8 ffffffff8104ed9c ffffffff810f3646
  ffff8801768f4840 0000000000000282 ffff88016f6cca10 00007fa2bb699349
 Call Trace:
  [&lt;ffffffff81751041&gt;] dump_stack+0x46/0x58
  [&lt;ffffffff8104ed9c&gt;] warn_slowpath_common+0x8c/0xc0
  [&lt;ffffffff810f3646&gt;] ? ftrace_pid_func+0x26/0x30
  [&lt;ffffffff8104ee86&gt;] warn_slowpath_fmt+0x46/0x50
  [&lt;ffffffff8139c062&gt;] debug_dma_assert_idle+0xd2/0x120
  [&lt;ffffffff81154a40&gt;] do_wp_page+0xd0/0x790
  [&lt;ffffffff811582ac&gt;] handle_mm_fault+0x51c/0xde0
  [&lt;ffffffff813830b9&gt;] ? copy_user_enhanced_fast_string+0x9/0x20
  [&lt;ffffffff8175fc2c&gt;] __do_page_fault+0x19c/0x530
  [&lt;ffffffff8175c196&gt;] ? _raw_spin_lock_bh+0x16/0x40
  [&lt;ffffffff810f3539&gt;] ? trace_clock_local+0x9/0x10
  [&lt;ffffffff810fa1f4&gt;] ? rb_reserve_next_event+0x64/0x310
  [&lt;ffffffffa0014c00&gt;] ? ioat2_dma_prep_memcpy_lock+0x60/0x130 [ioatdma]
  [&lt;ffffffff8175ffce&gt;] do_page_fault+0xe/0x10
  [&lt;ffffffff8175c862&gt;] page_fault+0x22/0x30
  [&lt;ffffffff81643991&gt;] ? __kfree_skb+0x51/0xd0
  [&lt;ffffffff813830b9&gt;] ? copy_user_enhanced_fast_string+0x9/0x20
  [&lt;ffffffff81388ea2&gt;] ? memcpy_toiovec+0x52/0xa0
  [&lt;ffffffff8164770f&gt;] skb_copy_datagram_iovec+0x5f/0x2a0
  [&lt;ffffffff8169d0f4&gt;] tcp_rcv_established+0x674/0x7f0
  [&lt;ffffffff816a68c5&gt;] tcp_v4_do_rcv+0x2e5/0x4a0
  [..]
 ---[ end trace e30e3b01191b7617 ]---
 Mapped at:
  [&lt;ffffffff8139c169&gt;] debug_dma_map_page+0xb9/0x160
  [&lt;ffffffff8142bf47&gt;] dma_async_memcpy_pg_to_pg+0x127/0x210
  [&lt;ffffffff8142cce9&gt;] dma_memcpy_pg_to_iovec+0x119/0x1f0
  [&lt;ffffffff81669d3c&gt;] dma_skb_copy_datagram_iovec+0x11c/0x2b0
  [&lt;ffffffff8169d1ca&gt;] tcp_rcv_established+0x74a/0x7f0:

...the problem is that the receive path falls back to cpu-copy in
several locations and this trace is just one of the areas.  A few
options were considered to fix this:

1/ sync all dma whenever a cpu copy branch is taken

2/ modify the page fault handler to hold off while dma is in-flight

Option 1 adds yet more cpu overhead to an "offload" that struggles to compete
with cpu-copy.  Option 2 adds checks for behavior that is already documented as
broken when using get_user_pages().  At a minimum a debug mode is warranted to
catch and flag these violations of the dma-api vs get_user_pages().

Thanks to David for his reproducer.

Cc: &lt;stable@vger.kernel.org&gt;
Cc: Dave Jiang &lt;dave.jiang@intel.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Alexander Duyck &lt;alexander.h.duyck@intel.com&gt;
Reported-by: David Whipple &lt;whipple@securedatainnovations.ch&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>dma: pl330: ensure DMA descriptors are zero-initialised</title>
<updated>2013-12-18T18:08:56Z</updated>
<author>
<name>Will Deacon</name>
<email>will.deacon@arm.com</email>
</author>
<published>2013-12-02T18:01:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0baf8f6a2ac86c2c40ed0cacab8ea3d17371a1bb'/>
<id>urn:sha1:0baf8f6a2ac86c2c40ed0cacab8ea3d17371a1bb</id>
<content type='text'>
I see the following splat with 3.13-rc1 when attempting to perform DMA:

[  253.004516] Alignment trap: not handling instruction e1902f9f at [&lt;c0204b40&gt;]
[  253.004583] Unhandled fault: alignment exception (0x221) at 0xdfdfdfd7
[  253.004646] Internal error: : 221 [#1] PREEMPT SMP ARM
[  253.004691] Modules linked in: dmatest(+) [last unloaded: dmatest]
[  253.004798] CPU: 0 PID: 671 Comm: kthreadd Not tainted 3.13.0-rc1+ #2
[  253.004864] task: df9b0900 ti: df03e000 task.ti: df03e000
[  253.004937] PC is at dmaengine_unmap_put+0x14/0x34
[  253.005010] LR is at pl330_tasklet+0x3c8/0x550
[  253.005087] pc : [&lt;c0204b44&gt;]    lr : [&lt;c0207478&gt;]    psr: a00e0193
[  253.005087] sp : df03fe48  ip : 00000000  fp : df03bf18
[  253.005178] r10: bf00e108  r9 : 00000001  r8 : 00000000
[  253.005245] r7 : df837040  r6 : dfb41800  r5 : df837048  r4 : df837000
[  253.005316] r3 : dfdfdfcf  r2 : dfb41f80  r1 : df837048  r0 : dfdfdfd7
[  253.005384] Flags: NzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[  253.005459] Control: 30c5387d  Table: 9fb9ba80  DAC: fffffffd
[  253.005520] Process kthreadd (pid: 671, stack limit = 0xdf03e248)

This is due to desc-&gt;txd.unmap containing garbage (uninitialised memory).

Rather than add another dummy initialisation to _init_desc, instead
ensure that the descriptors are zero-initialised during allocation and
remove the dummy, per-field initialisation.

Cc: Andriy Shevchenko &lt;andriy.shevchenko@intel.com&gt;
Acked-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
Acked-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: fix sleep in atomic</title>
<updated>2013-12-13T08:57:03Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2013-12-13T08:57:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8194ee27764b1a86fa7a6b0d411f0a225a6abd5f'/>
<id>urn:sha1:8194ee27764b1a86fa7a6b0d411f0a225a6abd5f</id>
<content type='text'>
 BUG: sleeping function called from invalid context at mm/mempool.c:203
 in_atomic(): 1, irqs_disabled(): 0, pid: 43502, name: linbug
 no locks held by linbug/43502.
 CPU: 7 PID: 43502 Comm: linbug Not tainted 3.13.0-rc1+ #15
 Hardware name:
  0000000000000010 ffff88005ebd1878 ffffffff8172d512 ffff8801752bc1c0
  ffff8801752bc1c0 ffff88005ebd1898 ffffffff8109d1f6 ffff88005f9a3c58
  ffff880177f0f080 ffff88005ebd1918 ffffffff81161f43 ffff88005ebd18f8
 Call Trace:
  [&lt;ffffffff8172d512&gt;] dump_stack+0x4e/0x68
  [&lt;ffffffff8109d1f6&gt;] __might_sleep+0xe6/0x120
  [&lt;ffffffff81161f43&gt;] mempool_alloc+0x93/0x170
  [&lt;ffffffff810c0c34&gt;] ? mark_held_locks+0x74/0x140
  [&lt;ffffffff8118a826&gt;] ? follow_page_mask+0x556/0x600
  [&lt;ffffffff814107ae&gt;] dmaengine_get_unmap_data+0x2e/0x60
  [&lt;ffffffff81410f11&gt;] dma_async_memcpy_pg_to_pg+0x41/0x1c0
  [&lt;ffffffff814110e0&gt;] dma_async_memcpy_buf_to_pg+0x50/0x60
  [&lt;ffffffff81411bdc&gt;] dma_memcpy_to_iovec+0xfc/0x190
  [&lt;ffffffff816163af&gt;] dma_skb_copy_datagram_iovec+0x6f/0x2b0

Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: mv_xor: fix oops when channels fail to initialise</title>
<updated>2013-12-13T06:48:53Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2013-12-12T23:59:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0be8253fa2b4385e6246387db1d6067366e987ba'/>
<id>urn:sha1:0be8253fa2b4385e6246387db1d6067366e987ba</id>
<content type='text'>
When a channel fails to initialise, we error out and clean up any
previously unregistered channels by walking the entire xordev-&gt;channels
array.  Unfortunately, there are paths which end up storing an error
pointer in this array, which we then try and dereference in the cleanup
code, which causes an oops.

Fix this by avoiding writing invalid pointers to this array in the first
place.

Tested-by: Aaro Koskinen &lt;aaro.koskinen@iki.fi&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>dma: mv_xor: Use dmaengine_unmap_data for the self-tests</title>
<updated>2013-12-13T06:48:53Z</updated>
<author>
<name>Ezequiel Garcia</name>
<email>ezequiel.garcia@free-electrons.com</email>
</author>
<published>2013-12-10T12:32:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d16695a75019ac4baad7a117dc86d1d292e09115'/>
<id>urn:sha1:d16695a75019ac4baad7a117dc86d1d292e09115</id>
<content type='text'>
The driver-specific unmap code was removed in:

  commit 54f8d501e842879143e867e70996574a54d1e130
  Author: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
  Date:   Fri Oct 18 19:35:32 2013 +0200

      dmaengine: remove DMA unmap from drivers

which had the side-effect of not unmapping the self-test mappings.
Fix this by using dmaengine_unmap_data in the self-test routines.

In addition, since dmaengine_unmap() assumes that all mappings were created
with dma_map_page, this commit changes the single mapping to a page mapping
to avoid an incorrect unmapping of the memcpy self-test.

The allocation could be changed to be alloc_page(), but sticking to kmalloc
results in a less intrusive patch. The size of the test buffer is increased,
since dma_map_page() seem to fail when the source and destination pages are
the same page.

Signed-off-by: Ezequiel Garcia &lt;ezequiel.garcia@free-electrons.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: fix enable for high order unmap pools</title>
<updated>2013-12-13T06:43:42Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2013-12-09T18:33:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3cc377b9ae4bd3133bf8ba388d2b2b66b2b973c1'/>
<id>urn:sha1:3cc377b9ae4bd3133bf8ba388d2b2b66b2b973c1</id>
<content type='text'>
The higher order mempools support raid operations, and we want to
disable them when raid support is not enabled.  Making them conditional
on ASYNC_TX_DMA is not sufficient as other users (specifically dmatest)
will also issue raid operations.  Make raid drivers explicitly request
that the core carry the higher order pools.

Reported-by: Ezequiel Garcia &lt;ezequiel.garcia@free-electrons.com&gt;
Tested-by: Ezequiel Garcia &lt;ezequiel.garcia@free-electrons.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>dma: fix build warnings in txx9</title>
<updated>2013-12-13T06:43:41Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2013-12-09T19:16:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8e5ee258d98a6643227d958361aec2a62559b804'/>
<id>urn:sha1:8e5ee258d98a6643227d958361aec2a62559b804</id>
<content type='text'>
The unmap rework missed this:
drivers/dma/txx9dmac.c:409:25: warning: unused variable 'ds' [-Wunused-variable]

Cc: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>dmatest: fix build warning on mips</title>
<updated>2013-12-13T06:43:41Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2013-12-09T19:16:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=745c00daf9a75bacb53d0fe8635a132673ab0b46'/>
<id>urn:sha1:745c00daf9a75bacb53d0fe8635a132673ab0b46</id>
<content type='text'>
drivers/dma/dmatest.c:543:11: warning: passing argument 1 of 'virt_to_phys' makes pointer from integer without a cast [enabled by default]

mips expects virt_to_phys() to take a pointer.  Fix up the types accordingly.

Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>dma: fix fsldma build warnings</title>
<updated>2013-12-13T06:43:41Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2013-12-09T19:16:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bbc76560d488c437dbddff72242b0a07e42a0fd0'/>
<id>urn:sha1:bbc76560d488c437dbddff72242b0a07e42a0fd0</id>
<content type='text'>
drivers/dma/fsldma.c: In function 'fsldma_cleanup_descriptor':
drivers/dma/fsldma.c:860:6: warning: unused variable 'len' [-Wunused-variable]
drivers/dma/fsldma.c:859:13: warning: unused variable 'dst' [-Wunused-variable]
drivers/dma/fsldma.c:858:13: warning: unused variable 'src' [-Wunused-variable]
drivers/dma/fsldma.c:857:17: warning: unused variable 'dev' [-Wunused-variable]
- due to unmap changes

drivers/dma/fsldma.c: In function 'fsl_dma_tx_submit':
drivers/dma/fsldma.c:428:2: warning: 'cookie' may be used uninitialized in this function [-Wuninitialized]
- long standing warning

Cc: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
Cc: Li Yang &lt;leoli@freescale.com&gt;
Cc: Zhang Wei &lt;zw@zh-kernel.org&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
</feed>
