linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: olof@lixom.net (Olof Johansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm/tegra: use APB DMA for accessing APB devices
Date: Thu, 5 Jan 2012 17:22:27 -0800	[thread overview]
Message-ID: <CAOesGMg7GbEeMXAsftq+eZuqEOTLgeufePSC3h4mKn1cVnuEWQ@mail.gmail.com> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF17761F1812@HQMAIL01.nvidia.com>

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

Thanks!

-Olof

  reply	other threads:[~2012-01-06  1:22 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-23  0:17 [PATCH 0/9] arm/tegra: fuse cleanup and emc device tree support Olof Johansson
2011-12-23  0:17 ` [PATCH 1/9] arm/tegra: Don't WARN_ON() for too early dma channel allocations Olof Johansson
2011-12-23  0:17 ` [PATCH 2/9] arm/tegra: use APB DMA for accessing APB devices Olof Johansson
2012-01-04 22:08   ` Stephen Warren
2012-01-04 23:39     ` Olof Johansson
2012-01-05  5:49   ` [PATCH v2] " Olof Johansson
2012-01-05 22:07     ` Stephen Warren
2012-01-06  1:22       ` Olof Johansson [this message]
2011-12-23  0:17 ` [PATCH 3/9] arm/tegra: fuse: use apbio dma for register access Olof Johansson
2011-12-23  0:17 ` [PATCH 4/9] arm/tegra: fuse: add functions to access chip revision Olof Johansson
2011-12-23 10:47   ` Henning Heinold
2012-01-04  3:46     ` Olof Johansson
2012-01-04 23:20   ` Stephen Warren
2012-01-04 23:36     ` Olof Johansson
2012-01-05  5:50   ` [PATCH v2] " Olof Johansson
2012-01-05 22:08     ` Stephen Warren
2011-12-23  0:17 ` [PATCH 5/9] arm/tegra: fuse: add bct strapping reading Olof Johansson
2011-12-23  0:17 ` [PATCH 6/9] arm/tegra: emc: convert tegra2_emc to a platform driver Olof Johansson
2012-01-04 23:39   ` Stephen Warren
2012-01-04 23:42     ` Olof Johansson
2012-01-05  5:56   ` [PATCH v2] " Olof Johansson
2012-01-05  6:01     ` [PATCH v3] " Olof Johansson
2012-01-05 22:14       ` Stephen Warren
2012-01-06  1:36         ` Olof Johansson
2012-01-06  1:42       ` [PATCH v4] ARM: tegra: " Olof Johansson
2012-01-06 17:17         ` Stephen Warren
2011-12-23  0:17 ` [PATCH 7/9] arm/tegra: emc: device tree bindings Olof Johansson
2012-01-02  9:00   ` Grant Likely
2012-01-06  0:01   ` Stephen Warren
2012-01-06  1:20     ` Olof Johansson
2012-01-12 20:03       ` Simon Glass
2012-01-12 20:50         ` Stephen Warren
2012-01-12 21:01           ` Simon Glass
2012-01-12 21:48   ` Simon Glass
2011-12-23  0:17 ` [PATCH 8/9] arm/tegra: seaboard: add EMC table to device tree Olof Johansson
2012-01-04 23:51   ` Stephen Warren
2012-01-04 23:55     ` Olof Johansson
2012-01-05  0:11       ` Linus Walleij
2012-01-05  5:43         ` Olof Johansson
2011-12-23  0:17 ` [PATCH 9/9] arm/tegra: emc: device tree support Olof Johansson
2012-01-05  0:27   ` Stephen Warren
2012-01-05  0:35     ` Olof Johansson
2012-01-05  6:02   ` [PATCH v2] " Olof Johansson
2012-01-05 22:35     ` Stephen Warren
2012-01-06  1:26       ` Olof Johansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOesGMg7GbEeMXAsftq+eZuqEOTLgeufePSC3h4mKn1cVnuEWQ@mail.gmail.com \
    --to=olof@lixom.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).