Re: [PATCH V2 2/2] dmaengine: tegra-adma: Add support for Tegra210 ADMA
From: Jon Hunter
Date: Tue Oct 06 2015 - 05:45:14 EST
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 <dramesh@xxxxxxxxxx>.
>>
>> Signed-off-by: Jon Hunter <jonathanh@xxxxxxxxxx>
>
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/