From: Lukasz Majewski <lukma@denx.de>
To: Andrew Lunn <andrew@lunn.ch>, Russell King <linux@armlinux.org.uk>
Cc: Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Lukasz Majewski <lukma@denx.de>
Subject: [RFC] net: dsa: slave: Advertise correct EEE capabilities at slave PHY setup
Date: Tue, 30 May 2023 14:26:21 +0200 [thread overview]
Message-ID: <20230530122621.2142192-1-lukma@denx.de> (raw)
One can disable in device tree advertising of EEE capabilities of PHY
when 'eee-broken-100tx' property is present in DTS.
With DSA switch it also may happen that one would need to disable EEE due
to some network issues.
Corresponding switch DTS description:
switch@0 {
ports {
port@0 {
reg = <0>;
label = "lan1";
phy-handle = <&switchphy0>;
};
}
mdio {
switchphy0: switchphy@0 {
reg = <0>;
eee-broken-100tx;
};
};
This patch adjusts the content of MDIO_AN_EEE_ADV in MDIO_MMD_AN "device"
so the phydev->eee_broken_modes are taken into account from the start of
the slave PHYs.
As a result the 'ethtool --show-eee lan1' shows that EEE is not supported
from the outset.
Questions:
- Is the genphy_config_eee_advert() appropriate to be used here?
As I found this issue on 5.15 kernel, it looks like mainline now uses
PHY features for handle EEE (but the aforementioned function is still
present in newest mainline - v6.4-rc1).
- I've also observed strange behaviour for EEE capability register:
Why the value in MDIO_MMD_PCS device; reg MDIO_PCS_EEE_ABLE is somewhat
"volatile" - in a sense that when I use:
ethtool --set-eee lan2 eee off
It is cleared by PHY itself to 0x0 (from 0x2) and turning it on again is
not working.
Is this expected? Or am I missing something?
Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
net/dsa/slave.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 353d8fff3166..712923c7d4e2 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -2247,6 +2247,7 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev)
phylink_destroy(dp->pl);
}
+ genphy_config_eee_advert(slave_dev->phydev);
return ret;
}
--
2.37.3
next reply other threads:[~2023-05-30 12:27 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-30 12:26 Lukasz Majewski [this message]
2023-05-30 12:59 ` Russell King (Oracle)
2023-05-30 14:07 ` Lukasz Majewski
2023-05-30 14:22 ` Russell King (Oracle)
2023-05-30 14:26 ` Andrew Lunn
2023-05-30 14:41 ` Russell King (Oracle)
2023-05-31 8:16 ` Lukasz Majewski
2023-05-31 8:37 ` Russell King (Oracle)
2023-05-30 14:47 ` Lukasz Majewski
2023-05-30 15:08 ` Russell King (Oracle)
2023-05-31 8:43 ` Lukasz Majewski
2023-05-31 12:56 ` Andrew Lunn
2023-05-30 14:57 ` Lukasz Majewski
2023-05-30 14:23 ` Andrew Lunn
2023-05-30 14:40 ` Lukasz Majewski
2023-05-30 17:15 ` Andrew Lunn
2023-05-31 8:44 ` Lukasz Majewski
2023-05-30 13:17 ` Andrew Lunn
2023-05-30 13:40 ` Lukasz Majewski
2023-05-31 8:12 ` Oleksij Rempel
2023-05-31 9:31 ` Lukasz Majewski
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=20230530122621.2142192-1-lukma@denx.de \
--to=lukma@denx.de \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@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®