From: Christian Marangi <ansuelsmth@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "Russell King (Oracle)" <linux@armlinux.org.uk>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Robert Marko <robimarko@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel test robot <lkp@intel.com>
Subject: Re: [net-next PATCH] net: phy: aquantia: drop wrong endianness conversion for addr and CRC
Date: Wed, 22 Nov 2023 19:39:44 +0100 [thread overview]
Message-ID: <655e4af3.050a0220.54c5a.113b@mx.google.com> (raw)
In-Reply-To: <20231122102347.0bde86bb@kernel.org>
On Wed, Nov 22, 2023 at 10:23:47AM -0800, Jakub Kicinski wrote:
> On Wed, 22 Nov 2023 18:53:39 +0100 Christian Marangi wrote:
> > So they DO get converted to the HOST endian on reading the firmware from
> > an nvmem cell or a filesystem?
>
> They don't get converted when "reading from nvmem / fs".
> They get converted when you do:
>
> word = get_unaligned((const u32 *)(data + pos));
>
> get_unaligned() is basically:
>
> #if BIGENDIAN
> #define get_unaligned get_unaligned_be32
> #else
> #define get_unaligned get_unaligned_le32
> #endif
>
> so you'll get different behavior here depending on the CPU.
Ugh... If that is true this is bad...
When get_unaligned was suggested, I checked if the thing was doing any
kind of conversion and from [1] I tought it was just getting the
pointer.
I can't find the entry where the thing is done. Is this some kind of
include magic with asm specific API?
[1] https://elixir.bootlin.com/linux/latest/source/include/asm-generic/unaligned.h#L22
--
Ansuel
next prev parent reply other threads:[~2023-11-22 18:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 17:08 [net-next PATCH] net: phy: aquantia: drop wrong endianness conversion for addr and CRC Christian Marangi
2023-11-22 17:24 ` Russell King (Oracle)
2023-11-22 17:53 ` Christian Marangi
2023-11-22 18:23 ` Jakub Kicinski
2023-11-22 18:39 ` Christian Marangi [this message]
2023-11-22 18:53 ` Russell King (Oracle)
2023-11-22 19:55 ` Christian Marangi
2023-11-22 20:25 ` Russell King (Oracle)
2023-11-22 21:09 ` Christian Marangi
2023-11-22 22:31 ` Russell King (Oracle)
2023-11-22 22:37 ` Christian Marangi
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=655e4af3.050a0220.54c5a.113b@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lkp@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robimarko@gmail.com \
/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).