<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/dma/sprd-dma.c, 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>2022-07-26T12:50:49Z</updated>
<entry>
<title>dmaengine: sprd: Cleanup in .remove() after pm_runtime_get_sync() failed</title>
<updated>2022-07-26T12:50:49Z</updated>
<author>
<name>Uwe Kleine-König</name>
</author>
<published>2022-07-21T20:40:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1e42f82cbec7b2cc4873751e7791e6611901c5fc'/>
<id>urn:sha1:1e42f82cbec7b2cc4873751e7791e6611901c5fc</id>
<content type='text'>
It's not allowed to quit remove early without cleaning up completely.
Otherwise this results in resource leaks that probably yield graver
problems later. Here for example some tasklets might survive the lifetime
of the sprd-dma device and access sdev which is freed after .remove()
returns.

As none of the device freeing requires an active device, just ignore the
return value of pm_runtime_get_sync().

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Reviewed-by: Baolin Wang &lt;baolin.wang7@gmail.com&gt;
Link: https://lore.kernel.org/r/20220721204054.323602-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sprd: deprecate '#dma-channels'</title>
<updated>2022-05-16T13:04:35Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2022-05-03T06:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d84c3ad998795503379ef8458ffffb5c06d18cc5'/>
<id>urn:sha1:d84c3ad998795503379ef8458ffffb5c06d18cc5</id>
<content type='text'>
The generic property, used in most of the drivers and defined in generic
dma-common DT bindings, is 'dma-channels'.  Switch to new property while
keeping backward compatibility.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Reviewed-by: Baolin Wang &lt;baolin.wang7@gmail.com&gt;
Link: https://lore.kernel.org/r/20220503065147.51728-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sprd: stop referencing config-&gt;slave_id</title>
<updated>2021-12-17T05:53:56Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2021-11-22T22:21:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=722d6d2bdcc2dcff5527c704fb8f2bbcb018a232'/>
<id>urn:sha1:722d6d2bdcc2dcff5527c704fb8f2bbcb018a232</id>
<content type='text'>
It appears that the code that reads the slave_id from the channel config
was copied incorrectly from other drivers. Nothing ever sets this field
on platforms that use this driver, so remove the reference.

Reviewed-by: Baolin Wang &lt;baolin.wang7@gmail.com&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Mark Brown &lt;broonie@kernel.org&gt;
Link: https://lore.kernel.org/r/20211122222203.4103644-8-arnd@kernel.org
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sprd: Add missing MODULE_DEVICE_TABLE</title>
<updated>2021-07-15T12:17:38Z</updated>
<author>
<name>Zou Wei</name>
</author>
<published>2021-05-04T02:22:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4faee8b65ec32346f8096e64c5fa1d5a73121742'/>
<id>urn:sha1:4faee8b65ec32346f8096e64c5fa1d5a73121742</id>
<content type='text'>
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Zou Wei &lt;zou_wei@huawei.com&gt;
Reviewed-by: Baolin Wang &lt;baolin.wang7@gmail.com&gt;
Link: https://lore.kernel.org/r/1620094977-70146-1-git-send-email-zou_wei@huawei.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sprd: Set request pending flag when DMA controller is active</title>
<updated>2020-03-23T06:08:24Z</updated>
<author>
<name>Zhenfang Wang</name>
</author>
<published>2020-03-12T13:26:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d0f19a48a185dab592afe1e18bf31a9d6790620d'/>
<id>urn:sha1:d0f19a48a185dab592afe1e18bf31a9d6790620d</id>
<content type='text'>
On new Spreadtrum platforms, when the CPU enters idle, it will close
the DMA controllers' clock to save power if the DMA controller is not
busy. Moreover the DMA controller's busy signal depends on the DMA
enable flag and the request pending flag.

When DMA controller starts to transfer data, which means we already
set the DMA enable flag, but now we should also set the request pending
flag, in case the DMA clock will be closed accidentally if the CPU
can not detect the DMA controller's busy signal.

