<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/dma/sf-pdma, branch linux-6.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-02-16T13:15:48Z</updated>
<entry>
<title>dmaengine: sf-pdma: pdma_desc memory leak fix</title>
<updated>2023-02-16T13:15:48Z</updated>
<author>
<name>Shravan Chippa</name>
</author>
<published>2023-01-20T10:06:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b02e07015a5ac7bbc029da931ae17914b8ae0339'/>
<id>urn:sha1:b02e07015a5ac7bbc029da931ae17914b8ae0339</id>
<content type='text'>
Commit b2cc5c465c2c ("dmaengine: sf-pdma: Add multithread support for a
DMA channel") changed sf_pdma_prep_dma_memcpy() to unconditionally
allocate a new sf_pdma_desc each time it is called.

The driver previously recycled descs, by checking the in_use flag, only
allocating additional descs if the existing one was in use. This logic
was removed in commit b2cc5c465c2c ("dmaengine: sf-pdma: Add multithread
support for a DMA channel"), but sf_pdma_free_desc() was not changed to
handle the new behaviour.

As a result, each time sf_pdma_prep_dma_memcpy() is called, the previous
descriptor is leaked, over time leading to memory starvation:

  unreferenced object 0xffffffe008447300 (size 192):
  comm "irq/39-mchp_dsc", pid 343, jiffies 4294906910 (age 981.200s)
  hex dump (first 32 bytes):
    00 00 00 ff 00 00 00 00 b8 c1 00 00 00 00 00 00  ................
    00 00 70 08 10 00 00 00 00 00 00 c0 00 00 00 00  ..p.............
  backtrace:
    [&lt;00000000064a04f4&gt;] kmemleak_alloc+0x1e/0x28
    [&lt;00000000018927a7&gt;] kmem_cache_alloc+0x11e/0x178
    [&lt;000000002aea8d16&gt;] sf_pdma_prep_dma_memcpy+0x40/0x112

Add the missing kfree() to sf_pdma_free_desc(), and remove the redundant
in_use flag.

Fixes: b2cc5c465c2c ("dmaengine: sf-pdma: Add multithread support for a DMA channel")
Signed-off-by: Shravan Chippa &lt;shravan.chippa@microchip.com&gt;
Reviewed-by: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Link: https://lore.kernel.org/r/20230120100623.3530634-1-shravan.chippa@microchip.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: drivers: Use devm_platform_ioremap_resource()</title>
<updated>2023-01-18T16:46:47Z</updated>
<author>
<name>Tudor Ambarus</name>
</author>
<published>2022-11-10T15:25:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4b23603a251d24022f2fa48ee67610eb245a4115'/>
<id>urn:sha1:4b23603a251d24022f2fa48ee67610eb245a4115</id>
<content type='text'>
platform_get_resource() and devm_ioremap_resource() are wrapped up in the
devm_platform_ioremap_resource() helper. Use the helper and get rid of the
local variable for struct resource *. We now have a function call less.

Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Acked-by: Jernej Skrabec &lt;jernej.skrabec@gmail.com&gt;
Acked-by: Peter Ujfalusi &lt;peter.ujfalusi@gmail.com&gt;
Link: https://lore.kernel.org/r/20221110152528.7821-1-tudor.ambarus@microchip.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sf-pdma:Remove the print function dev_err()</title>
<updated>2022-09-05T06:20:38Z</updated>
<author>
<name>ye xingchen</name>
</author>
<published>2022-08-10T06:25:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7d81afd2690400f8fb7d9bec0532624562634766'/>
<id>urn:sha1:7d81afd2690400f8fb7d9bec0532624562634766</id>
<content type='text'>
&gt;From the coccinelle check:

./drivers/dma/sf-pdma/sf-pdma.c
Error:line 409 is redundant because platform_get_irq() already prints an
error

./drivers/dma/sf-pdma/sf-pdma.c
Error:line 424 is redundant because platform_get_irq() already prints an
error

So,remove the unnecessary print function dev_err()

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: ye xingchen &lt;ye.xingchen@zte.com.cn&gt;
Link: https://lore.kernel.org/r/20220810062532.13425-1-ye.xingchen@zte.com.cn
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sf-pdma: Add multithread support for a DMA channel</title>
<updated>2022-07-06T12:40:34Z</updated>
<author>
<name>Viacheslav Mitrofanov</name>
</author>
<published>2022-07-01T08:29:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b2cc5c465c2cb8ab697c3fd6583c614e3f6cfbcc'/>
<id>urn:sha1:b2cc5c465c2cb8ab697c3fd6583c614e3f6cfbcc</id>
<content type='text'>
When we get a DMA channel and try to use it in multiple threads it
will cause oops and hanging the system.

% echo 64 &gt; /sys/module/dmatest/parameters/threads_per_chan
% echo 10000 &gt; /sys/module/dmatest/parameters/iterations
% echo 1 &gt; /sys/module/dmatest/parameters/run
[   89.480664] Unable to handle kernel NULL pointer dereference at virtual
               address 00000000000000a0
[   89.488725] Oops [#1]
[   89.494708] CPU: 2 PID: 1008 Comm: dma0chan0-copy0 Not tainted
               5.17.0-rc5
[   89.509385] epc : vchan_find_desc+0x32/0x46
[   89.513553]  ra : sf_pdma_tx_status+0xca/0xd6

This happens because of data race. Each thread rewrite channels's
descriptor as soon as device_prep_dma_memcpy() is called. It leads to the
situation when the driver thinks that it uses right descriptor that
actually is freed or substituted for other one.

With current fixes a descriptor changes its value only when it has
been used. A new descriptor is acquired from vc-&gt;desc_issued queue that
is already filled with descriptors that are ready to be sent. Threads
have no direct access to DMA channel descriptor. Now it is just possible
to queue a descriptor for further processing.

Fixes: 6973886ad58e ("dmaengine: sf-pdma: add platform DMA support for HiFive Unleashed A00")
Signed-off-by: Viacheslav Mitrofanov &lt;v.v.mitrofanov@yadro.com&gt;
Link: https://lore.kernel.org/r/20220701082942.12835-1-v.v.mitrofanov@yadro.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sf-pdma: Get number of channel by device tree</title>
<updated>2022-04-08T13:13:29Z</updated>
<author>
<name>Zong Li</name>
</author>
<published>2022-03-28T09:52:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e2dfce24f4175e8ba183d5800f669fc89843df54'/>
<id>urn:sha1:e2dfce24f4175e8ba183d5800f669fc89843df54</id>
<content type='text'>
It currently assumes that there are always four channels, it would
cause the error if there is actually less than four channels. Change
that by getting number of channel from device tree.

For backwards-compatibility, it uses the default value (i.e. 4) when
there is no 'dma-channels' information in dts.

Signed-off-by: Zong Li &lt;zong.li@sifive.com&gt;
Acked-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Link: https://lore.kernel.org/r/f08a95b6582a51712c5b2c3cb859136d07bfa8b9.1648461096.git.zong.li@sifive.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'dmaengine-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine</title>
<updated>2021-07-05T19:05:13Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2021-07-05T19:05:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18ef082713ad1104c32cd17a15abdc3f43c9b28a'/>
<id>urn:sha1:18ef082713ad1104c32cd17a15abdc3f43c9b28a</id>
<content type='text'>
Pull dmaengine updates from Vinod Koul:
 "This time around we have a smaller pull request than usual and this
  includes code removal, so should be good!

  New drivers/devices
   - Support for QCOM SM8250 GPI DMA
   - removal of shdma-of driver and binding

  Updates:
   - arm-pl08x yaml binding move
   - altera-msgdma gained DT support
   - removal of imx-sdma platform data support
   - idxd and xilinx driver updates"

* tag 'dmaengine-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (22 commits)
  dmaengine: imx-sdma: Remove platform data header
  dmaengine: xilinx: dpdma: Fix spacing around addr[i-1]
  dmaengine: xilinx: dpdma: Use kernel type u32 over uint32_t
  dmaengine: altera-msgdma: add OF support
  MAINTAINERS: add entry for Altera mSGDMA
  dt-bindings: dma: add schema for altera-msgdma
  dmaengine: xilinx: dpdma: fix kernel-doc
  dmaengine: sf-pdma: apply proper spinlock flags in sf_pdma_prep_dma_memcpy()
  dmaengine: sh: Remove unused shdma-of driver
  dt-bindings: dmaengine: Remove SHDMA Device Tree bindings
  dmaengine: qcom: gpi: Add SM8250 compatible
  dt-bindings: dmaengine: qcom: gpi: add compatible for sm8250
  dmaengine: sun4i: Use list_move_tail instead of list_del/list_add_tail
  dmaengine: ti: omap-dma: Skip pointless cpu_pm context restore on errors
  dmaengine: hsu: Account transferred bytes
  dmaengine: Move kdoc description of struct dma_chan_percpu closer to it
  dmaengine: xilinx: dpdma: Print debug message when losing vsync race
  dmaengine: xilinx: dpdma: Print channel number in kernel log messages
  dt-bindings: dma: convert arm-pl08x to yaml
  dmaengine: idxd: remove devm allocation for idxd-&gt;int_handles
  ...
</content>
</entry>
<entry>
<title>dmaengine: sf-pdma: apply proper spinlock flags in sf_pdma_prep_dma_memcpy()</title>
<updated>2021-06-16T10:40:00Z</updated>
<author>
<name>Austin Kim</name>
</author>
<published>2021-06-11T06:53:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=94b4cd7c5fc0dd6858a046b00ca729fb0512b9ba'/>
<id>urn:sha1:94b4cd7c5fc0dd6858a046b00ca729fb0512b9ba</id>
<content type='text'>
The second parameter of spinlock_irq[save/restore] function is flags,
which is the last input parameter of sf_pdma_prep_dma_memcpy().

So declare local variable 'iflags' to be used as the second parameter of
spinlock_irq[save/restore] function.

Signed-off-by: Austin Kim &lt;austin.kim@lge.com&gt;
Link: https://lore.kernel.org/r/20210611065336.GA1121@raspberrypi
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: SF_PDMA depends on HAS_IOMEM</title>
<updated>2021-05-31T04:14:14Z</updated>
<author>
<name>Randy Dunlap</name>
</author>
<published>2021-05-22T02:13:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8e2e4f3c58528c6040b5762b666734f8cceba568'/>
<id>urn:sha1:8e2e4f3c58528c6040b5762b666734f8cceba568</id>
<content type='text'>
When CONFIG_HAS_IOMEM is not set/enabled, certain iomap() family
functions [including ioremap(), devm_ioremap(), etc.] are not
available.
Drivers that use these functions should depend on HAS_IOMEM so that
they do not cause build errors.

Mends this build error:
s390-linux-ld: drivers/dma/sf-pdma/sf-pdma.o: in function `sf_pdma_probe':
sf-pdma.c:(.text+0x1668): undefined reference to `devm_ioremap_resource'

Fixes: 6973886ad58e ("dmaengine: sf-pdma: add platform DMA support for HiFive Unleashed A00")
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Cc: Green Wan &lt;green.wan@sifive.com&gt;
Cc: Vinod Koul &lt;vkoul@kernel.org&gt;
Cc: dmaengine@vger.kernel.org
Link: https://lore.kernel.org/r/20210522021313.16405-4-rdunlap@infradead.org
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sf: drop of_match_ptr from of_device_id table</title>
<updated>2020-11-24T17:32:20Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2020-11-20T16:23:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=75fa2d4218c7df7added689dc941ba7b52519b2e'/>
<id>urn:sha1:75fa2d4218c7df7added689dc941ba7b52519b2e</id>
<content type='text'>
The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here).  This fixes
compile warning (!CONFIG_OF on x86_64):

    drivers/dma/sf-pdma/sf-pdma.c:576:34: warning:
        ‘sf_pdma_dt_ids’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Link: https://lore.kernel.org/r/20201120162303.482126-4-krzk@kernel.org
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sf-pdma: remove redundant irqsave and irqrestore in hardIRQ</title>
<updated>2020-11-09T11:55:54Z</updated>
<author>
<name>Barry Song</name>
</author>
<published>2020-10-27T21:52:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=302b3b38236a70bffb13f3a90a52bd630841aa90'/>
<id>urn:sha1:302b3b38236a70bffb13f3a90a52bd630841aa90</id>
<content type='text'>
Running in hardIRQ, disabling IRQ is redundant since hardIRQ has disabled
IRQ. This patch removes the irqsave and irqstore to save some instruction
cycles.

Signed-off-by: Barry Song &lt;song.bao.hua@hisilicon.com&gt;
Cc: Green Wan &lt;green.wan@sifive.com&gt;
Link: https://lore.kernel.org/r/20201027215252.25820-4-song.bao.hua@hisilicon.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
</feed>
