<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers, branch v3.2.55</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>hwmon: (coretemp) Fix truncated name of alarm attributes</title>
<updated>2014-02-15T19:20:17+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>khali@linux-fr.org</email>
</author>
<published>2014-01-14T14:59:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ded881cc1a89f5da729cab818d01055b15d0b07f'/>
<id>ded881cc1a89f5da729cab818d01055b15d0b07f</id>
<content type='text'>
commit 3f9aec7610b39521c7c69d754de7265f6994c194 upstream.

When the core number exceeds 9, the size of the buffer storing the
alarm attribute name is insufficient and the attribute name is
truncated. This causes libsensors to skip these attributes as the
truncated name is not recognized.

Reported-by: Andreas Hollmann &lt;hollmann@in.tum.de&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3f9aec7610b39521c7c69d754de7265f6994c194 upstream.

When the core number exceeds 9, the size of the buffer storing the
alarm attribute name is insufficient and the attribute name is
truncated. This causes libsensors to skip these attributes as the
truncated name is not recognized.

Reported-by: Andreas Hollmann &lt;hollmann@in.tum.de&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>md/raid10: fix bug when raid10 recovery fails to recover a block.</title>
<updated>2014-02-15T19:20:17+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-01-05T23:35:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8ea69324fe0ff7b7a7d0424b8518c63358971f68'/>
<id>8ea69324fe0ff7b7a7d0424b8518c63358971f68</id>
<content type='text'>
commit e8b849158508565e0cd6bc80061124afc5879160 upstream.

commit e875ecea266a543e643b19e44cf472f1412708f9
    md/raid10 record bad blocks as needed during recovery.

added code to the "cannot recover this block" path to record a bad
block rather than fail the whole recovery.
Unfortunately this new case was placed *after* r10bio was freed rather
than *before*, yet it still uses r10bio.
This is will crash with a null dereference.

So move the freeing of r10bio down where it is safe.

Fixes: e875ecea266a543e643b19e44cf472f1412708f9
Reported-by: Damian Nowak &lt;spam@nowaker.net&gt;
URL: https://bugzilla.kernel.org/show_bug.cgi?id=68181
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e8b849158508565e0cd6bc80061124afc5879160 upstream.

commit e875ecea266a543e643b19e44cf472f1412708f9
    md/raid10 record bad blocks as needed during recovery.

added code to the "cannot recover this block" path to record a bad
block rather than fail the whole recovery.
Unfortunately this new case was placed *after* r10bio was freed rather
than *before*, yet it still uses r10bio.
This is will crash with a null dereference.

So move the freeing of r10bio down where it is safe.

Fixes: e875ecea266a543e643b19e44cf472f1412708f9
Reported-by: Damian Nowak &lt;spam@nowaker.net&gt;
URL: https://bugzilla.kernel.org/show_bug.cgi?id=68181
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>md/raid10: fix two bugs in handling of known-bad-blocks.</title>
<updated>2014-02-15T19:20:16+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-01-13T23:38:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=11bbcdfc5e8d7983403952f37543d085be5d6f58'/>
<id>11bbcdfc5e8d7983403952f37543d085be5d6f58</id>
<content type='text'>
commit b50c259e25d9260b9108dc0c2964c26e5ecbe1c1 upstream.

If we discover a bad block when reading we split the request and
potentially read some of it from a different device.

The code path of this has two bugs in RAID10.
1/ we get a spin_lock with _irq, but unlock without _irq!!
2/ The calculation of 'sectors_handled' is wrong, as can be clearly
   seen by comparison with raid1.c

This leads to at least 2 warnings and a probable crash is a RAID10
ever had known bad blocks.

Fixes: 856e08e23762dfb92ffc68fd0a8d228f9e152160
Reported-by: Damian Nowak &lt;spam@nowaker.net&gt;
URL: https://bugzilla.kernel.org/show_bug.cgi?id=68181
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b50c259e25d9260b9108dc0c2964c26e5ecbe1c1 upstream.

If we discover a bad block when reading we split the request and
potentially read some of it from a different device.

The code path of this has two bugs in RAID10.
1/ we get a spin_lock with _irq, but unlock without _irq!!
2/ The calculation of 'sectors_handled' is wrong, as can be clearly
   seen by comparison with raid1.c

