<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/dma, branch v5.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.6</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-03-23T06:18:34Z</updated>
<entry>
<title>dmaengine: ti: k3-udma-glue: Fix an error handling path in 'k3_udma_glue_cfg_rx_flow()'</title>
<updated>2020-03-23T06:18:34Z</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2020-03-18T19:12:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=018af9be3dd54e6f24f828966bdd873f4d63ad9b'/>
<id>urn:sha1:018af9be3dd54e6f24f828966bdd873f4d63ad9b</id>
<content type='text'>
All but one error handling paths in the 'k3_udma_glue_cfg_rx_flow()'
function 'goto err' and call 'k3_udma_glue_release_rx_flow()'.

This not correct because this function has a 'channel-&gt;flows_ready--;' at
the end, but 'flows_ready' has not been incremented here, when we branch to
the error handling path.

In order to keep a correct value in 'flows_ready', un-roll
'k3_udma_glue_release_rx_flow()', simplify it, add some labels and branch
at the correct places when an error is detected.

Doing so, we also NULLify 'flow-&gt;udma_rflow' in a path that was lacking it.

Fixes: d70241913413 ("dmaengine: ti: k3-udma: Add glue layer for non DMAengine user")
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Acked-by: Peter Ujfalusi &lt;peter.ujfalusi@ti.com&gt;
Link: https://lore.kernel.org/r/20200318191209.1267-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: idxd: fix off by one on cdev dwq refcount</title>
<updated>2020-03-23T06:02:06Z</updated>
<author>
<name>Dave Jiang</name>
<email>dave.jiang@intel.com</email>
</author>
<published>2020-03-12T16:23:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=988aad2f111c768c66efc87d073c73ecb32b682c'/>
<id>urn:sha1:988aad2f111c768c66efc87d073c73ecb32b682c</id>
<content type='text'>
The refcount check for dedicated workqueue (dwq) is off by one and allows
more than 1 user to open the char device. Fix check so only a single user
can open the device.

Fixes: 42d279f9137a ("dmaengine: idxd: add char driver to expose submission portal to userland")
Signed-off-by: Dave Jiang &lt;dave.jiang@intel.com&gt;
Link: https://lore.kernel.org/r/158403020187.10208.14117394394540710774.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: move .device_release missing log warning to debug level</title>
<updated>2020-03-11T09:12:59Z</updated>
<author>
<name>Vinod Koul</name>
<email>vkoul@kernel.org</email>
</author>
<published>2020-03-06T13:50:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f91da3bd21721c05cc7054156fa993edbb16777a'/>
<id>urn:sha1:f91da3bd21721c05cc7054156fa993edbb16777a</id>
<content type='text'>
Dmaengine core warns the drivers registering for missing .device_release
implementation. The warning is accurate for dmaengine controllers which
hotplug but not for rest.

So reduce this to a debug log.

Link: https://lore.kernel.org/r/20200306135018.2286959-1-vkoul@kernel.org
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: imx-sdma: Fix the event id check to include RX event for UART6</title>
<updated>2020-02-25T08:45:26Z</updated>
<author>
<name>Frieder Schrempf</name>
<email>frieder.schrempf@kontron.de</email>
</author>
<published>2020-02-25T08:23:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=25962e1a7f1d522f1b57ead2f266fab570042a70'/>
<id>urn:sha1:25962e1a7f1d522f1b57ead2f266fab570042a70</id>
<content type='text'>
On i.MX6UL/ULL and i.MX6SX the DMA event id for the RX channel of
UART6 is '0'. To fix the broken DMA support for UART6, we change
the check for event_id0 to include '0' as a valid id.

Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
Signed-off-by: Frieder Schrempf &lt;frieder.schrempf@kontron.de&gt;
Reviewed-by: Fabio Estevam &lt;festevam@gmail.com&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200225082139.7646-1-frieder.schrempf@kontron.de
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: tegra-apb: Prevent race conditions of tasklet vs free list</title>
<updated>2020-02-25T06:27:09Z</updated>
<author>
<name>Dmitry Osipenko</name>
<email>digetx@gmail.com</email>
</author>
<published>2020-02-09T16:33:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c33ee1301c393a241d6424e36eff1071811b1064'/>
<id>urn:sha1:c33ee1301c393a241d6424e36eff1071811b1064</id>
<content type='text'>
The interrupt handler puts a half-completed DMA descriptor on a free list
and then schedules tasklet to process bottom half of the descriptor that
executes client's callback, this creates possibility to pick up the busy
descriptor from the free list. Thus, let's disallow descriptor's re-use
until it is fully processed.

