Re: [PATCH v2] arm/tegra: use APB DMA for accessing APB devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 5, 2012 at 2:07 PM, Stephen Warren <swarren@xxxxxxxxxx> 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@xxxxxxxxxx>

Thanks!

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


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux