Re: [PATCH net-next 5/9] net: dsa: microchip: implement .support_eee() only if needed
From: Bastien Curutchet
Date: Tue Jun 02 2026 - 08:23:58 EST
Hi Paolo,
On 6/1/26 10:55 AM, Paolo Abeni wrote:
On 5/26/26 11:47 AM, Bastien Curutchet (Schneider Electric) wrote:
diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
index a39541d29ad5..e0b3724a7558 100644
--- a/drivers/net/dsa/microchip/ksz9477.c
+++ b/drivers/net/dsa/microchip/ksz9477.c
@@ -1909,6 +1909,54 @@ void ksz9477_phylink_mac_link_up(struct phylink_config *config,
ksz9477_duplex_flowctrl(dev, port, duplex, tx_pause, rx_pause);
}
+/**
+ * ksz9477_support_eee - Determine Energy Efficient Ethernet (EEE) support for a
+ * port
+ * @ds: Pointer to the DSA switch structure
+ * @port: Port number to check
+ *
+ * This function also documents devices where EEE was initially advertised but
+ * later withdrawn due to reliability issues, as described in official errata
+ * documents. These devices are explicitly listed to record known limitations,
+ * even if there is no technical necessity for runtime checks.
+ *
+ * Returns: true if the internal PHY on the given port supports fully
+ * operational EEE, false otherwise.
+ */
+static bool ksz9477_support_eee(struct dsa_switch *ds, int port)
+{
+ struct ksz_device *dev = ds->priv;
+
+ if (!dev->info->internal_phy[port])
+ return false;
+
+ switch (dev->chip_id) {
+ case KSZ8563_CHIP_ID:
+ case KSZ9563_CHIP_ID:
+ case KSZ9893_CHIP_ID:
+ return true;
+ default:
+ /* KSZ8567R Errata DS80000752C Module 4 */
+ /* KSZ9477S Errata DS80000754A Module 4 */
+ /* KSZ9567S Errata DS80000756A Module 4 */
+ /* KSZ9896C Errata DS80000757A Module 3 */
+ /* KSZ9897R Errata DS80000758C Module 4 */
Sashiko noted that errata:
/* KSZ879x/KSZ877x/KSZ876x Errata DS80000687C Module 2 */
has been lost above.
Yes that was more or less intended because KSZ879x/KSZ877x/KSZ876x don't belong to the KSZ9477 family. I haven't found a relevant place to move this comment as .support_eee() is removed from ksz8.c, maybe I should have mentioned it in the commit log.
diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c
index f8f220242f7a..4cbbcf7993c9 100644
--- a/drivers/net/dsa/microchip/lan937x_main.c
+++ b/drivers/net/dsa/microchip/lan937x_main.c
@@ -915,7 +915,6 @@ const struct dsa_switch_ops lan937x_switch_ops = {
.port_txtstamp = ksz_port_txtstamp,
.port_rxtstamp = ksz_port_rxtstamp,
.port_setup_tc = ksz_setup_tc,
- .support_eee = ksz_support_eee,
.set_mac_eee = ksz_set_mac_eee,
Sashiko noted that `set_mac_eee` usage is gated by `support_eee` presence,
you may want to remove even the set callback.
True, will do.
Best regards,
Bastien