LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Arend van Spriel <arend@broadcom.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
Will Deacon <will.deacon@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
David Miller <davem@davemloft.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"brcm80211-dev-list@broadcom.com"
<brcm80211-dev-list@broadcom.com>,
linux-wireless <linux-wireless@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: using DMA-API on ARM
Date: Fri, 5 Dec 2014 12:59:32 +0000 [thread overview]
Message-ID: <20141205125932.GR11285@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <5481A855.6000603@broadcom.com>
On Fri, Dec 05, 2014 at 01:43:01PM +0100, Arend van Spriel wrote:
> Ok. You already had a peek in our code checking the memory barriers, which
> does not have the dma_sync_single_for_cpu() "workaround" yet. So here some
> more background. The problem is in DMA_FROM_DEVICE direction. Because of the
> possible reordering issue we first tried using rmb() in the retry loop but
> that did not solve it. Another experiment was to ignore the failed ring
> descriptor entry and proceed. So we get interrupt from device and access the
> ring descriptor entry. This should contain expected value X, however we get
> X-1 back. When proceeding everything works find until hitting the same ring
> descriptor entry again reading X-1 when X+1 would be valid. This lead us to
> the assumption that somehow this entry ended up in cache lines. The issue
> goes away using the dma_sync_single_for_cpu() with DMA_FROM_DEVICE in
> direction parameter.
Can you give some further detail - I think it would help understanding
if you could give:
- the initial numerical state of the descriptor (presumably setup by
msgbuf.c calling brcmf_commonring_reserve_for_write(), and then
writing the contents into the ring buffer, followed by
brcmf_commonring_write_complete().
- time passes, the hardware processes the entry
- the numerical state of the descriptor (which is in error) which you
read back
- the expected numerical state of the descriptor
> So is there any function interface to verify cache status.
There isn't, but if you dump the virtual address, and you have debugfs
enabled, along with CONFIG_ARM_PTDUMP, you should be able to find the
mapping in /sys/kernel/debug/kernel_page_tables, which will tell you
the attributes that it's mapped using.
What it won't tell you is whether there's an alias of the mapping with
differing attributes. If you use dma_to_pfn() to convert the DMA handle
into a PFN, we can use that to see whether there could be another mapping
from the kernel page table dump (by checking whether the PFN would be a
lowmem PFN, and therefore whether it's already mapped at it's lowmem
address.)
If you'd like to mail me (in addition to the ring contents above):
- the kernel_page_tables dump
- virtual address of the ring buffer
- dma_to_pfn() converted DMA handle of the ring buffer
- PHYS_PFN_OFFSET for your platform
then I can see whether there is.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2014-12-05 12:59 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-05 9:22 Arend van Spriel
2014-12-05 9:45 ` Russell King - ARM Linux
2014-12-05 12:24 ` Will Deacon
2014-12-05 12:56 ` Hante Meuleman
2014-12-05 13:23 ` Russell King - ARM Linux
2014-12-05 14:20 ` Hante Meuleman
2014-12-05 14:47 ` Arend van Spriel
2014-12-08 13:47 ` Hante Meuleman
2014-12-08 15:01 ` Arnd Bergmann
2014-12-08 15:17 ` Russell King - ARM Linux
2014-12-08 15:22 ` Arnd Bergmann
2014-12-08 16:03 ` Catalin Marinas
2014-12-08 17:01 ` Arend van Spriel
2014-12-09 10:19 ` Arend van Spriel
2014-12-09 10:29 ` Russell King - ARM Linux
2014-12-09 11:07 ` Arend van Spriel
2014-12-09 11:54 ` Catalin Marinas
2015-01-20 15:22 ` Fabio Estevam
2014-12-08 16:22 ` Arend van Spriel
2014-12-08 16:38 ` Arnd Bergmann
2014-12-08 16:47 ` Russell King - ARM Linux
2014-12-08 16:50 ` Catalin Marinas
2014-12-08 16:54 ` Russell King - ARM Linux
2014-12-05 15:06 ` Russell King - ARM Linux
2014-12-05 18:28 ` Catalin Marinas
2014-12-05 19:22 ` Arend van Spriel
2014-12-05 19:25 ` Russell King - ARM Linux
2014-12-05 12:43 ` Arend van Spriel
2014-12-05 12:59 ` Russell King - ARM Linux [this message]
2014-12-05 9:52 ` Arnd Bergmann
2014-12-05 11:11 ` Russell King - ARM Linux
2014-12-05 11:49 ` Hante Meuleman
2014-12-05 17:38 ` Catalin Marinas
2014-12-05 18:24 ` Russell King - ARM Linux
2014-12-05 18:31 ` Catalin Marinas
2014-12-05 18:39 ` Catalin Marinas
2014-12-05 18:53 ` Catalin Marinas
2014-12-05 19:50 ` Arend van Spriel
2014-12-08 12:55 ` Johannes Stezenbach
2014-12-08 15:55 ` Catalin Marinas
2014-12-08 16:50 ` Johannes Stezenbach
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=20141205125932.GR11285@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=arend@broadcom.com \
--cc=arnd@arndb.de \
--cc=brcm80211-dev-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=will.deacon@arm.com \
--subject='Re: using DMA-API on ARM' \
/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
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).