<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/dma/imx-sdma.c, branch linux-4.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-04-27T11:14:10Z</updated>
<entry>
<title>dmaengine: imx-sdma: Fix error checking in sdma_event_remap</title>
<updated>2022-04-27T11:14:10Z</updated>
<author>
<name>Miaoqian Lin</name>
</author>
<published>2022-03-08T06:49:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e4333c4ff0e3e578b90f0dfc2ee7980efaa856a7'/>
<id>urn:sha1:e4333c4ff0e3e578b90f0dfc2ee7980efaa856a7</id>
<content type='text'>
[ Upstream commit 7104b9cb35a33ad803a1adbbfa50569b008faf15 ]

of_parse_phandle() returns NULL on errors, rather than error
pointers. Using NULL check on grp_np to fix this.

Fixes: d078cd1b4185 ("dmaengine: imx-sdma: Add imx6sx platform support")
Signed-off-by: Miaoqian Lin &lt;linmq006@gmail.com&gt;
Link: https://lore.kernel.org/r/20220308064952.15743-1-linmq006@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:24:34Z</updated>
<author>
<name>Robin Gong</name>
</author>
<published>2019-09-24T09:49:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9e0951ca586149e4b8b133ff137050ad502912b4'/>
<id>urn:sha1:9e0951ca586149e4b8b133ff137050ad502912b4</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>
<entry>
<title>dmaengine: imx-sdma: fix use-after-free on probe error path</title>
<updated>2019-08-04T07:33:14Z</updated>
<author>
<name>Sven Van Asbroeck</name>
</author>
<published>2019-06-24T14:07:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9b8a4a188a91dcc8ae9d28aeec6121b5b28ac818'/>
<id>urn:sha1:9b8a4a188a91dcc8ae9d28aeec6121b5b28ac818</id>
<content type='text'>
[ Upstream commit 2b8066c3deb9140fdf258417a51479b2aeaa7622 ]

If probe() fails anywhere beyond the point where
sdma_get_firmware() is called, then a kernel oops may occur.

Problematic sequence of events:
1. probe() calls sdma_get_firmware(), which schedules the
   firmware callback to run when firmware becomes available,
   using the sdma instance structure as the context
2. probe() encounters an error, which deallocates the
   sdma instance structure
3. firmware becomes available, firmware callback is
   called with deallocated sdma instance structure
4. use after free - kernel oops !

Solution: only attempt to load firmware when we're certain
that probe() will succeed. This guarantees that the firmware
callback's context will remain valid.

Note that the remove() path is unaffected by this issue: the
firmware loader will increment the driver module's use count,
ensuring that the module cannot be unloaded while the
firmware callback is pending or running.

Signed-off-by: Sven Van Asbroeck &lt;TheSven73@gmail.com&gt;
Reviewed-by: Robin Gong &lt;yibin.gong@nxp.com&gt;
[vkoul: fixed braces for if condition]
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: remove BD_INTR for channel0</title>
<updated>2019-07-10T07:55:47Z</updated>
<author>
<name>Robin Gong</name>
</author>
<published>2019-06-21T08:23:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e8aa99a2ef8ddd088f2a138fed7b924255e34d5'/>
<id>urn:sha1:6e8aa99a2ef8ddd088f2a138fed7b924255e34d5</id>
<content type='text'>
commit 3f93a4f297961c12bb17aa16cb3a4d1291823cae upstream.

