From: Jakub Kicinski <kuba@kernel.org>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"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: make mailbox interface4 lsw addr mask more specific
Date: Tue, 21 Nov 2023 15:39:18 -0800 [thread overview]
Message-ID: <20231121153918.4234973d@kernel.org> (raw)
In-Reply-To: <655d3e2b.df0a0220.50550.b235@mx.google.com>
On Wed, 22 Nov 2023 00:32:56 +0100 Christian Marangi wrote:
> the 2 addr comes from a define
>
> #define DRAM_BASE_ADDR 0x3FFE0000
> #define IRAM_BASE_ADDR 0x40000000
>
> it wasn't clear to me if on BE these addrs gets saved differently or
> not. PHY wants the addr in LE.
>
> On testing by removing the cpu_to_le32 the error is correctly removed!
>
> I guess on BE the addr was actually swapped and FIELD_GET was correctly
> warning (and failing) as data was missing in applying the mask.
I think so. It's the responsibility of whether underlies
phy_write_mmd() to make sure the data is put on the bus in
correct order (but that's still just within the u16 boundaries,
splitting a constant into u16 halves is not endian dependent).
> If all of this makes sense, will send a followup patch that drop the
> cpu_to_le32 and also the other in the bottom that does cpu_to_be32 (to a
> __swab32 as FW is LE and mailbox calculate CRC in BE)
Not so sure about this one, it puts the u32 on the stack, and takes
the address of it:
u32 word;
word = (__force u32)cpu_to_be32(word);
crc = crc_ccitt_false(crc, (u8 *)&word, sizeof(word));
so the endian will matter here. My guess is that this part is correct.
next prev parent reply other threads:[~2023-11-21 23:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-20 19:35 [net-next PATCH] net: phy: aquantia: make mailbox interface4 lsw addr mask more specific Christian Marangi
2023-11-21 23:08 ` Jakub Kicinski
2023-11-21 23:32 ` Christian Marangi
2023-11-21 23:39 ` Jakub Kicinski [this message]
2023-11-21 23:48 ` Christian Marangi
2023-11-21 23:58 ` Jakub Kicinski
2023-11-22 0:04 ` Christian Marangi
2023-11-22 10:12 ` Russell King (Oracle)
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=20231121153918.4234973d@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--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).