<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/dma, branch v4.4.235</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.235</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.235'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-07-22T07:10:07+00:00</updated>
<entry>
<title>dmaengine: fsl-edma: Fix NULL pointer exception in fsl_edma_tx_handler</title>
<updated>2020-07-22T07:10:07+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzk@kernel.org</email>
</author>
<published>2020-06-11T12:17:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c7c33666b413c07ef3dfd6fa9c822dd0f5544dcb'/>
<id>urn:sha1:c7c33666b413c07ef3dfd6fa9c822dd0f5544dcb</id>
<content type='text'>
commit f5e5677c420346b4e9788051c2e4d750996c428c upstream.

NULL pointer exception happens occasionally on serial output initiated
by login timeout.  This was reproduced only if kernel was built with
significant debugging options and EDMA driver is used with serial
console.

    col-vf50 login: root
    Password:
    Login timed out after 60 seconds.
    Unable to handle kernel NULL pointer dereference at virtual address 00000044
    Internal error: Oops: 5 [#1] ARM
    CPU: 0 PID: 157 Comm: login Not tainted 5.7.0-next-20200610-dirty #4
    Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
      (fsl_edma_tx_handler) from [&lt;8016eb10&gt;] (__handle_irq_event_percpu+0x64/0x304)
      (__handle_irq_event_percpu) from [&lt;8016eddc&gt;] (handle_irq_event_percpu+0x2c/0x7c)
      (handle_irq_event_percpu) from [&lt;8016ee64&gt;] (handle_irq_event+0x38/0x5c)
      (handle_irq_event) from [&lt;801729e4&gt;] (handle_fasteoi_irq+0xa4/0x160)
      (handle_fasteoi_irq) from [&lt;8016ddcc&gt;] (generic_handle_irq+0x34/0x44)
      (generic_handle_irq) from [&lt;8016e40c&gt;] (__handle_domain_irq+0x54/0xa8)
      (__handle_domain_irq) from [&lt;80508bc8&gt;] (gic_handle_irq+0x4c/0x80)
      (gic_handle_irq) from [&lt;80100af0&gt;] (__irq_svc+0x70/0x98)
    Exception stack(0x8459fe80 to 0x8459fec8)
    fe80: 72286b00 e3359f64 00000001 0000412d a0070013 85c98840 85c98840 a0070013
    fea0: 8054e0d4 00000000 00000002 00000000 00000002 8459fed0 8081fbe8 8081fbec
    fec0: 60070013 ffffffff
      (__irq_svc) from [&lt;8081fbec&gt;] (_raw_spin_unlock_irqrestore+0x30/0x58)
      (_raw_spin_unlock_irqrestore) from [&lt;8056cb48&gt;] (uart_flush_buffer+0x88/0xf8)
      (uart_flush_buffer) from [&lt;80554e60&gt;] (tty_ldisc_hangup+0x38/0x1ac)
      (tty_ldisc_hangup) from [&lt;8054c7f4&gt;] (__tty_hangup+0x158/0x2bc)
      (__tty_hangup) from [&lt;80557b90&gt;] (disassociate_ctty.part.1+0x30/0x23c)
      (disassociate_ctty.part.1) from [&lt;8011fc18&gt;] (do_exit+0x580/0xba0)
      (do_exit) from [&lt;801214f8&gt;] (do_group_exit+0x3c/0xb4)
      (do_group_exit) from [&lt;80121580&gt;] (__wake_up_parent+0x0/0x14)

Issue looks like race condition between interrupt handler fsl_edma_tx_handler()
(called as result of fsl_edma_xfer_desc()) and terminating the transfer with
fsl_edma_terminate_all().

The fsl_edma_tx_handler() handles interrupt for a transfer with already freed
edesc and idle==true.

Fixes: d6be34fbd39b ("dma: Add Freescale eDMA engine driver support")
Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Reviewed-by: Robin Gong &lt;yibin.gong@nxp.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/1591877861-28156-2-git-send-email-krzk@kernel.org
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dmaengine: mmp_tdma: Reset channel error on release</title>
<updated>2020-05-20T06:11:44+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2020-04-19T16:49:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4db73f4467eaf97eabd4f763ba51c05dda87f8b1'/>
<id>urn:sha1:4db73f4467eaf97eabd4f763ba51c05dda87f8b1</id>
<content type='text'>
[ Upstream commit 0c89446379218698189a47871336cb30286a7197 ]

When a channel configuration fails, the status of the channel is set to
DEV_ERROR so that an attempt to submit it fails. However, this status
sticks until the heat end of the universe, making it impossible to
recover from the error.

Let's reset it when the channel is released so that further use of the
channel with correct configuration is not impacted.

Signed-off-by: Lubomir Rintel &lt;lkundrak@v3.sk&gt;
Link: https://lore.kernel.org/r/20200419164912.670973-5-lkundrak@v3.sk
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: pch_dma.c: Avoid data race between probe and irq handler</title>
<updated>2020-05-20T06:11:44+00:00</updated>
<author>
<name>Madhuparna Bhowmik</name>
<email>madhuparnabhowmik10@gmail.com</email>
</author>
<published>2020-04-16T06:23:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=329a8c9d417bb2cf822be633dd2b4c5d77cd1586'/>
<id>urn:sha1:329a8c9d417bb2cf822be633dd2b4c5d77cd1586</id>
<content type='text'>
[ Upstream commit 2e45676a4d33af47259fa186ea039122ce263ba9 ]

pd-&gt;dma.dev is read in irq handler pd_irq().
However, it is set to pdev-&gt;dev after request_irq().
Therefore, set pd-&gt;dma.dev to pdev-&gt;dev before request_irq() to
avoid data race between pch_dma_probe() and pd_irq().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Madhuparna Bhowmik &lt;madhuparnabhowmik10@gmail.com&gt;
Link: https://lore.kernel.org/r/20200416062335.29223-1-madhuparnabhowmik10@gmail.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: edma: Add probe callback to edma_tptc_driver</title>
<updated>2020-05-10T08:26:25+00:00</updated>
<author>
<name>Peter Ujfalusi</name>
<email>peter.ujfalusi@ti.com</email>
</author>
<published>2015-12-16T13:19:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=528b47364478a6fd7eeed45b88a4c17fe76fe0bc'/>
<id>urn:sha1:528b47364478a6fd7eeed45b88a4c17fe76fe0bc</id>
<content type='text'>
commit 4fa2d09c1ae879c2ee2760ab419a4f97026dd97b upstream.

Due to changes in device and platform code drivers w/o probe will fail to
load. This means that the devices for eDMA TPTCs are goign to be without
driver and omap hwmod code will turn them off after the kernel finished
loading:
[    3.015900] platform 49800000.tptc: omap_device_late_idle: enabled but no driver.  Idling
[    3.024671] platform 49a00000.tptc: omap_device_late_idle: enabled but no driver.  Idling

This will prevent eDMA to work since the TPTCs are not enabled.

Signed-off-by: Peter Ujfalusi &lt;peter.ujfalusi@ti.com&gt;
Fixes: 34635b1accb9 ("dmaengine: edma: Add dummy driver skeleton for edma3-tptc")
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dmaengine: dmatest: Fix iteration non-stop logic</title>
<updated>2020-05-05T17:13:23+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2020-04-24T16:11:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=056e60c10f93f264da19be7c13ef60c328fb619c'/>
<id>urn:sha1:056e60c10f93f264da19be7c13ef60c328fb619c</id>
<content type='text'>
commit b9f960201249f20deea586b4ec814669b4c6b1c0 upstream.

Under some circumstances, i.e. when test is still running and about to
time out and user runs, for example,

	grep -H . /sys/module/dmatest/parameters/*

the iterations parameter is not respected and test is going on and on until
user gives

	echo 0 &gt; /sys/module/dmatest/parameters/run

This is not what expected.

The history of this bug is interesting. I though that the commit
  2d88ce76eb98 ("dmatest: add a 'wait' parameter")
is a culprit, but looking closer to the code I think it simple revealed the
broken logic from the day one, i.e. in the commit
  0a2ff57d6fba ("dmaengine: dmatest: add a maximum number of test iterations")
which adds iterations parameter.

So, to the point, the conditional of checking the thread to be stopped being
first part of conjunction logic prevents to check iterations. Thus, we have to
always check both conditions to be able to stop after given iterations.

Since it wasn't visible before second commit appeared, I add a respective
Fixes tag.

Fixes: 2d88ce76eb98 ("dmatest: add a 'wait' parameter")
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Nicolas Ferre &lt;nicolas.ferre@microchip.com&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@microchip.com&gt;
Link: https://lore.kernel.org/r/20200424161147.16895-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dmaengine: coh901318: Fix a double lock bug in dma_tc_handle()</title>
<updated>2020-03-11T06:51:19+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2020-02-17T14:40:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=92627da9f73a25ef04ba4b4e95413ea943f1109b'/>
<id>urn:sha1:92627da9f73a25ef04ba4b4e95413ea943f1109b</id>
<content type='text'>
commit 36d5d22090d13fd3a7a8c9663a711cbe6970aac8 upstream.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dmaengine: tegra-apb: Prevent race conditions of tasklet vs free list</title>
<updated>2020-03-11T06:51:18+00:00</updated>
<author>
<name>Dmitry Osipenko</name>
<email>digetx@gmail.com</email>
</author>
<published>2020-02-09T16:33:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=59ee23d98af6b1345fdb7f3363730ed739d2d19a'/>
<id>urn:sha1:59ee23d98af6b1345fdb7f3363730ed739d2d19a</id>
<content type='text'>
commit c33ee1301c393a241d6424e36eff1071811b1064 upstream.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dmaengine: tegra-apb: Fix use-after-free</title>
<updated>2020-03-11T06:51:18+00:00</updated>
<author>
<name>Dmitry Osipenko</name>
<email>digetx@gmail.com</email>
</author>
<published>2020-02-09T16:33:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f28645eba4b0bbd3f8e21ca94cb46e21d1313cab'/>
<id>urn:sha1:f28645eba4b0bbd3f8e21ca94cb46e21d1313cab</id>
<content type='text'>
commit 94788af4ed039476ff3527b0e6a12c1dc42cb022 upstream.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dmaengine: ti: edma: fix missed failure handling</title>
<updated>2020-01-29T09:21:50+00:00</updated>
<author>
<name>Chuhong Yuan</name>
<email>hslester96@gmail.com</email>
</author>
<published>2019-11-18T07:38:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fe1787af161f91dffcef3a0248b85f0cefdea64b'/>
<id>urn:sha1:fe1787af161f91dffcef3a0248b85f0cefdea64b</id>
<content type='text'>
[ Upstream commit 340049d453682a9fe8d91fe794dd091730f4bb25 ]

When devm_kcalloc fails, it forgets to call edma_free_slot.
Replace direct return with failure handler to fix it.

Fixes: 1be5336bc7ba ("dmaengine: edma: New device tree binding")
Signed-off-by: Chuhong Yuan &lt;hslester96@gmail.com&gt;
Link: https://lore.kernel.org/r/20191118073802.28424-1-hslester96@gmail.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: imx-sdma: fix size check for sdma script_number</title>
<updated>2020-01-29T09:21:49+00:00</updated>
<author>
<name>Robin Gong</name>
<email>yibin.gong@nxp.com</email>
</author>
<published>2019-09-24T09:49:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c6fe228aa2cbb4c6553ecc3f0d2815f03b3ab973'/>
<id>urn:sha1:c6fe228aa2cbb4c6553ecc3f0d2815f03b3ab973</id>
<content type='text'>
[ Upstream commit bd73dfabdda280fc5f05bdec79b6721b4b2f035f ]

Illegal memory will be touch if SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3
(41) exceed the size of structure sdma_script_start_addrs(40),
thus cause memory corrupt such as slob block header so that kernel
trap into while() loop forever in slob_free(). Please refer to below
code piece in imx-sdma.c:
for (i = 0; i &lt; sdma-&gt;script_number; i++)
	if (addr_arr[i] &gt; 0)
		saddr_arr[i] = addr_arr[i]; /* memory corrupt here */
That issue was brought by commit a572460be9cf ("dmaengine: imx-sdma: Add
support for version 3 firmware") because SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3
(38-&gt;41 3 scripts added) not align with script number added in
sdma_script_start_addrs(2 scripts).

Fixes: a572460be9cf ("dmaengine: imx-sdma: Add support for version 3 firmware")
Cc: stable@vger.kernel
Link: https://www.spinics.net/lists/arm-kernel/msg754895.html
Signed-off-by: Robin Gong &lt;yibin.gong@nxp.com&gt;
Reported-by: Jurgen Lambrecht &lt;J.Lambrecht@TELEVIC.com&gt;
Link: https://lore.kernel.org/r/1569347584-3478-1-git-send-email-yibin.gong@nxp.com
[vkoul: update the patch title]
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
