Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753355AbbKQJFi (ORCPT ); Tue, 17 Nov 2015 04:05:38 -0500 Received: from www.augenpunkt.de ([213.239.207.9]:35230 "EHLO www.augenpunkt.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752733AbbKQJFR (ORCPT ); Tue, 17 Nov 2015 04:05:17 -0500 Subject: Re: [PATCH] dmaengine: bcm2835-dma: Convert to use DMA pool To: Peter Ujfalusi , vinod.koul@intel.com, swarren@wwwdotorg.org, lee@kernel.org, eric@anholt.net References: <1447672143-14201-1-git-send-email-peter.ujfalusi@ti.com> <564ADB44.9050005@ti.com> Cc: dmaengine@vger.kernel.org, dan.j.williams@intel.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org From: Stefan Wahren Message-ID: <564AEDB5.7000201@lategoodbye.de> Date: Tue, 17 Nov 2015 10:04:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <564ADB44.9050005@ti.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2368 Lines: 67 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 >> --- >> 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 >> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/