netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [PATCH net-next 2/6] net: phy: improve phy_disable_eee_mode
Date: Sun, 16 Feb 2025 22:16:34 +0100	[thread overview]
Message-ID: <92164896-38ff-4474-b98b-e83fc05b9509@gmail.com> (raw)
In-Reply-To: <3caa3151-13ac-44a8-9bb6-20f82563f698@gmail.com>

If a mode is to be disabled, remove it from advertising_eee.
Disabling EEE modes shall be done before calling phy_start(),
warn if that's not the case.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 include/linux/phy.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/phy.h b/include/linux/phy.h
index 481f8e21f..26a11a0c7 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1345,7 +1345,10 @@ static inline bool phy_is_started(struct phy_device *phydev)
  */
 static inline void phy_disable_eee_mode(struct phy_device *phydev, u32 link_mode)
 {
+	WARN_ON(phy_is_started(phydev));
+
 	linkmode_set_bit(link_mode, phydev->eee_disabled_modes);
+	linkmode_clear_bit(link_mode, phydev->advertising_eee);
 }
 
 void phy_resolve_aneg_pause(struct phy_device *phydev);
-- 
2.48.1



  parent reply	other threads:[~2025-02-16 21:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-16 21:14 [PATCH net-next 0/6] net: phy: improve and simplify EEE handling in phylib Heiner Kallweit
2025-02-16 21:15 ` [PATCH net-next 1/6] net: phy: move definition of phy_is_started before phy_disable_eee_mode Heiner Kallweit
2025-02-16 21:56   ` Andrew Lunn
2025-02-17  8:54   ` Russell King (Oracle)
2025-02-16 21:16 ` Heiner Kallweit [this message]
2025-02-16 22:00   ` [PATCH net-next 2/6] net: phy: improve phy_disable_eee_mode Andrew Lunn
2025-02-17  8:54   ` Russell King (Oracle)
2025-02-16 21:17 ` [PATCH net-next 3/6] net: phy: remove disabled EEE modes from advertising_eee in phy_probe Heiner Kallweit
2025-02-16 22:02   ` Andrew Lunn
2025-02-17  8:54   ` Russell King (Oracle)
2025-02-16 21:18 ` [PATCH net-next 4/6] net: phy: c45: Don't silently remove disabled EEE modes any longer when writing advertisement register Heiner Kallweit
2025-02-17  8:55   ` Russell King (Oracle)
2025-02-16 21:19 ` [PATCH net-next 5/6] net: phy: c45: use cached EEE advertisement in genphy_c45_ethtool_get_eee Heiner Kallweit
2025-02-16 22:08   ` Andrew Lunn
2025-02-17  8:55   ` Russell King (Oracle)
2025-02-16 21:20 ` [PATCH net-next 6/6] net: phy: c45: remove local advertisement parameter from genphy_c45_eee_is_active Heiner Kallweit
2025-02-16 22:09   ` Andrew Lunn
2025-02-17  8:55   ` Russell King (Oracle)
2025-02-19  2:20 ` [PATCH net-next 0/6] net: phy: improve and simplify EEE handling in phylib patchwork-bot+netdevbpf

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=92164896-38ff-4474-b98b-e83fc05b9509@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).