It is possible for an irq triggered by channel0 to be received later
after clks are disabled once firmware loaded during sdma probe. If
that happens then clearing them by writing to SDMA_H_INTR won't work
and the kernel will hang processing infinite interrupts. Actually,
don't need interrupt triggered on channel0 since it's pollling
SDMA_H_STATSTOP to know channel0 done rather than interrupt in
current code, just clear BD_INTR to disable channel0 interrupt to
avoid the above case.
This issue was brought by commit 1d069bfa3c78 ("dmaengine: imx-sdma:
ack channel 0 IRQ in the interrupt handler") which didn't take care
the above case.

Fixes: 1d069bfa3c78 ("dmaengine: imx-sdma: ack channel 0 IRQ in the interrupt handler")
Cc: stable@vger.kernel.org #5.0+
Signed-off-by: Robin Gong &lt;yibin.gong@nxp.com&gt;
Reported-by: Sven Van Asbroeck &lt;thesven73@gmail.com&gt;
Tested-by: Sven Van Asbroeck &lt;thesven73@gmail.com&gt;
Reviewed-by: Michael Olbrich &lt;m.olbrich@pengutronix.de&gt;
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: imx-sdma: Handle return value of clk_prepare_enable</title>
<updated>2018-04-13T17:48:12Z</updated>
<author>
<name>Arvind Yadav</name>
</author>
<published>2017-05-24T06:39:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=922841084a82f1356c0499a165319b780965f039'/>
<id>urn:sha1:922841084a82f1356c0499a165319b780965f039</id>
<content type='text'>
[ Upstream commit fb9caf370f4d0457789d13a1a1b110a8db846e5e ]

clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: imx-sdma: add 1ms delay to ensure SDMA channel is stopped</title>
<updated>2018-03-22T08:17:43Z</updated>
<author>
<name>Jiada Wang</name>
</author>
<published>2017-03-17T06:12:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=61ed2d27b87fe5b01fa867492e75495b96a41456'/>
<id>urn:sha1:61ed2d27b87fe5b01fa867492e75495b96a41456</id>
<content type='text'>
[ Upstream commit 7f3ff14b7eb1ffad132117f08a1973b48e653d43 ]

sdma_disable_channel() cannot ensure dma is stopped to access
module's FIFOs. There is chance SDMA core is running and accessing
BD when disable of corresponding channel, this may cause sometimes
even after call of .sdma_disable_channel(), SDMA core still be
running and accessing module's FIFOs.

According to NXP R&amp;D team a delay of one BD SDMA cost time (maximum
is 1ms) should be added after disable of the channel bit, to ensure
SDMA core has really been stopped after SDMA clients call
.device_terminate_all.

This patch introduces adds a new function sdma_disable_channel_with_delay()
which simply adds 1ms delay after call sdma_disable_channel(),
and set it as .device_terminate_all.

Signed-off-by: Jiada Wang &lt;jiada_wang@mentor.com&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: imx-sdma - correct the dma transfer residue calculation</title>
<updated>2017-03-15T02:02:49Z</updated>
<author>
<name>Nandor Han</name>
</author>
<published>2016-10-11T11:13:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a654a85932fa7a909b11934df7657c1a2cb3609'/>
<id>urn:sha1:3a654a85932fa7a909b11934df7657c1a2cb3609</id>
<content type='text'>
commit 85f57752b33cf12f1d583f0c10b752292de00abe upstream.

The residue calculation was taking in consideration that dma
transaction status will be always retrieved in the dma callback
used to inform that dma transfer is complete. However this is not
the case for all subsystems that use dma. Some subsystems use a
timer to check the dma status periodically.

Therefore the calculation was updated and residue is calculated
accordingly by a) update the residue calculation taking in
consideration the last used buffer index by using *buf_ptail* variable
and b) chn_real_count (number of bytes transferred) is initialized to
zero, when dma channel is created, to avoid using an uninitialized
value in residue calculation when dma status is checked without
waiting dma complete event.

