<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/drivers/dma/fsldma.h, branch v3.18.26</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.18.26</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.18.26'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2014-07-14T16:02:18+00:00</updated>
<entry>
<title>dmaengine: Freescale: change descriptor release process for supporting async_tx</title>
<updated>2014-07-14T16:02:18+00:00</updated>
<author>
<name>Hongbo Zhang</name>
<email>hongbo.zhang@freescale.com</email>
</author>
<published>2014-05-21T08:03:03+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=43452fadd614b62b84e950838cb7d2419f3aafb1'/>
<id>urn:sha1:43452fadd614b62b84e950838cb7d2419f3aafb1</id>
<content type='text'>
Fix the potential risk when enable config NET_DMA and ASYNC_TX. Async_tx is
lack of support in current release process of dma descriptor, all descriptors
will be released whatever is acked or no-acked by async_tx, so there is a
potential race condition when dma engine is uesd by others clients (e.g. when
enable NET_DMA to offload TCP).

In our case, a race condition which is raised when use both of talitos and
dmaengine to offload xor is because napi scheduler will sync all pending
requests in dma channels, it affects the process of raid operations due to
ack_tx is not checked in fsl dma. The no-acked descriptor is freed which is
submitted just now, as a dependent tx, this freed descriptor trigger
BUG_ON(async_tx_test_ack(depend_tx)) in async_tx_submit().

TASK = ee1a94a0[1390] 'md0_raid5' THREAD: ecf40000 CPU: 0
GPR00: 00000001 ecf41ca0 ee44/921a94a0 0000003f 00000001 c00593e4 00000000 00000001
GPR08: 00000000 a7a7a7a7 00000001 045/920000002 42028042 100a38d4 ed576d98 00000000
GPR16: ed5a11b0 00000000 2b162000 00000200 046/920000000 2d555000 ed3015e8 c15a7aa0
GPR24: 00000000 c155fc40 00000000 ecb63220 ecf41d28 e47/92f640bb0 ef640c30 ecf41ca0
NIP [c02b048c] async_tx_submit+0x6c/0x2b4
LR [c02b068c] async_tx_submit+0x26c/0x2b4
Call Trace:
[ecf41ca0] [c02b068c] async_tx_submit+0x26c/0x2b448/92 (unreliable)
[ecf41cd0] [c02b0a4c] async_memcpy+0x240/0x25c
[ecf41d20] [c0421064] async_copy_data+0xa0/0x17c
[ecf41d70] [c0421cf4] __raid_run_ops+0x874/0xe10
[ecf41df0] [c0426ee4] handle_stripe+0x820/0x25e8
[ecf41e90] [c0429080] raid5d+0x3d4/0x5b4
[ecf41f40] [c04329b8] md_thread+0x138/0x16c
[ecf41f90] [c008277c] kthread+0x8c/0x90
[ecf41ff0] [c0011630] kernel_thread+0x4c/0x68

Another modification in this patch is the change of completed descriptors,
there is a potential risk which caused by exception interrupt, all descriptors
in ld_running list are seemed completed when an interrupt raised, it works fine
under normal condition, but if there is an exception occured, it cannot work as
our excepted. Hardware should not be depend on s/w list, the right way is to
read current descriptor address register to find the last completed descriptor.
If an interrupt is raised by an error, all descriptors in ld_running should not
be seemed finished, or these unfinished descriptors in ld_running will be
released wrongly.

A simple way to reproduce:
Enable dmatest first, then insert some bad descriptors which can trigger
Programming Error interrupts before the good descriptors. Last, the good
descriptors will be freed before they are processsed because of the exception
intrerrupt.

Note: the bad descriptors are only for simulating an exception interrupt.  This
case can illustrate the potential risk in current fsl-dma very well.

Signed-off-by: Hongbo Zhang &lt;hongbo.zhang@freescale.com&gt;
Signed-off-by: Qiang Liu &lt;qiang.liu@freescale.com&gt;
Signed-off-by: Ira W. Snyder &lt;iws@ovro.caltech.edu&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: Freescale: add suspend resume functions for DMA driver</title>
<updated>2014-07-14T16:02:18+00:00</updated>
<author>
<name>Hongbo Zhang</name>
<email>hongbo.zhang@freescale.com</email>
</author>
<published>2014-05-21T08:03:02+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=14c6a3333c8e885604fc98768d8b9a32e08110ac'/>
<id>urn:sha1:14c6a3333c8e885604fc98768d8b9a32e08110ac</id>
<content type='text'>
This patch adds suspend and resume functions for Freescale DMA driver.

Signed-off-by: Hongbo Zhang &lt;hongbo.zhang@freescale.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>DMA: Freescale: change BWC from 256 bytes to 1024 bytes</title>
<updated>2014-01-20T07:43:22+00:00</updated>
<author>
<name>Hongbo Zhang</name>
<email>hongbo.zhang@freescale.com</email>
</author>
<published>2014-01-16T06:10:53+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=0ca583a239a854fd403bf8b659cdff8c603372c9'/>
<id>urn:sha1:0ca583a239a854fd403bf8b659cdff8c603372c9</id>
<content type='text'>
Freescale DMA has a feature of BandWidth Control (ab. BWC), which is currently
256 bytes and should be changed to 1024 bytes for best DMA throughput.
Changing BWC from 256 to 1024 will improve DMA performance much, in cases
whatever one channel is running or multi channels are running simultanously,
large or small buffers are copied.  And this change doesn't impact memory
access performance remarkably, lmbench tests show that for some cases the
memory performance are decreased very slightly, while the others are even
better.
Tested on T4240.

