<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/dma/dmaengine.c, branch linux-4.9.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>dmaengine: Fix array index out of bounds warning in __get_unmap_pool()</title>
<updated>2017-12-20T09:07:21+00:00</updated>
<author>
<name>Matthias Kaehlcke</name>
<email>mka@chromium.org</email>
</author>
<published>2017-03-13T21:30:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e30ccb5f1c7e00ee189a0991e633b3034801899c'/>
<id>e30ccb5f1c7e00ee189a0991e633b3034801899c</id>
<content type='text'>
[ Upstream commit 23f963e91fd81f44f6b316b1c24db563354c6be8 ]

This fixes the following warning when building with clang and
CONFIG_DMA_ENGINE_RAID=n :

drivers/dma/dmaengine.c:1102:11: error: array index 2 is past the end of the array (which contains 1 element) [-Werror,-Warray-bounds]
                return &amp;unmap_pool[2];
                        ^          ~
drivers/dma/dmaengine.c:1083:1: note: array 'unmap_pool' declared here
static struct dmaengine_unmap_pool unmap_pool[] = {
^
drivers/dma/dmaengine.c:1104:11: error: array index 3 is past the end of the array (which contains 1 element) [-Werror,-Warray-bounds]
                return &amp;unmap_pool[3];
                        ^          ~
drivers/dma/dmaengine.c:1083:1: note: array 'unmap_pool' declared here
static struct dmaengine_unmap_pool unmap_pool[] = {

Signed-off-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 23f963e91fd81f44f6b316b1c24db563354c6be8 ]

This fixes the following warning when building with clang and
CONFIG_DMA_ENGINE_RAID=n :

drivers/dma/dmaengine.c:1102:11: error: array index 2 is past the end of the array (which contains 1 element) [-Werror,-Warray-bounds]
                return &amp;unmap_pool[2];
                        ^          ~
drivers/dma/dmaengine.c:1083:1: note: array 'unmap_pool' declared here
static struct dmaengine_unmap_pool unmap_pool[] = {
^
drivers/dma/dmaengine.c:1104:11: error: array index 3 is past the end of the array (which contains 1 element) [-Werror,-Warray-bounds]
                return &amp;unmap_pool[3];
                        ^          ~
drivers/dma/dmaengine.c:1083:1: note: array 'unmap_pool' declared here
static struct dmaengine_unmap_pool unmap_pool[] = {

Signed-off-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: device must have at least one channel</title>
<updated>2016-08-22T06:19:07+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2016-07-27T21:32:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=76d7b84bfa43f514544477d2282f9ac9796a2594'/>
<id>76d7b84bfa43f514544477d2282f9ac9796a2594</id>
<content type='text'>
The DMA device can't be registered if it doesn't have any channels
registered at all. Moreover, it leads to memory leak and is reported by
kmemleak as (on 3.10 kernel, and same shall happen on mainline):

unreferenced object 0xffffffc09e597240 (size 64):
  comm "swapper/0", pid 1, jiffies 4294877736 (age 7060.280s)
  hex dump (first 32 bytes):
    00 00 00 00 c0 ff ff ff 30 00 00 ff 00 00 00 ff  ........0.......
    00 00 00 ff 00 00 00 ff 00 00 00 ff 00 00 00 ff  ................
  backtrace:
    [&lt;ffffffc0003079ec&gt;] create_object+0x148/0x2a0
    [&lt;ffffffc000cc150c&gt;] kmemleak_alloc+0x80/0xbc
    [&lt;ffffffc000303a7c&gt;] kmem_cache_alloc_trace+0x120/0x1ac
    [&lt;ffffffc00054771c&gt;] dma_async_device_register+0x160/0x46c
    [&lt;ffffffc000548958&gt;] foo_probe+0x1a0/0x264
    [&lt;ffffffc0005d6658&gt;] platform_drv_probe+0x14/0x20
    [&lt;ffffffc0005d50cc&gt;] driver_probe_device+0x160/0x374
    [&lt;ffffffc0005d538c&gt;] __driver_attach+0x60/0x90
    [&lt;ffffffc0005d3e78&gt;] bus_for_each_dev+0x7c/0xb0
    [&lt;ffffffc0005d4a0c&gt;] driver_attach+0x1c/0x28
    [&lt;ffffffc0005d459c&gt;] bus_add_driver+0x124/0x248
    [&lt;ffffffc0005d59cc&gt;] driver_register+0x90/0x110
    [&lt;ffffffc0005d6bf4&gt;] platform_driver_register+0x58/0x64
    [&lt;ffffffc00142a70c&gt;] foo_driver_init+0x10/0x1c
    [&lt;ffffffc000200878&gt;] do_one_initcall+0xac/0x148
    [&lt;ffffffc00140096c&gt;] kernel_init_freeable+0x1a0/0x258

Return -ENODEV from dma_async_device_register() on such a case.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@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 DMA device can't be registered if it doesn't have any channels
registered at all. Moreover, it leads to memory leak and is reported by
kmemleak as (on 3.10 kernel, and same shall happen on mainline):

unreferenced object 0xffffffc09e597240 (size 64):
  comm "swapper/0", pid 1, jiffies 4294877736 (age 7060.280s)
  hex dump (first 32 bytes):
    00 00 00 00 c0 ff ff ff 30 00 00 ff 00 00 00 ff  ........0.......
    00 00 00 ff 00 00 00 ff 00 00 00 ff 00 00 00 ff  ................
  backtrace:
    [&lt;ffffffc0003079ec&gt;] create_object+0x148/0x2a0
    [&lt;ffffffc000cc150c&gt;] kmemleak_alloc+0x80/0xbc
    [&lt;ffffffc000303a7c&gt;] kmem_cache_alloc_trace+0x120/0x1ac
    [&lt;ffffffc00054771c&gt;] dma_async_device_register+0x160/0x46c
    [&lt;ffffffc000548958&gt;] foo_probe+0x1a0/0x264
    [&lt;ffffffc0005d6658&gt;] platform_drv_probe+0x14/0x20
    [&lt;ffffffc0005d50cc&gt;] driver_probe_device+0x160/0x374
    [&lt;ffffffc0005d538c&gt;] __driver_attach+0x60/0x90
    [&lt;ffffffc0005d3e78&gt;] bus_for_each_dev+0x7c/0xb0
    [&lt;ffffffc0005d4a0c&gt;] driver_attach+0x1c/0x28
    [&lt;ffffffc0005d459c&gt;] bus_add_driver+0x124/0x248
    [&lt;ffffffc0005d59cc&gt;] driver_register+0x90/0x110
    [&lt;ffffffc0005d6bf4&gt;] platform_driver_register+0x58/0x64
    [&lt;ffffffc00142a70c&gt;] foo_driver_init+0x10/0x1c
    [&lt;ffffffc000200878&gt;] do_one_initcall+0xac/0x148
    [&lt;ffffffc00140096c&gt;] kernel_init_freeable+0x1a0/0x258

Return -ENODEV from dma_async_device_register() on such a case.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'topic/core' into for-linus</title>
<updated>2016-05-17T04:43:40+00:00</updated>
<author>
<name>Vinod Koul</name>
<email>vinod.koul@intel.com</email>
</author>
<published>2016-05-17T04:43:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a365c9685438713dbf88828282c4699f571b97de'/>
<id>a365c9685438713dbf88828282c4699f571b97de</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: core: Use IS_ENABLED() instead of checking for built-in or module</title>
<updated>2016-05-14T08:02:03+00:00</updated>
<author>
<name>Javier Martinez Canillas</name>
<email>javier@osg.samsung.com</email>
</author>
<published>2016-05-11T17:39:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d57d3a48ca784615e839475d8bdf8f3cecf77c8d'/>
<id>d57d3a48ca784615e839475d8bdf8f3cecf77c8d</id>
<content type='text'>
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Signed-off-by: Javier Martinez Canillas &lt;javier@osg.samsung.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>
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Signed-off-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: slave means at least one of DMA_SLAVE, DMA_CYCLIC</title>
<updated>2016-05-12T05:44:56+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2016-05-10T17:43:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=dd4e91d538b3d16d5241575a3fb654a9aa50392c'/>
<id>dd4e91d538b3d16d5241575a3fb654a9aa50392c</id>
<content type='text'>
When check for capabilities recognize slave support by either DMA_SLAVE or
DMA_CYCLIC bit set. If we don't do that the user can't get a normally worked
DMA support for engines that doesn't have one of the mentioned bits set.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.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>
When check for capabilities recognize slave support by either DMA_SLAVE or
DMA_CYCLIC bit set. If we don't do that the user can't get a normally worked
DMA support for engines that doesn't have one of the mentioned bits set.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: core: Revert back to pr_debug in __dma_request_channel()</title>
<updated>2016-04-13T15:39:21+00:00</updated>
<author>
<name>Jarkko Nikula</name>
<email>jarkko.nikula@linux.intel.com</email>
</author>
<published>2016-04-07T13:49:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4c4d7f878589585d32b81aab6ed4a5066fae1091'/>
<id>4c4d7f878589585d32b81aab6ed4a5066fae1091</id>
<content type='text'>
Commit ef859312c3a1 ("dmaengine: core: Use dev_ functions for debug and
error prints") wasn't quite right in __dma_request_channel() by claiming
that all pr_ prints have valid DMA channel pointer. Obviously it is not
true as __dma_request_channel() is looking for a channel and returns NULL
if it does not find it.

Prevent this potential NULL pointer dereference by reverting back to
pr_debug().

Signed-off-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.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>
Commit ef859312c3a1 ("dmaengine: core: Use dev_ functions for debug and
error prints") wasn't quite right in __dma_request_channel() by claiming
that all pr_ prints have valid DMA channel pointer. Obviously it is not
true as __dma_request_channel() is looking for a channel and returns NULL
if it does not find it.

Prevent this potential NULL pointer dereference by reverting back to
pr_debug().

Signed-off-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: add DMA_CYCLIC to dma_get_slave_caps</title>
<updated>2016-04-05T22:31:33+00:00</updated>
<author>
<name>Vinod Koul</name>
<email>vinod.koul@intel.com</email>
</author>
<published>2016-04-05T22:31:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b2d8984f3e7c84303e4d1cbd40d9e8cefd3c9737'/>
<id>b2d8984f3e7c84303e4d1cbd40d9e8cefd3c9737</id>
<content type='text'>
dma_get_slave_caps() API only checked for slave capability where
we use slave capabilities for cyclic dma operations as well, so we
should add the cyclic case here too.

Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dma_get_slave_caps() API only checked for slave capability where
we use slave capabilities for cyclic dma operations as well, so we
should add the cyclic case here too.

Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: core: Use dev_ functions for debug and error prints</title>
<updated>2016-04-04T13:19:06+00:00</updated>
<author>
<name>Jarkko Nikula</name>
<email>jarkko.nikula@linux.intel.com</email>
</author>
<published>2016-03-14T14:51:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ef859312c3a16b42f398e6dbb14de23bffd5dd41'/>
<id>ef859312c3a16b42f398e6dbb14de23bffd5dd41</id>
<content type='text'>
According to dmaengine kerneldoc the struct dma_chan has always a non-NULL
pointer to DMA device and a test in dma_async_device_register()
validates that DMA device must also point to struct device.

All pr_ prints except one in dma_channel_table_init() have valid DMA
channel or DMA device pointer available which allow convert them to use
dev_ functions and thus able to show the associated DMA device.

Signed-off-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.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>
According to dmaengine kerneldoc the struct dma_chan has always a non-NULL
pointer to DMA device and a test in dma_async_device_register()
validates that DMA device must also point to struct device.

All pr_ prints except one in dma_channel_table_init() have valid DMA
channel or DMA device pointer available which allow convert them to use
dev_ functions and thus able to show the associated DMA device.

Signed-off-by: Jarkko Nikula &lt;jarkko.nikula@linux.intel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dmaengine: core: expose max burst capability to clients</title>
<updated>2016-02-09T03:31:41+00:00</updated>
<author>
<name>Shawn Lin</name>
<email>shawn.lin@rock-chips.com</email>
</author>
<published>2016-01-22T11:06:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6d5bbed30f89acd2ae0d23b3fff5b13b307525d9'/>
<id>6d5bbed30f89acd2ae0d23b3fff5b13b307525d9</id>
<content type='text'>
This patch add max_burst to dma_get_slave_caps for clients
to get the burst capability of slave dma controller.

Signed-off-by: Shawn Lin &lt;shawn.lin@rock-chips.com&gt;
Signed-off-by: Caesar Wang &lt;wxt@rock-chips.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 add max_burst to dma_get_slave_caps for clients
to get the burst capability of slave dma controller.

Signed-off-by: Shawn Lin &lt;shawn.lin@rock-chips.com&gt;
Signed-off-by: Caesar Wang &lt;wxt@rock-chips.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'topic/async' into for-linus</title>
<updated>2016-01-06T09:47:47+00:00</updated>
<author>
<name>Vinod Koul</name>
<email>vinod.koul@intel.com</email>
</author>
<published>2016-01-06T09:47:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d3f1e93ce8e00be19711c35f0c67c54a58aea559'/>
<id>d3f1e93ce8e00be19711c35f0c67c54a58aea559</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
