From: info@lategoodbye.de (Stefan Wahren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] dmaengine: bcm2835-dma: Convert to use DMA pool
Date: Tue, 17 Nov 2015 10:04:53 +0100 [thread overview]
Message-ID: <564AEDB5.7000201@lategoodbye.de> (raw)
In-Reply-To: <564ADB44.9050005@ti.com>
Hi Peter,
Am 17.11.2015 um 08:46 schrieb Peter Ujfalusi:
> Hi,
>
> On 11/16/2015 01:09 PM, Peter Ujfalusi wrote:
>> f93178291712 dmaengine: bcm2835-dma: Fix memory leak when stopping a
>> running transfer
>>
>> Fixed the memleak, but introduced another issue: the terminate_all callback
>> might be called with interrupts disabled and the dma_free_coherent() is
>> not allowed to be called when IRQs are disabled.
>> Convert the driver to use dma_pool_* for managing the list of control
>> blocks for the transfer.
>
> FWIW: the patch has been tested and verified on Raspbery Pi:
> https://github.com/raspberrypi/linux/pull/1178#issuecomment-157026794
> https://github.com/raspberrypi/linux/pull/1178#issuecomment-157030190
>
> It needed some modification since the Raspberry Pi kernel have non upstreamed
> changes in bcm2835-dma driver (slave_sg support for example).
>
> It would be great if this patch can make it to 4.4 as a fix.
>
> Thanks,
> P?ter
>
>>
>> Fixes: f93178291712 ("dmaengine: bcm2835-dma: Fix memory leak when stopping a running transfer")
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>> ---
>> Hi,
>>
>> It was brought to my attention that the memleak fix broke the bcm2835 DMA. I did
>> not noticed the use of dma_free_coherent() in the driver when I did the memleak
>> fix.
>> Since the driver does leaking memory every time the audio is stopped, the other
>> option is to convert it to use DMA pool.
>> I do not have access the Raspberry Pi, so I can not test this patch but it
>> compiles ;)
>> Can someone test this one out if it is working?
i tried to test it yesterday with dmatest until i noticed that the
bcm2835 dmaengine didn't provide the necessary capabilities (DMA_MEMCPY).
Sorry, i'm not an expert here. Could you please provide at least one
test scenario which should work with Linux 4.4-rc1 without any special
hardware?
Do you know which bcm2835 drivers make use of the relevant code?
Btw if you want that somebody test the patch for you, then it's possible
to mark it as request for testing "[PATCH RFT]".
Best regards
Stefan
>>
>> Regards,
>> Peter
>>
next prev parent reply other threads:[~2015-11-17 9:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-16 11:09 [PATCH] dmaengine: bcm2835-dma: Convert to use DMA pool Peter Ujfalusi
2015-11-17 7:46 ` Peter Ujfalusi
2015-11-17 9:04 ` Stefan Wahren [this message]
2015-11-17 9:19 ` Peter Ujfalusi
2015-11-23 13:20 ` Matthias Reichl
2015-11-23 17:01 ` Stefan Wahren
2015-11-24 18:34 ` Eric Anholt
2015-12-05 10:08 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=564AEDB5.7000201@lategoodbye.de \
--to=info@lategoodbye.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).