<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/dma/ppc4xx, branch v3.4.45</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>dmaengine: ensure all DMA engine drivers initialize their cookies</title>
<updated>2012-03-13T06:07:42+00:00</updated>
<author>
<name>Russell King - ARM Linux</name>
<email>linux@arm.linux.org.uk</email>
</author>
<published>2012-03-06T22:36:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8ac695463f37af902e953d575d3f782e32e170da'/>
<id>8ac695463f37af902e953d575d3f782e32e170da</id>
<content type='text'>
Ensure all DMA engine drivers initialize their cookies in the same way,
so that they all behave in a similar fashion.  This means their first
issued cookie will be 2 rather than 1, and will increment to INT_MAX
before returning 1 and starting over.

In connection with this, Dan Williams said:
&gt; Russell King wrote:
&gt; &gt; Secondly, some DMA engine drivers initialize the dma_chan cookie to 0,
&gt; &gt; others to 1.  Is there a reason for this, or are these all buggy?
&gt;
&gt; I know that ioat and iop-adma expect 0 to mean "I have cleaned up this
&gt; descriptor and it is idle", and would break if zero was an in-flight
&gt; cookie value.  The reserved usage of zero is an driver internal
&gt; concern, but I have no problem formalizing it as a reserved value.

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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ensure all DMA engine drivers initialize their cookies in the same way,
so that they all behave in a similar fashion.  This means their first
issued cookie will be 2 rather than 1, and will increment to INT_MAX
before returning 1 and starting over.

In connection with this, Dan Williams said:
&gt; Russell King wrote:
&gt; &gt; Secondly, some DMA engine drivers initialize the dma_chan cookie to 0,
&gt; &gt; others to 1.  Is there a reason for this, or are these all buggy?
&gt;
&gt; I know that ioat and iop-adma expect 0 to mean "I have cleaned up this
&gt; descriptor and it is idle", and would break if zero was an in-flight
&gt; cookie value.  The reserved usage of zero is an driver internal
&gt; concern, but I have no problem formalizing it as a reserved value.

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;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: fix cookie handling in iop-adma.c and ppc4xx/adma.c</title>
<updated>2012-03-13T06:07:33+00:00</updated>
<author>
<name>Russell King - ARM Linux</name>
<email>linux@arm.linux.org.uk</email>
</author>
<published>2012-03-06T22:36:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2a926e46022ad7a03e0ac167d8c2b0d88c12c5a8'/>
<id>2a926e46022ad7a03e0ac167d8c2b0d88c12c5a8</id>
<content type='text'>
Dan Williams said:
&gt; &gt; Russell King wrote:
&gt; &gt; Firstly, we have DMA_MIN_COOKIE which has value 1 - so any cookies below
&gt; &gt; that aren't valid.  That seems sane.
&gt; &gt;
&gt; &gt; We seem to have different behaviours:
&gt; &gt;
&gt; &gt; -       cookie = c-&gt;cookie;
&gt; &gt; -       cookie++;
&gt; &gt; -       if (cookie &lt; 0)
&gt; &gt; -               cookie = 1;
&gt; &gt; -       c-&gt;cookie = cookie;
&gt; &gt; -       tx-&gt;cookie = cookie;
&gt; &gt;
&gt; &gt; c-&gt;cookie here is initialized to zero, so the first cookie given out will
&gt; &gt; be 1.  This is how most DMA engine drivers implement this.
&gt; &gt;
&gt; &gt; Then we have this:
&gt; &gt;
&gt; &gt;                cookie = chan-&gt;common.cookie;
&gt; &gt;                cookie++;
&gt; &gt;                if (cookie &lt;= 1)
&gt; &gt;                        cookie = 2;
&gt; &gt;
&gt; &gt;                /* initialize the completed cookie to be less than
&gt; &gt;                 * the most recently used cookie
&gt; &gt;                 */
&gt; &gt;                chan-&gt;common.completed_cookie = cookie - 1;
&gt; &gt;                chan-&gt;common.cookie = sw_desc-&gt;async_tx.cookie = cookie;
&gt; &gt;
&gt; &gt; Again, chan-&gt;common.cookie starts off at 0.  The first cookie given out
&gt; &gt; will be 2, and 1 will never be used.  There are three drivers which
&gt; &gt; implement it this way.
&gt; &gt;
&gt; &gt; Why is there this difference, and can these three be corrected to behave
&gt; &gt; the same way as the first (and therefore the assignment of cookies
&gt; &gt; consolidated?)
&gt;
&gt; Yes, they should be consolidated, and I believe they have drifted only
&gt; because there were no good common helpers and murphy's law took over.

