<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/dma/dmaengine.c, branch v4.14.263</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.263</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.263'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-02-28T15:36:01+00:00</updated>
<entry>
<title>dmaengine: Store module owner in dma_device struct</title>
<updated>2020-02-28T15:36:01+00:00</updated>
<author>
<name>Logan Gunthorpe</name>
<email>logang@deltatee.com</email>
</author>
<published>2019-12-16T19:01:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=35557d209c94eae2be6613141d2f6f9902dc110c'/>
<id>urn:sha1:35557d209c94eae2be6613141d2f6f9902dc110c</id>
<content type='text'>
[ Upstream commit dae7a589c18a4d979d5f14b09374e871b995ceb1 ]

dma_chan_to_owner() dereferences the driver from the struct device to
obtain the owner and call module_[get|put](). However, if the backing
device is unbound before the dma_device is unregistered, the driver
will be cleared and this will cause a NULL pointer dereference.

Instead, store a pointer to the owner module in the dma_device struct
so the module reference can be properly put when the channel is put, even
if the backing device was destroyed first.

This change helps to support a safer unbind of DMA engines.
If the dma_device is unregistered in the driver's remove function,
there's no guarantee that there are no existing clients and a users
action may trigger the WARN_ONCE in dma_async_device_unregister()
which is unlikely to leave the system in a consistent state.
Instead, a better approach is to allow the backing driver to go away
and fail any subsequent requests to it.

Signed-off-by: Logan Gunthorpe &lt;logang@deltatee.com&gt;
Link: https://lore.kernel.org/r/20191216190120.21374-2-logang@deltatee.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: remove BUG_ON while registering devices</title>
<updated>2017-08-28T04:09:46+00:00</updated>
<author>
<name>Vinod Koul</name>
<email>vinod.koul@intel.com</email>
</author>
<published>2017-08-27T11:25:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3eeb5156362bd756859e8c84ceb2c22e1d4ef652'/>
<id>urn:sha1:3eeb5156362bd756859e8c84ceb2c22e1d4ef652</id>
<content type='text'>
DMAengine core has BUG_ON to check for mandatory operations and ones based
on capabilities, but they use BUG_ON, so remove and move to error returns
and logging the errors gracefully

Acked-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: remove DMA_SG as it is dead code in kernel</title>
<updated>2017-08-22T03:52:11+00:00</updated>
<author>
<name>Dave Jiang</name>
<email>dave.jiang@intel.com</email>
</author>
<published>2017-08-21T17:23:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c678fa66341c7b82a57cfed0ba3656162e970f99'/>
<id>urn:sha1:c678fa66341c7b82a57cfed0ba3656162e970f99</id>
<content type='text'>
There are no in kernel consumers for DMA_SG op. Removing operation,
dead code, and test code in dmatest.

Signed-off-by: Dave Jiang &lt;dave.jiang@intel.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Gary Hook &lt;gary.hook@amd.com&gt;
Cc: Ludovic Desroches &lt;ludovic.desroches@microchip.com&gt;
Cc: Kedareswara rao Appana &lt;appana.durga.rao@xilinx.com&gt;
Cc: Li Yang &lt;leoyang.li@nxp.com&gt;
Cc: Michal Simek &lt;michal.simek@xilinx.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</content>
</entry>
<entry>
<title>dmaengine: Fix array index out of bounds warning in __get_unmap_pool()</title>
<updated>2017-03-14T04:41:27+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.radix-linux.su/kernel/linux.git/commit/?id=23f963e91fd81f44f6b316b1c24db563354c6be8'/>
<id>urn:sha1:23f963e91fd81f44f6b316b1c24db563354c6be8</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>dmaengine: Convert ID allocation to an IDA</title>
<updated>2017-01-02T04:16:32+00:00</updated>
<author>
<name>Matthew Wilcox</name>
<email>mawilcox@microsoft.com</email>
</author>
<published>2016-12-15T16:57:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=adc064cd9f6ee7a8b426955e6a28191abc9d0e8e'/>
<id>urn:sha1:adc064cd9f6ee7a8b426955e6a28191abc9d0e8e</id>
<content type='text'>
dmaengine currently uses an IDR to allocate DMA IDs, but it only needs
to know whether IDs are in use or not; the ID to pointer functionality
of the IDR is unused.  That means it can use the more space-efficient IDA.

Signed-off-by: Matthew Wilcox &lt;mawilcox@microsoft.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
</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.radix-linux.su/kernel/linux.git/commit/?id=76d7b84bfa43f514544477d2282f9ac9796a2594'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=a365c9685438713dbf88828282c4699f571b97de'/>
<id>urn:sha1:a365c9685438713dbf88828282c4699f571b97de</id>
<content type='text'>
</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.radix-linux.su/kernel/linux.git/commit/?id=d57d3a48ca784615e839475d8bdf8f3cecf77c8d'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=dd4e91d538b3d16d5241575a3fb654a9aa50392c'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=4c4d7f878589585d32b81aab6ed4a5066fae1091'/>
<id>urn:sha1: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>
</entry>
</feed>
