From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Hunter Subject: Re: [PATCH V2 2/2] dmaengine: tegra-adma: Add support for Tegra210 ADMA Date: Tue, 6 Oct 2015 10:45:01 +0100 Message-ID: <5613981D.3040503@nvidia.com> References: <1444047007-30494-1-git-send-email-jonathanh@nvidia.com> <1444047007-30494-3-git-send-email-jonathanh@nvidia.com> <16524792.BmEijCQ1oc@wuerfel> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <16524792.BmEijCQ1oc@wuerfel> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Arnd Bergmann Cc: Laxman Dewangan , Vinod Koul , Stephen Warren , Thierry Reding , Alexandre Courbot , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-tegra@vger.kernel.org On 06/10/15 10:32, Arnd Bergmann wrote: > On Monday 05 October 2015 13:10:07 Jon Hunter wrote: >> Add support for the Tegra210 Audio DMA controller that is used for >> transferring data between system memory and the Audio sub-system. >> The driver only supports cyclic transfers because this is being solely >> used for audio. >> >> This driver is based upon the work by Dara Ramesh . >> >> Signed-off-by: Jon Hunter > > This version looks much better! > > Just one small comment: > >> + slave_req = dma_spec->args[0]; >> + slave_dir = dma_spec->args[1]; >> + >> + if (slave_req == 0) >> + return NULL; >> + >> + switch (slave_dir) { >> + case ADMA_AHUB_TO_MEM: >> + if (slave_req > tdma->rx_requests) >> + return NULL; >> + >> + if (tdma->rx_requests_reserved & BIT(slave_req)) >> + return NULL; >> + >> + tdma->rx_requests_reserved |= BIT(slave_req); >> + break; > > The rx_requests_reserved logic looks racy, if you have more than > one concurrent request or release. Better use atomic_test_and_set() > here and turn the variable into an atomic_t. Ah yes, will update. Thanks Jon