Signed-off-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Acked-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20200209163356.6439-3-digetx@gmail.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: tegra-apb: Fix use-after-free</title>
<updated>2020-02-25T06:27:09Z</updated>
<author>
<name>Dmitry Osipenko</name>
<email>digetx@gmail.com</email>
</author>
<published>2020-02-09T16:33:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=94788af4ed039476ff3527b0e6a12c1dc42cb022'/>
<id>urn:sha1:94788af4ed039476ff3527b0e6a12c1dc42cb022</id>
<content type='text'>
I was doing some experiments with I2C and noticed that Tegra APB DMA
driver crashes sometime after I2C DMA transfer termination. The crash
happens because tegra_dma_terminate_all() bails out immediately if pending
list is empty, and thus, it doesn't release the half-completed descriptors
which are getting re-used before ISR tasklet kicks-in.

 tegra-i2c 7000c400.i2c: DMA transfer timeout
 elants_i2c 0-0010: elants_i2c_irq: failed to read data: -110
 ------------[ cut here ]------------
 WARNING: CPU: 0 PID: 142 at lib/list_debug.c:45 __list_del_entry_valid+0x45/0xac
 list_del corruption, ddbaac44-&gt;next is LIST_POISON1 (00000100)
 Modules linked in:
 CPU: 0 PID: 142 Comm: kworker/0:2 Not tainted 5.5.0-rc2-next-20191220-00175-gc3605715758d-dirty #538
 Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
 Workqueue: events_freezable_power_ thermal_zone_device_check
 [&lt;c010e5c5&gt;] (unwind_backtrace) from [&lt;c010a1c5&gt;] (show_stack+0x11/0x14)
 [&lt;c010a1c5&gt;] (show_stack) from [&lt;c0973925&gt;] (dump_stack+0x85/0x94)
 [&lt;c0973925&gt;] (dump_stack) from [&lt;c011f529&gt;] (__warn+0xc1/0xc4)
 [&lt;c011f529&gt;] (__warn) from [&lt;c011f7e9&gt;] (warn_slowpath_fmt+0x61/0x78)
 [&lt;c011f7e9&gt;] (warn_slowpath_fmt) from [&lt;c042497d&gt;] (__list_del_entry_valid+0x45/0xac)
 [&lt;c042497d&gt;] (__list_del_entry_valid) from [&lt;c047a87f&gt;] (tegra_dma_tasklet+0x5b/0x154)
 [&lt;c047a87f&gt;] (tegra_dma_tasklet) from [&lt;c0124799&gt;] (tasklet_action_common.constprop.0+0x41/0x7c)
 [&lt;c0124799&gt;] (tasklet_action_common.constprop.0) from [&lt;c01022ab&gt;] (__do_softirq+0xd3/0x2a8)
 [&lt;c01022ab&gt;] (__do_softirq) from [&lt;c0124683&gt;] (irq_exit+0x7b/0x98)
 [&lt;c0124683&gt;] (irq_exit) from [&lt;c0168c19&gt;] (__handle_domain_irq+0x45/0x80)
 [&lt;c0168c19&gt;] (__handle_domain_irq) from [&lt;c043e429&gt;] (gic_handle_irq+0x45/0x7c)
 [&lt;c043e429&gt;] (gic_handle_irq) from [&lt;c0101aa5&gt;] (__irq_svc+0x65/0x94)
 Exception stack(0xde2ebb90 to 0xde2ebbd8)

Signed-off-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Acked-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20200209163356.6439-2-digetx@gmail.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: imx-sdma: fix context cache</title>
<updated>2020-02-24T16:57:05Z</updated>
<author>
<name>Martin Fuzzey</name>
<email>martin.fuzzey@flowbird.group</email>
</author>
<published>2020-01-29T13:40:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d288bddd8374e0a043ac9dde64a1ae6a09411d74'/>
<id>urn:sha1:d288bddd8374e0a043ac9dde64a1ae6a09411d74</id>
<content type='text'>
There is a DMA problem with the serial ports on i.MX6.

