[PATCH v2] arm/tegra: use APB DMA for accessing APB devices
Olof Johansson
olof at lixom.net
Thu Jan 5 20:22:27 EST 2012
On Thu, Jan 5, 2012 at 2:07 PM, Stephen Warren <swarren at nvidia.com> wrote:
> Olof Johansson wrote at Wednesday, January 04, 2012 10:49 PM:
>> Tegra2 hangs if APB registers are accessed from the cpu during an
>> apb dma operation. The workaround is to use apb dma to read/write the
>> registers instead.
> ...
>> diff --git a/arch/arm/mach-tegra/apbio.c b/arch/arm/mach-tegra/apbio.c
> ...
>> +u32 tegra_apb_readl(unsigned long offset)
> ...
>> + INIT_COMPLETION(tegra_apb_wait);
>> +
>> + tegra_dma_enqueue_req(tegra_apb_dma, &req);
>> +
>> + ret = wait_for_completion_timeout(&tegra_apb_wait,
>> + msecs_to_jiffies(50));
>> +
>> + if (WARN(ret == 0, "apb read dma timed out")) {
>> + *(u32 *)tegra_apb_bb = 0;
>> + tegra_dma_dequeue_req(tegra_apb_dma, &req);
>
> I think you need to swap those last two lines to make absolutely sure
> that the timeout handling doesn't race with an actual DMA completion.
Ah, of course. Fixing that without reposting.
> Acked-by: Stephen Warren <swarren at nvidia.com>
Thanks!
-Olof
More information about the linux-arm-kernel
mailing list