Signed-off-by: Nandor Han &lt;nandor.han@ge.com&gt;
Acked-by: Peter Senna Tschudin &lt;peter.senna@collabora.com&gt;
Tested-by: Peter Senna Tschudin &lt;peter.senna@collabora.com&gt;
Tested-by: Marek Vasut &lt;marex@denx.de&gt;
Signed-off-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Cc: Fabio Estevam &lt;festevam@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge tag 'dmaengine-4.9-rc1' of git://git.infradead.org/users/vkoul/slave-dma</title>
<updated>2016-10-07T00:13:54Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2016-10-07T00:13:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=553911c67eb701d46e2dcd073f603c6f6546c38b'/>
<id>urn:sha1:553911c67eb701d46e2dcd073f603c6f6546c38b</id>
<content type='text'>
Pull dmaengine updates from Vinod Koul:
 "This is bit large pile of code which bring in some nice additions:

   - Error reporting: we have added a new mechanism for users of
     dmaenegine to register a callback_result which tells them the
     result of the dma transaction. Right now only one user (ntb) is
     using it.

   - As we discussed on KS mailing list and pointed out NO_IRQ has no
     place in kernel, this also remove NO_IRQ from dmaengine subsystem
     (both arm and ppc users)

   - Support for IOMMU slave transfers and its implementation for arm.

   - To get better build coverage, enable COMPILE_TEST for bunch of
     driver, and fix the warning and sparse complaints on these.

   - Apart from above, usual updates spread across drivers"

* tag 'dmaengine-4.9-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (169 commits)
  async_pq_val: fix DMA memory leak
  dmaengine: virt-dma: move function declarations
  dmaengine: omap-dma: Enable burst and data pack for SG
  DT: dmaengine: rcar-dmac: document R8A7743/5 support
  dmaengine: fsldma: Unmap region obtained by of_iomap
  dmaengine: jz4780: fix resource leaks on error exit return
  dma-debug: fix ia64 build, use PHYS_PFN
  dmaengine: coh901318: fix integer overflow when shifting more than 32 places
  dmaengine: edma: avoid uninitialized variable use
  dma-mapping: fix m32r build warning
  dma-mapping: fix ia64 build, use PHYS_PFN
  dmaengine: ti-dma-crossbar: enable COMPILE_TEST
  dmaengine: omap-dma: enable COMPILE_TEST
  dmaengine: edma: enable COMPILE_TEST
  dmaengine: ti-dma-crossbar: Fix of_device_id data parameter usage
  dmaengine: ti-dma-crossbar: Correct type for of_find_property() third parameter
  dmaengine/ARM: omap-dma: Fix the DMAengine compile test on non OMAP configs
  dmaengine: edma: Rename set_bits and remove unused clear_bits helper
  dmaengine: edma: Use correct type for of_find_property() third parameter
  dmaengine: edma: Fix of_device_id data parameter usage (legacy vs TPCC)
  ...
</content>
</entry>
<entry>
<title>Merge branch 'topic/imx' into for-linus</title>
<updated>2016-10-03T03:47:52Z</updated>
<author>
<name>Vinod Koul</name>
</author>
<published>2016-10-03T03:47:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ddfaadfa7f4378fe15237086793f6aed5cbff9a3'/>
<id>urn:sha1:ddfaadfa7f4378fe15237086793f6aed5cbff9a3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>dmaengine: imx-sdma - update the residue calculation for cyclic channels</title>
<updated>2016-08-31T14:27:28Z</updated>
<author>
<name>Nandor Han</name>
</author>
<published>2016-08-08T12:38:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5881826ded79cf3c3314ee2d84c3bfa94e111b42'/>
<id>urn:sha1:5881826ded79cf3c3314ee2d84c3bfa94e111b42</id>
<content type='text'>
The calculation of the DMA transaction residue supports only fixed
size data transfers. This implementation is not covering all
operations (e.g. data receiving) when we need to know the exact amount
of bytes transferred.

The loop channels handling was changed to clear the buffer
descriptor errors and use the bd-&gt;mode.count to calculate the
residue.

Tested-by: Peter Senna Tschudin &lt;peter.senna@collabora.com&gt;
Acked-by: Peter Senna Tschudin &lt;peter.senna@collabora.com&gt;
Reviewed-by: Vinod Koul &lt;vinod.koul@intel.com&gt;
Signed-off-by: Nandor Han &lt;nandor.han@ge.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