So lets fix this up to use the common dma_cookie_assign() helper.

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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Dan Williams said:
&gt; &gt; Russell King wrote:
&gt; &gt; Firstly, we have DMA_MIN_COOKIE which has value 1 - so any cookies below
&gt; &gt; that aren't valid.  That seems sane.
&gt; &gt;
&gt; &gt; We seem to have different behaviours:
&gt; &gt;
&gt; &gt; -       cookie = c-&gt;cookie;
&gt; &gt; -       cookie++;
&gt; &gt; -       if (cookie &lt; 0)
&gt; &gt; -               cookie = 1;
&gt; &gt; -       c-&gt;cookie = cookie;
&gt; &gt; -       tx-&gt;cookie = cookie;
&gt; &gt;
&gt; &gt; c-&gt;cookie here is initialized to zero, so the first cookie given out will
&gt; &gt; be 1.  This is how most DMA engine drivers implement this.
&gt; &gt;
&gt; &gt; Then we have this:
&gt; &gt;
&gt; &gt;                cookie = chan-&gt;common.cookie;
&gt; &gt;                cookie++;
&gt; &gt;                if (cookie &lt;= 1)
&gt; &gt;                        cookie = 2;
&gt; &gt;
&gt; &gt;                /* initialize the completed cookie to be less than
&gt; &gt;                 * the most recently used cookie
&gt; &gt;                 */
&gt; &gt;                chan-&gt;common.completed_cookie = cookie - 1;
&gt; &gt;                chan-&gt;common.cookie = sw_desc-&gt;async_tx.cookie = cookie;
&gt; &gt;
&gt; &gt; Again, chan-&gt;common.cookie starts off at 0.  The first cookie given out
&gt; &gt; will be 2, and 1 will never be used.  There are three drivers which
&gt; &gt; implement it this way.
&gt; &gt;
&gt; &gt; Why is there this difference, and can these three be corrected to behave
&gt; &gt; the same way as the first (and therefore the assignment of cookies
&gt; &gt; consolidated?)
&gt;
&gt; Yes, they should be consolidated, and I believe they have drifted only
&gt; because there were no good common helpers and murphy's law took over.

So lets fix this up to use the common dma_cookie_assign() helper.

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;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: consolidate tx_status functions</title>
<updated>2012-03-13T06:07:14+00:00</updated>
<author>
<name>Russell King - ARM Linux</name>
<email>linux@arm.linux.org.uk</email>
</author>
<published>2012-03-06T22:35:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=96a2af41c78b1fbb1f567a3486bdc63f7b31c5fd'/>
<id>96a2af41c78b1fbb1f567a3486bdc63f7b31c5fd</id>
<content type='text'>
Now that we have the completed cookie in the dma_chan structure, we
can consolidate the tx_status functions by providing a function to set
the txstate structure and returning the DMA status.  We also provide
a separate helper to set the residue for cookies which are still in
progress.

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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we have the completed cookie in the dma_chan structure, we
can consolidate the tx_status functions by providing a function to set
the txstate structure and returning the DMA status.  We also provide
a separate helper to set the residue for cookies which are still in
progress.

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;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: consolidate assignment of DMA cookies</title>
<updated>2012-03-13T06:06:52+00:00</updated>
<author>
<name>Russell King - ARM Linux</name>
<email>linux@arm.linux.org.uk</email>
</author>
<published>2012-03-06T22:34:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=884485e1f12dcd39390f042e772cdbefc9ebb750'/>
<id>884485e1f12dcd39390f042e772cdbefc9ebb750</id>
<content type='text'>
Everyone deals with assigning DMA cookies in the same way (it's part of
the API so they should be), so lets consolidate the common code into a
helper function to avoid this duplication.

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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Everyone deals with assigning DMA cookies in the same way (it's part of
the API so they should be), so lets consolidate the common code into a
helper function to avoid this duplication.

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;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: add private header file</title>
<updated>2012-03-13T06:06:44+00:00</updated>
<author>
<name>Russell King - ARM Linux</name>
<email>linux@arm.linux.org.uk</email>
</author>
<published>2012-03-06T22:34:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d2ebfb335b0426deb1a4fb14e4e926d81ecd8235'/>
<id>d2ebfb335b0426deb1a4fb14e4e926d81ecd8235</id>
<content type='text'>
Add a local private header file to contain definitions and declarations
which should only be used by DMA engine drivers.