When the following sequence is performed:

1) Open a port
2) Write some data
3) Close the port
4) Open a *different* port
5) Write some data
6) Close the port

The second write sends nothing and the second close hangs.
If the first close() is omitted it works.

Adding logs to the the UART driver shows that the DMA is being setup but
the callback is never invoked for the second write.

This used to work in 4.19.

Git bisect leads to:
	ad0d92d: "dmaengine: imx-sdma: refine to load context only once"

This commit adds a "context_loaded" flag used to avoid unnecessary context
setups.
However the flag is only reset in sdma_channel_terminate_work(),
which is only invoked in a worker triggered by sdma_terminate_all() IF
there is an active descriptor.

So, if no active descriptor remains when the channel is terminated, the
flag is not reset and, when the channel is later reused the old context
is used.

Fix the problem by always resetting the flag in sdma_free_chan_resources().

Cc: stable@vger.kernel.org
Signed-off-by: Martin Fuzzey &lt;martin.fuzzey@flowbird.group&gt;
Fixes: ad0d92d7ba6a ("dmaengine: imx-sdma: refine to load context only once")
Reviewed-by: Fabio Estevam &lt;festevam@gmail.com&gt;
Link: https://lore.kernel.org/r/1580305274-27274-1-git-send-email-martin.fuzzey@flowbird.group
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: idxd: wq size configuration needs to check global max size</title>
<updated>2020-02-24T16:32:34Z</updated>
<author>
<name>Dave Jiang</name>
<email>dave.jiang@intel.com</email>
</author>
<published>2020-02-19T17:24:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=50e7e7f6f2d040dd16a636f408eab9184abc63f8'/>
<id>urn:sha1:50e7e7f6f2d040dd16a636f408eab9184abc63f8</id>
<content type='text'>
The current size_store() function for idxd sysfs does not check the total
wq size. This allows configuration of all wqs with total wq size. Add check
to make sure the wq sysfs attribute rejects storing of size over the total
wq size.

Fixes: c52ca478233c ("dmaengine: idxd: add configuration component of driver")
Reported-by: Jerry Chen &lt;jerry.t.chen@intel.com&gt;
Signed-off-by: Dave Jiang &lt;dave.jiang@intel.com&gt;
Link: https://lore.kernel.org/r/158213309629.2509.3583411832507185041.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: idxd: sysfs input of wq incorrect wq type should return error</title>
<updated>2020-02-24T16:32:34Z</updated>
<author>
<name>Dave Jiang</name>
<email>dave.jiang@intel.com</email>
</author>
<published>2020-02-19T17:24:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=88402c5b1ba7498217027c8a54e8df61d030500c'/>
<id>urn:sha1:88402c5b1ba7498217027c8a54e8df61d030500c</id>
<content type='text'>
Currently when inputing an unrecognized wq type, we set the wq type to
"none". It really should return error and not change the existing wq type
that's in the kernel.

Fixes: c52ca478233c ("dmaengine: idxd: add configuration component of driver")
Reported-by: Yixin Zhang &lt;yixin.zhang@intel.com&gt;
Signed-off-by: Dave Jiang &lt;dave.jiang@intel.com&gt;
Link: https://lore.kernel.org/r/158213304803.2290.13336343633425868211.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: coh901318: Fix a double lock bug in dma_tc_handle()</title>
<updated>2020-02-24T16:29:45Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2020-02-17T14:40:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=36d5d22090d13fd3a7a8c9663a711cbe6970aac8'/>
<id>urn:sha1:36d5d22090d13fd3a7a8c9663a711cbe6970aac8</id>
<content type='text'>
The caller is already holding the lock so this will deadlock.

Fixes: 0b58828c923e ("DMAENGINE: COH 901 318 remove irq counting")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Link: https://lore.kernel.org/r/20200217144050.3i4ymbytogod4ijn@kili.mountain
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
</feed>
