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:08:59 -0800 [thread overview]
Message-ID: <20231121150859.7f934627@kernel.org> (raw)
In-Reply-To: <20231120193504.5922-1-ansuelsmth@gmail.com>
On Mon, 20 Nov 2023 20:35:04 +0100 Christian Marangi wrote:
> It seems some arch (s390) require a more specific mask for FIELD_PREP
> and doesn't like using GENMASK(15, 2) for u16 values.
>
> Fix the compilation error by adding the additional mask for the BITS
> that the PHY ignore and AND the passed addr with the real mask that the
> PHY will parse for the mailbox interface 4 addr to make sure extra
> values are correctly removed.
Ah. Um. Pff. Erm. I'm not sure.
Endianness is not my strong suit but this code:
/* PHY expect addr in LE */
addr = (__force u32)cpu_to_le32(addr);
/* ... use (u16)(addr) */
/* ... use (u16)(addr >> 16) */
does not make sense to me.
You're operating on register values here, there is no endian.
Endian only exists when you store or load from memory. IOW, this:
addr = 0x12345678;
print((u16)addr);
print(addr >> 16);
will print the same exact thing regardless of the CPU endian.
Why did you put the byte swap in there?
--
pw-bot: cr
next prev parent reply other threads:[~2023-11-21 23:09 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 [this message]
2023-11-21 23:32 ` Christian Marangi
2023-11-21 23:39 ` Jakub Kicinski
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=20231121150859.7f934627@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).