From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Michael Weiser <michael.weiser@gmx.de>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 3/3] net: ethernet: sun4i-emac: Read rxhdr in CPU byte-order
Date: Mon, 14 Nov 2016 19:59:34 +0100 [thread overview]
Message-ID: <20161114185934.2wfwyrv6buvnrja7@lukather> (raw)
In-Reply-To: <20161114175807.4747-4-michael.weiser@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]
On Mon, Nov 14, 2016 at 06:58:07PM +0100, Michael Weiser wrote:
> The EMAC EMAC_RX_IO_DATA_REG data register is dual-purpose: On one hand
> it is used to move actual packet data off the wire. This will be in
> wire-format and accepted as such by higher layers such as IP. Therefore
> it is correctly read as-is (i.e. raw) using readsl.
>
> On the other hand it provides metadata about incoming transfers to the
> driver such as length and checksum validation status. This data is
> little-endian, always and it is interpreted by the driver. Therefore it
> needs to be swapped to CPU endianness to make sense to the driver. This
> is already done for the "receive header" but not rxhdr.
>
> Read rxhdr using readl in order for sun4i-emac to work correctly when
> running a big-endian kernel.
>
> Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: netdev@vger.kernel.org
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
next prev parent reply other threads:[~2016-11-14 18:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-14 17:58 [PATCH 0/3 v5] Fixes for running a big-endian kernel on Cubieboard2 Michael Weiser
2016-11-14 17:58 ` [PATCH 1/3] net: ethernet: stmmac: change dma descriptors to __le32 Michael Weiser
2016-11-14 17:58 ` [PATCH 2/3] net: ethernet: sun4i-emac: Allow to enable netif messages Michael Weiser
2016-11-14 19:00 ` Maxime Ripard
2016-11-14 17:58 ` [PATCH 3/3] net: ethernet: sun4i-emac: Read rxhdr in CPU byte-order Michael Weiser
2016-11-14 18:59 ` Maxime Ripard [this message]
2016-11-16 3:06 ` [PATCH 0/3 v5] Fixes for running a big-endian kernel on Cubieboard2 David Miller
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=20161114185934.2wfwyrv6buvnrja7@lukather \
--to=maxime.ripard@free-electrons.com \
--cc=michael.weiser@gmx.de \
--cc=netdev@vger.kernel.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