On Thu, Jan 5, 2012 at 2:07 PM, Stephen Warren <[email protected]> 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 <[email protected]>

Thanks!

-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to