From: davem@davemloft.net (David Miller)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2] net: moxart: use correct accessors for DMA memory
Date: Fri, 29 Jan 2016 19:40:21 -0800 (PST) [thread overview]
Message-ID: <20160129.194021.1464359327401868408.davem@davemloft.net> (raw)
In-Reply-To: <2689110.SEuesVebGN@wuerfel>
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 28 Jan 2016 17:54:33 +0100
> The moxart ethernet driver confuses coherent DMA buffers with
> MMIO registers.
>
> moxart_ether.c: In function 'moxart_mac_setup_desc_ring':
> moxart_ether.c:146:428: error: passing argument 1 of '__fswab32' makes integer from pointer without a cast [-Werror=int-conversion]
> moxart_ether.c:74:39: warning: incorrect type in argument 3 (different address spaces)
> moxart_ether.c:74:39: expected void *cpu_addr
> moxart_ether.c:74:39: got void [noderef] <asn:2>*tx_desc_base
>
> This leaves the basic logic alone and uses normal pointers for
> the virtual address of the descriptor. As we cannot use readl/writel
> to access them, we also introduce our own moxart_desc_read
> moxart_desc_write helpers that perform the same endianess swap
> as the original code, but without the address space conversion.
>
> The barriers are made explicit here where needed: Even in the worst-case
> scenario, we just have to use a rmb() after checking ownership so
> we don't read any input data before we are sure it is value, and we
> use wmb() before transferring ownership back to the device.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thanks.
prev parent reply other threads:[~2016-01-30 3:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-28 16:54 [PATCHv2] net: moxart: use correct accessors for DMA memory Arnd Bergmann
2016-01-30 3:40 ` David Miller [this message]
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=20160129.194021.1464359327401868408.davem@davemloft.net \
--to=davem@davemloft.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).