From: Andrew Lunn <andrew@lunn.ch>
To: Rosen Penev <rosenp@gmail.com>
Cc: netdev@vger.kernel.org, Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Michael Stapelberg <michael@stapelberg.de>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] net: phy: marvell: keep WOL_EIE across interrupt reconfiguration
Date: Tue, 6 Oct 2026 01:49:58 +0200 [thread overview]
Message-ID: <6fd06ce1-e792-4ce9-a0db-711fad1ffeef@lunn.ch> (raw)
In-Reply-To: <20261005225028.465866-1-rosenp@gmail.com>
> #define MII_M1011_IMASK 0x12
> #define MII_M1011_IMASK_INIT 0x6400
> #define MII_M1011_IMASK_CLEAR 0x0000
> +/* Bits updated by config_intr. The WoL interrupt enable is owned by
> + * set_wol, so the config_intr call from phy_init_hw() on resume does not
> + * silently disarm Wake-on-LAN.
> + */
> +#define MII_M1011_IMASK_CONFIG_MASK (U16_MAX & ~MII_88E1318S_PHY_CSIER_WOL_EIE)
I still don't like this. The name MII_88E1318S_PHY_CSIER_ suggests
this belongs to the MII_88E1318S_PHY_CSIER register.
> + err = phy_modify(phydev, MII_M1011_IMASK,
> + MII_M1011_IMASK_CONFIG_MASK,
> + MII_M1011_IMASK_INIT);
> } else {
> - err = phy_write(phydev, MII_M1011_IMASK,
> - MII_M1011_IMASK_CLEAR);
> + err = phy_modify(phydev, MII_M1011_IMASK,
> + MII_M1011_IMASK_CONFIG_MASK,
> + MII_M1011_IMASK_CLEAR);
But here you apply it to the MII_M1011_IMASK register.
> + if (!(wol->wolopts & (WAKE_MAGIC | WAKE_PHY))) {
> + err = marvell_write_page(phydev, MII_MARVELL_COPPER_PAGE);
> + if (err < 0)
> + goto error;
> +
> + /* Disable the WOL interrupt, config_intr leaves it alone */
> + err = __phy_clear_bits(phydev, MII_M1011_IMASK,
> + MII_88E1318S_PHY_CSIER_WOL_EIE);
And here it much more obviously looks wrong. These prefixes are there
to catch dumb typos, and somebody is going to look at this, and think
it is a dumb typo and report it.
Please fix the naming.
Andrew
---
pw-bot: cr
prev parent reply other threads:[~2026-10-05 23:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 22:50 Rosen Penev
2026-10-05 22:55 ` netdev-bot+sinfo
2026-10-05 23:16 ` Rosen Penev
2026-10-05 23:49 ` Andrew Lunn [this message]
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=6fd06ce1-e792-4ce9-a0db-711fad1ffeef@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=michael@stapelberg.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rosenp@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
all inboxes | Powered by JetHome®