[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <655e4af3.050a0220.54c5a.113b@mx.google.com>
Date: Wed, 22 Nov 2023 19:39:44 +0100
From: Christian Marangi <ansuelsmth@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "Russell King (Oracle)" <linux@...linux.org.uk>,
Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Robert Marko <robimarko@...il.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>
Subject: Re: [net-next PATCH] net: phy: aquantia: drop wrong endianness
conversion for addr and CRC
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
Powered by blists - more mailing lists