Signed-off-by: Hongbo Zhang &lt;hongbo.zhang@freescale.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>DMA: Freescale: update driver to support 8-channel DMA engine</title>
<updated>2013-11-13T08:56:27+00:00</updated>
<author>
<name>Hongbo Zhang</name>
<email>hongbo.zhang@freescale.com</email>
</author>
<published>2013-09-26T09:33:43+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=8de7a7d95049bdbe454ade7add08d893efe5a456'/>
<id>urn:sha1:8de7a7d95049bdbe454ade7add08d893efe5a456</id>
<content type='text'>
This patch adds support to 8-channel DMA engine, thus the driver works for both
the new 8-channel and the legacy 4-channel DMA engines.

Signed-off-by: Hongbo Zhang &lt;hongbo.zhang@freescale.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: move last completed cookie into generic dma_chan structure</title>
<updated>2012-03-13T06:06:06+00:00</updated>
<author>
<name>Russell King - ARM Linux</name>
<email>linux@arm.linux.org.uk</email>
</author>
<published>2012-03-06T22:34:06+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=4d4e58de32a192fea65ab84509d17d199bd291c8'/>
<id>urn:sha1:4d4e58de32a192fea65ab84509d17d199bd291c8</id>
<content type='text'>
Every DMA engine implementation declares a last completed dma cookie
in their private dma channel structures.  This is pointless, and
forces driver specific code.  Move this out into the common dma_chan
structure.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Tested-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Acked-by: Jassi Brar &lt;jassisinghbrar@gmail.com&gt;
[imx-sdma.c &amp; mxs-dma.c]
Tested-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>fsldma: fix controller lockups</title>
<updated>2011-03-12T01:52:36+00:00</updated>
<author>
<name>Ira Snyder</name>
<email>iws@ovro.caltech.edu</email>
</author>
<published>2011-03-03T07:54:58+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f04cd40701deace2efb9edd7120e59366bda2118'/>
<id>urn:sha1:f04cd40701deace2efb9edd7120e59366bda2118</id>
<content type='text'>
Enabling poisoning in the dmapool API quickly showed that the DMA
controller was fetching descriptors that should not have been in use.
This has caused intermittent controller lockups during testing.

I have been unable to figure out the exact set of conditions which cause
this to happen. However, I believe it is related to the driver using the
hardware registers to track whether the controller is busy or not. The
code can incorrectly decide that the hardware is idle due to lag between
register writes and the hardware actually becoming busy.

To fix this, the driver has been reworked to explicitly track the state
of the hardware, rather than try to guess what it is doing based on the
register values.

This has passed dmatest with 10 threads per channel, 100000 iterations
per thread several times without error. Previously, this would fail
within a few seconds.

Signed-off-by: Ira W. Snyder &lt;iws@ovro.caltech.edu&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>fsldma: minor codingstyle and consistency fixes</title>
<updated>2011-03-12T01:52:36+00:00</updated>
<author>
<name>Ira Snyder</name>
<email>iws@ovro.caltech.edu</email>
</author>
<published>2011-03-03T07:54:57+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=31f4306c83a2daa3e348056b720de511bffe5a9b'/>
<id>urn:sha1:31f4306c83a2daa3e348056b720de511bffe5a9b</id>
<content type='text'>
This fixes some minor violations of the coding style. It also changes
the style of the device_prep_dma_*() function definitions so they are
identical.

Signed-off-by: Ira W. Snyder &lt;iws@ovro.caltech.edu&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>fsldma: use channel name in printk output</title>
<updated>2011-03-12T01:52:36+00:00</updated>
<author>
<name>Ira Snyder</name>
<email>iws@ovro.caltech.edu</email>
</author>
<published>2011-03-03T07:54:55+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b158471ef63bf399165db96e945a828096502d9d'/>
<id>urn:sha1:b158471ef63bf399165db96e945a828096502d9d</id>
<content type='text'>
This makes debugging the driver much easier when multiple channels are
running concurrently. In addition, you can see how much descriptor
memory each channel has allocated via the dmapool API in sysfs.

Signed-off-by: Ira W. Snyder &lt;iws@ovro.caltech.edu&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>fsldma: fix issue of slow dma</title>
<updated>2010-12-13T22:05:27+00:00</updated>
<author>
<name>Forrest Shi</name>
<email>b29237@freescale.com</email>
</author>
<published>2010-12-09T08:14:04+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f3c677b997757326e1f29d33060719a6a5091950'/>
<id>urn:sha1:f3c677b997757326e1f29d33060719a6a5091950</id>
<content type='text'>
Fixed fsl dma slow issue by initializing dma mode register with
bandwidth control. It boosts dma performance and should works
with 85xx board.

Signed-off-by: Forrest Shi &lt;b29237@freescale.com&gt;
Signed-off-by: Li Yang &lt;leoli@freescale.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>fsldma: major cleanups and fixes</title>
<updated>2010-02-02T21:51:42+00:00</updated>
<author>
<name>Ira Snyder</name>
<email>iws@ovro.caltech.edu</email>
</author>
<published>2010-01-06T13:34:06+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9c3a50b7d7ec45da34e73cac66cde12dd6092dd8'/>
<id>urn:sha1:9c3a50b7d7ec45da34e73cac66cde12dd6092dd8</id>
<content type='text'>
Fix locking. Use two queues in the driver, one for pending transacions, and
one for transactions which are actually running on the hardware. Call
dma_run_dependencies() on descriptor cleanup so that the async_tx API works
correctly.

There are a number of places throughout the code where lists of descriptors
are freed in a loop. Create functions to handle this, and use them instead
of open-coding the loop each time.

Signed-off-by: Ira W. Snyder &lt;iws@ovro.caltech.edu&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
</feed>
