<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/dma/k3dma.c, branch v4.9.30</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: k3dma: use correct format string for debug output</title>
<updated>2016-09-07T08:08:43+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-09-06T13:17:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5f03c39978e3437398d4777215c5818e62118b2c'/>
<id>5f03c39978e3437398d4777215c5818e62118b2c</id>
<content type='text'>
The newly added k3_dma_prep_dma_cyclic function has some debug output
that uses incorrect typecasts, some of which cause a warning like:

drivers/dma/k3dma.c: In function 'k3_dma_prep_dma_cyclic':
drivers/dma/k3dma.c:589:671: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

In general, we have to print 'dma_addr_t' values using special
'%pad' format to get the correct behavior on kernels that have
a 64-bit dma_addr_t type but 32-bit pointers.

Similarly, printing size_t values should be done using the %z
modifier to get the correct behavior on 64-bit kernels.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: a7e08fa6cc78 ("k3dma: Add cyclic mode for audio")
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The newly added k3_dma_prep_dma_cyclic function has some debug output
that uses incorrect typecasts, some of which cause a warning like:

drivers/dma/k3dma.c: In function 'k3_dma_prep_dma_cyclic':
drivers/dma/k3dma.c:589:671: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

In general, we have to print 'dma_addr_t' values using special
'%pad' format to get the correct behavior on kernels that have
a 64-bit dma_addr_t type but 32-bit pointers.

Similarly, printing size_t values should be done using the %z
modifier to get the correct behavior on 64-bit kernels.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: a7e08fa6cc78 ("k3dma: Add cyclic mode for audio")
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>k3dma: Add cyclic mode for audio</title>
<updated>2016-08-31T04:39:32+00:00</updated>
<author>
<name>Andy Green</name>
<email>andy.green@linaro.org</email>
</author>
<published>2016-08-29T17:30:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a7e08fa6cc783cae797a06114d18dec73fac08b3'/>
<id>a7e08fa6cc783cae797a06114d18dec73fac08b3</id>
<content type='text'>
Currently the k3dma driver doesn't offer the cyclic mode
necessary for handling audio.