This leads to at least 2 warnings and a probable crash is a RAID10
ever had known bad blocks.

Fixes: 856e08e23762dfb92ffc68fd0a8d228f9e152160
Reported-by: Damian Nowak &lt;spam@nowaker.net&gt;
URL: https://bugzilla.kernel.org/show_bug.cgi?id=68181
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>md/raid5: Fix possible confusion when multiple write errors occur.</title>
<updated>2014-02-15T19:20:16+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-01-06T02:19:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=861e3781037f4f7bafe6ae4967bd551157c8fcfc'/>
<id>861e3781037f4f7bafe6ae4967bd551157c8fcfc</id>
<content type='text'>
commit 1cc03eb93245e63b0b7a7832165efdc52e25b4e6 upstream.

commit 5d8c71f9e5fbdd95650be00294d238e27a363b5c
    md: raid5 crash during degradation

Fixed a crash in an overly simplistic way which could leave
R5_WriteError or R5_MadeGood set in the stripe cache for devices
for which it is no longer relevant.
When those devices are removed and spares added the flags are still
set and can cause incorrect behaviour.

commit 14a75d3e07c784c004b4b44b34af996b8e4ac453
    md/raid5: preferentially read from replacement device if possible.

Fixed the same bug if a more effective way, so we can now revert
the original commit.

Reported-and-tested-by: Alexander Lyakas &lt;alex.bolshoy@gmail.com&gt;
Fixes: 5d8c71f9e5fbdd95650be00294d238e27a363b5c
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 1cc03eb93245e63b0b7a7832165efdc52e25b4e6 upstream.

commit 5d8c71f9e5fbdd95650be00294d238e27a363b5c
    md: raid5 crash during degradation

Fixed a crash in an overly simplistic way which could leave
R5_WriteError or R5_MadeGood set in the stripe cache for devices
for which it is no longer relevant.
When those devices are removed and spares added the flags are still
set and can cause incorrect behaviour.

commit 14a75d3e07c784c004b4b44b34af996b8e4ac453
    md/raid5: preferentially read from replacement device if possible.

Fixed the same bug if a more effective way, so we can now revert
the original commit.

Reported-and-tested-by: Alexander Lyakas &lt;alex.bolshoy@gmail.com&gt;
Fixes: 5d8c71f9e5fbdd95650be00294d238e27a363b5c
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ahci: add PCI ID for Marvell 88SE9170 SATA controller</title>
<updated>2014-02-15T19:20:16+00:00</updated>
<author>
<name>Simon Guinot</name>
<email>sguinot@lacie.com</email>
</author>
<published>2013-12-23T12:24:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=261746390873b6266a38691442bf52ee6c6ebba6'/>
<id>261746390873b6266a38691442bf52ee6c6ebba6</id>
<content type='text'>
commit e098f5cbe9d410e7878b50f524dce36cc83ec40e upstream.

This patch adds support for the PCI ID provided by the Marvell 88SE9170
SATA controller.

Signed-off-by: Simon Guinot &lt;sguinot@lacie.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e098f5cbe9d410e7878b50f524dce36cc83ec40e upstream.

This patch adds support for the PCI ID provided by the Marvell 88SE9170
SATA controller.

Signed-off-by: Simon Guinot &lt;sguinot@lacie.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ahci: add an observed PCI ID for Marvell 88se9172 SATA controller</title>
<updated>2014-02-15T19:20:16+00:00</updated>
<author>
<name>George Spelvin</name>
<email>linux@horizon.com</email>
</author>
<published>2013-05-29T01:20:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=87ca19a6b005ebe848dedeecebf4ffe2bf714bcd'/>
<id>87ca19a6b005ebe848dedeecebf4ffe2bf714bcd</id>
<content type='text'>
commit fcce9a35f8faaa1f52236c554ef1b15d99a7537e upstream.

A third possible PCI ID, as personally observed, and found in the
pci.ids list.

Signed-off-by: George Spelvin &lt;linux@horizon.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit fcce9a35f8faaa1f52236c554ef1b15d99a7537e upstream.

A third possible PCI ID, as personally observed, and found in the
pci.ids list.