We also fix linux/dmaengine.h to use LINUX_DMAENGINE_H to guard against
multiple inclusion.

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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a local private header file to contain definitions and declarations
which should only be used by DMA engine drivers.

We also fix linux/dmaengine.h to use LINUX_DMAENGINE_H to guard against
multiple inclusion.

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;
</pre>
</div>
</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='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4d4e58de32a192fea65ab84509d17d199bd291c8'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'old_next' into next</title>
<updated>2011-04-06T06:21:12+00:00</updated>
<author>
<name>Vinod Koul</name>
<email>vinod.koul@intel.com</email>
</author>
<published>2011-04-06T06:21:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8194145dcc9562387d93054a4fcf79438d3c3e40'/>
<id>8194145dcc9562387d93054a4fcf79438d3c3e40</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>dma: use BUG_ON correctly in ppc4xx/adam.c, v4</title>
<updated>2011-03-31T05:37:40+00:00</updated>
<author>
<name>Coly Li</name>
<email>bosong.ly@taobao.com</email>
</author>
<published>2011-03-26T17:26:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=427cdf19b97e509e21e5d347e18d8b0b34723dfc'/>
<id>427cdf19b97e509e21e5d347e18d8b0b34723dfc</id>
<content type='text'>
This patch makes BUG_ON() usage correct in drivers/dma/ppc4xx/adam.c

Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Cc: Anatolij Gustschin &lt;agust@denx.de&gt;
Cc: Sean MacLennan &lt;smaclennan@pikatech.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Coly Li &lt;bosong.ly@taobao.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes BUG_ON() usage correct in drivers/dma/ppc4xx/adam.c

Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Cc: Anatolij Gustschin &lt;agust@denx.de&gt;
Cc: Sean MacLennan &lt;smaclennan@pikatech.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Coly Li &lt;bosong.ly@taobao.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dt/powerpc: Eliminate users of of_platform_{,un}register_driver</title>
<updated>2011-02-28T08:36:39+00:00</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@secretlab.ca</email>
</author>
<published>2011-02-23T02:59:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=000061245a6797d542854106463b6b20fbdcb12e'/>
<id>000061245a6797d542854106463b6b20fbdcb12e</id>
<content type='text'>
Get rid of old users of of_platform_driver in arch/powerpc.  Most
of_platform_driver users can be converted to use the platform_bus
directly.

Signed-off-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Get rid of old users of of_platform_driver in arch/powerpc.  Most
of_platform_driver users can be converted to use the platform_bus
directly.

Signed-off-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/dma/ppc4xx: Use printf extension %pR for struct resource</title>
<updated>2010-12-04T23:03:40+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2010-11-12T21:37:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a584bff5efae8c1d026e3a930e3d13a90264fafc'/>
<id>a584bff5efae8c1d026e3a930e3d13a90264fafc</id>
<content type='text'>
Using %pR standardizes the struct resource output.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using %pR standardizes the struct resource output.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