This patch adds it.

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Andy Green &lt;andy.green@linaro.org&gt;
[jstultz: Forward ported to mainline, removed a few
 bits of logic that didn't seem to have much effect]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&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>
Currently the k3dma driver doesn't offer the cyclic mode
necessary for handling audio.

This patch adds it.

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Andy Green &lt;andy.green@linaro.org&gt;
[jstultz: Forward ported to mainline, removed a few
 bits of logic that didn't seem to have much effect]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>k3dma: Fix memory handling in preparation for cyclic mode</title>
<updated>2016-08-31T04:39:32+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2016-08-29T17:30:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=36387a2b1f62b5c087c5fe6f0f7b23b94f722ad7'/>
<id>36387a2b1f62b5c087c5fe6f0f7b23b94f722ad7</id>
<content type='text'>
With cyclic mode, the shared virt-dma logic doesn't actually
manage the descriptor state, nor the calling of the descriptor
free callback. This results in leaking a desc structure every
time we start an audio transfer.

Thus we must manage it ourselves. The k3dma driver already keeps
track of the active and finished descriptors via ds_run and ds_done
pointers, so cleanup how we handle those two values, so when we
tear down everything in terminate_all, call free_desc on the ds_run
and ds_done pointers if they are not null.

NOTE: HiKey doesn't use the non-cyclic dma modes, so I'm not been
able to test those modes. But with this patch we no longer leak
the desc structures.

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&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>
With cyclic mode, the shared virt-dma logic doesn't actually
manage the descriptor state, nor the calling of the descriptor
free callback. This results in leaking a desc structure every
time we start an audio transfer.

Thus we must manage it ourselves. The k3dma driver already keeps
track of the active and finished descriptors via ds_run and ds_done
pointers, so cleanup how we handle those two values, so when we
tear down everything in terminate_all, call free_desc on the ds_run
and ds_done pointers if they are not null.

NOTE: HiKey doesn't use the non-cyclic dma modes, so I'm not been
able to test those modes. But with this patch we no longer leak
the desc structures.

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>k3dma: Fix occasional DMA ERR issue by using proper dma api</title>
<updated>2016-08-31T04:39:32+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2016-08-29T17:30:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b77f262ae351d467c22b056f6d13afeeab7ea69a'/>
<id>b77f262ae351d467c22b056f6d13afeeab7ea69a</id>
<content type='text'>
After lots of debugging on an occasional DMA ERR issue, I realized
that the desc structures which we point the dma hardware are being
allocated out of regular memory. This means when we fill the desc
structures, that data doesn't always get flushed out to memory by
the time we start the dma transfer, resulting in the dma engine getting
some null values, resulting in a DMA ERR on the first irq.

Thus, this patch adopts mechanism similar to the zx296702_dma of
allocating the desc structures from a dma pool, so the memory caching
rules are properly set to avoid this issue.

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: John Stutlz &lt;john.stultz@linaro.org&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>
After lots of debugging on an occasional DMA ERR issue, I realized
that the desc structures which we point the dma hardware are being
allocated out of regular memory. This means when we fill the desc
structures, that data doesn't always get flushed out to memory by
the time we start the dma transfer, resulting in the dma engine getting
some null values, resulting in a DMA ERR on the first irq.

Thus, this patch adopts mechanism similar to the zx296702_dma of
allocating the desc structures from a dma pool, so the memory caching
rules are properly set to avoid this issue.

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: John Stutlz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>k3dma: Fix "nobody cared" message seen on any error</title>
<updated>2016-08-31T04:39:32+00:00</updated>
<author>
<name>Andy Green</name>
<email>andy.green@linaro.org</email>
</author>
<published>2016-08-29T17:30:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0173c895ed83f4654e7d6535088973725e76f304'/>
<id>0173c895ed83f4654e7d6535088973725e76f304</id>
<content type='text'>
As it was before, as soon as the DMAC IP felt there was an error
he would return IRQ_NONE since no actual transfer had completed.

After spinning on that for 100K interrupts, Linux yanks the IRQ with
a "nobody cared" error.

This patch lets it handle the interrupt and keep the IRQ alive.

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Andy Green &lt;andy.green@linaro.org&gt;
[jstultz: Forward ported to mainline]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&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>
As it was before, as soon as the DMAC IP felt there was an error
he would return IRQ_NONE since no actual transfer had completed.

After spinning on that for 100K interrupts, Linux yanks the IRQ with
a "nobody cared" error.

This patch lets it handle the interrupt and keep the IRQ alive.

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Andy Green &lt;andy.green@linaro.org&gt;
[jstultz: Forward ported to mainline]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>k3dma: Fix dma err offsets</title>
<updated>2016-08-31T04:39:32+00:00</updated>
<author>
<name>Andy Green</name>
<email>andy.green@linaro.org</email>
</author>
<published>2016-08-29T17:30:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=aceaaa17e795b963880d71a03ab1ca9f4f597185'/>
<id>aceaaa17e795b963880d71a03ab1ca9f4f597185</id>
<content type='text'>
The offsets for ERR1 and ERR2 are wrong actually.
That's why you can never clear an error.

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Andy Green &lt;andy.green@linaro.org&gt;
[jstultz: Forward ported to mainline]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&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>
The offsets for ERR1 and ERR2 are wrong actually.
That's why you can never clear an error.

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Andy Green &lt;andy.green@linaro.org&gt;
[jstultz: Forward ported to mainline]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>k3dma: Fix hisi burst clipping</title>
<updated>2016-08-31T04:39:32+00:00</updated>
<author>
<name>Andy Green</name>
<email>andy.green@linaro.org</email>
</author>
<published>2016-08-29T17:30:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6c28a90fb30cd3fe504e7dafe0b60b733f240f8c'/>
<id>6c28a90fb30cd3fe504e7dafe0b60b733f240f8c</id>
<content type='text'>
Max burst len is a 4-bit field, but at the moment it's clipped with
a 5-bit constant... reduce it to that which can be expressed

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Andy Green &lt;andy.green@linaro.org&gt;
[jstultz: Forward ported to mainline]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&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>
Max burst len is a 4-bit field, but at the moment it's clipped with
a 5-bit constant... reduce it to that which can be expressed

Cc: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Andy Green &lt;andy@warmcat.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Andy Green &lt;andy.green@linaro.org&gt;
[jstultz: Forward ported to mainline]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'topic/dmaengine_cleanups' into for-linus</title>
<updated>2016-07-28T04:40:37+00:00</updated>
<author>
<name>Vinod Koul</name>
<email>vinod.koul@intel.com</email>
</author>
<published>2016-07-28T04:40:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4bb0439626983fdde5af3ce970bd0ba2070f5378'/>
<id>4bb0439626983fdde5af3ce970bd0ba2070f5378</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: k3dma: add missing clk_disable_unprepare() on error in k3_dma_probe()</title>
<updated>2016-07-24T06:29:15+00:00</updated>
<author>
<name>Wei Yongjun</name>
<email>yongjun_wei@trendmicro.com.cn</email>
</author>
<published>2016-07-19T11:29:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=89b90c09b5d505dcff1068054f1fc2d2704e909f'/>
<id>89b90c09b5d505dcff1068054f1fc2d2704e909f</id>
<content type='text'>
Add the missing clk_disable_unprepare() before return
from k3_dma_probe() in the error handling case.

Signed-off-by: Wei Yongjun &lt;yongjun_wei@trendmicro.com.cn&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>
Add the missing clk_disable_unprepare() before return
from k3_dma_probe() in the error handling case.

Signed-off-by: Wei Yongjun &lt;yongjun_wei@trendmicro.com.cn&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: k3dma: explicitly freeup irq</title>
<updated>2016-07-16T14:49:02+00:00</updated>
<author>
<name>Vinod Koul</name>
<email>vinod.koul@intel.com</email>
</author>
<published>2016-07-02T18:32:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=486b10a255f70735585c90d334422da65dfe43ac'/>
<id>486b10a255f70735585c90d334422da65dfe43ac</id>
<content type='text'>
dmaengine device should explicitly call devm_free_irq() when using
devm_request_irq().

The irq is still ON when devices remove is executed and irq should be
quiesced before remove is completed.

Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dmaengine device should explicitly call devm_free_irq() when using
devm_request_irq().

The irq is still ON when devices remove is executed and irq should be
quiesced before remove is completed.

Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