Signed-off-by: George Spelvin &lt;linux@horizon.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ahci: Use PCI_VENDOR_ID_MARVELL_EXT for 0x1b4b</title>
<updated>2014-02-15T19:20:16+00:00</updated>
<author>
<name>Myron Stowe</name>
<email>myron.stowe@redhat.com</email>
</author>
<published>2013-04-08T17:32:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=18e9b936120de9c21ca5289c2f4bf5866c3be536'/>
<id>18e9b936120de9c21ca5289c2f4bf5866c3be536</id>
<content type='text'>
commit 69fd3157363935b1e052bd76b8f8ec65e494306e upstream.

With the 0x1b4b vendor ID #define in place, convert hard-coded ID
values.

Signed-off-by: Myron Stowe &lt;myron.stowe@redhat.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Jeff Garzik &lt;jgarzik@pobox.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 69fd3157363935b1e052bd76b8f8ec65e494306e upstream.

With the 0x1b4b vendor ID #define in place, convert hard-coded ID
values.

Signed-off-by: Myron Stowe &lt;myron.stowe@redhat.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Jeff Garzik &lt;jgarzik@pobox.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm9601: work around tx fifo sync issue on dm962x</title>
<updated>2014-02-15T19:20:15+00:00</updated>
<author>
<name>Peter Korsgaard</name>
<email>peter@korsgaard.com</email>
</author>
<published>2013-12-16T10:35:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=db2d65517d27bda1164ab41aba72e13a2e56b468'/>
<id>db2d65517d27bda1164ab41aba72e13a2e56b468</id>
<content type='text'>
commit 4263c86dca5198da6bd3ad826d0b2304fbe25776 upstream.

Certain dm962x revisions contain an bug, where if a USB bulk transfer retry
(E.G. if bulk crc mismatch) happens right after a transfer with odd or
maxpacket length, the internal tx hardware fifo gets out of sync causing
the interface to stop working.

Work around it by adding up to 3 bytes of padding to ensure this situation
cannot trigger.

This workaround also means we never pass multiple-of-maxpacket size skb's
to usbnet, so the length adjustment to handle usbnet's padding of those can
be removed.

Reported-by: Joseph Chang &lt;joseph_chang@davicom.com.tw&gt;
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4263c86dca5198da6bd3ad826d0b2304fbe25776 upstream.

Certain dm962x revisions contain an bug, where if a USB bulk transfer retry
(E.G. if bulk crc mismatch) happens right after a transfer with odd or
maxpacket length, the internal tx hardware fifo gets out of sync causing
the interface to stop working.

Work around it by adding up to 3 bytes of padding to ensure this situation
cannot trigger.

This workaround also means we never pass multiple-of-maxpacket size skb's
to usbnet, so the length adjustment to handle usbnet's padding of those can
be removed.

Reported-by: Joseph Chang &lt;joseph_chang@davicom.com.tw&gt;
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm9601: fix reception of full size ethernet frames on dm9620/dm9621a</title>
<updated>2014-02-15T19:20:15+00:00</updated>
<author>
<name>Peter Korsgaard</name>
<email>peter@korsgaard.com</email>
</author>
<published>2013-12-16T10:35:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bb840e15efa58c6a827fc79703a9ee1165d543fd'/>
<id>bb840e15efa58c6a827fc79703a9ee1165d543fd</id>
<content type='text'>
commit 407900cfb54bdb2cfa228010b6697305f66b2948 upstream.

dm9620/dm9621a require room for 4 byte padding even in dm9601 (3 byte
header) mode.

Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 407900cfb54bdb2cfa228010b6697305f66b2948 upstream.

dm9620/dm9621a require room for 4 byte padding even in dm9601 (3 byte
header) mode.

Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net_dma: mark broken</title>
<updated>2014-02-15T19:20:14+00:00</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2013-12-17T18:09:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f4118c967b80fb55a7d54ec149294ea4477e5963'/>
<id>f4118c967b80fb55a7d54ec149294ea4477e5963</id>
<content type='text'>
commit 77873803363c9e831fc1d1e6895c084279090c22 upstream.

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: 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;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 77873803363c9e831fc1d1e6895c084279090c22 upstream.

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: 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;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
</feed>