Signed-off-by: Zhenfang Wang &lt;zhenfang.wang@unisoc.com&gt;
Signed-off-by: Baolin Wang &lt;baolin.wang7@gmail.com&gt;
Link: https://lore.kernel.org/r/02adbe4364ec436ec2c5bc8fd2386bab98edd884.1584019223.git.baolin.wang7@gmail.com
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sprd: Replace zero-length array with flexible-array member</title>
<updated>2020-02-19T12:18:40Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2020-02-14T17:15:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a18cd9bebdca50722534329948adf614239b8c4d'/>
<id>urn:sha1:a18cd9bebdca50722534329948adf614239b8c4d</id>
<content type='text'>
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Reviewed-by: Baolin Wang &lt;baolin.wang7@gmail.com&gt;
Link: https://lore.kernel.org/r/20200214171536.GA24077@embeddedor
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sprd: Add wrap address support for link-list mode</title>
<updated>2019-11-14T10:33:35Z</updated>
<author>
<name>Eric Long</name>
</author>
<published>2019-10-23T06:31:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a7e335deed174a37fc6f84f69caaeff8a08f8ff8'/>
<id>urn:sha1:a7e335deed174a37fc6f84f69caaeff8a08f8ff8</id>
<content type='text'>
The Spreadtrum Audio compress offload mode will use 2-stage DMA transfer
to save power. That means we can request 2 dma channels, one for source
channel, and another one for destination channel. Once the source channel's
transaction is done, it will trigger the destination channel's transaction
automatically by hardware signal.

In this case, the source channel will transfer data from IRAM buffer to
the DSP fifo to decoding/encoding, once IRAM buffer is empty by transferring
done, the destination channel will start to transfer data from DDR buffer
to IRAM buffer. Since the destination channel will use link-list mode to
fill the IRAM data, and IRAM buffer is allocated by 32K, and DDR buffer
is larger to 2M, that means we need lots of link-list nodes to do a cyclic
transfer, instead wasting lots of link-list memory, we can use wrap address
support to reduce link-list node number, which means when the transfer
address reaches the wrap address, the transfer address will jump to the
wrap_to address specified by wrap_to register, and only 2 link-list nodes
can do a cyclic transfer to transfer data from DDR to IRAM.

Thus this patch adds wrap address to support this case.

[Baolin Wang changes the commit message]
Signed-off-by: Eric Long &lt;eric.long@unisoc.com&gt;
Signed-off-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Link: https://lore.kernel.org/r/85a5484bc1f3dd53ce6f92700ad8b35f30a0b096.1571812029.git.baolin.wang@linaro.org
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'fixes' into next</title>
<updated>2019-11-14T10:32:51Z</updated>
<author>
<name>Vinod Koul</name>
</author>
<published>2019-11-14T10:32:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bb5a471de9bfd0853d48d8dc5572469778c2824d'/>
<id>urn:sha1:bb5a471de9bfd0853d48d8dc5572469778c2824d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>dmaengine: sprd: Fix the possible memory leak issue</title>
<updated>2019-10-15T10:17:24Z</updated>
<author>
<name>Baolin Wang</name>
</author>
<published>2019-10-09T09:11:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec1ac309596a7bdf206743b092748205f6cd5720'/>
<id>urn:sha1:ec1ac309596a7bdf206743b092748205f6cd5720</id>
<content type='text'>
If we terminate the channel to free all descriptors associated with this
channel, we will leak the memory of current descriptor if the current
descriptor is not completed, since it had been deteled from the desc_issued
list and have not been added into the desc_completed list.

Thus we should check if current descriptor is completed or not, when freeing
the descriptors associated with one channel, if not, we should free it to
avoid this issue.

Fixes: 9b3b8171f7f4 ("dmaengine: sprd: Add Spreadtrum DMA driver")
Reported-by: Zhenfang Wang &lt;zhenfang.wang@unisoc.com&gt;
Tested-by: Zhenfang Wang &lt;zhenfang.wang@unisoc.com&gt;
Signed-off-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Link: https://lore.kernel.org/r/170dbbc6d5366b6fa974ce2d366652e23a334251.1570609788.git.baolin.wang@linaro.org
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
<entry>
<title>dmaengine: sprd: Change to use devm_platform_ioremap_resource()</title>
<updated>2019-10-15T10:12:52Z</updated>
<author>
<name>Baolin Wang</name>
</author>
<published>2019-09-27T03:29:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f228a4a24492b9b147ce4efdd384e064d659e38a'/>
<id>urn:sha1:f228a4a24492b9b147ce4efdd384e064d659e38a</id>
<content type='text'>
Use the new helper that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together, which can simpify the code.

Signed-off-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Link: https://lore.kernel.org/r/1af3efdac3b217203cace090c8947386854c0144.1569554639.git.baolin.wang@linaro.org
Signed-off-by: Vinod Koul &lt;vkoul@kernel.org&gt;
</content>
</entry>
</feed>
