From: Lukasz Majewski <lukma@denx.de>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Eric Dumazet <edumazet@google.com>, Andrew Lunn <andrew@lunn.ch>,
davem@davemloft.net, Woojung Huh <woojung.huh@microchip.com>,
Vladimir Oltean <olteanv@gmail.com>,
Tristram.Ha@microchip.com,
Florian Fainelli <f.fainelli@gmail.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
UNGLinuxDriver@microchip.com,
Russell King <linux@armlinux.org.uk>,
Heiner Kallweit <hkallweit1@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] net: phy: Provide Module 4 KSZ9477 errata (DS80000754C)
Date: Wed, 30 Aug 2023 15:23:54 +0200 [thread overview]
Message-ID: <20230830152354.57108943@wsk> (raw)
In-Reply-To: <20230830121738.GJ31399@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 2865 bytes --]
Hi Oleksij,
> On Wed, Aug 30, 2023 at 01:51:51PM +0200, Lukasz Majewski wrote:
> > Hi Oleksij,
>
> > It looks like the most optimal solution would be the one proposed by
> > Tristam:
> > https://www.spinics.net/lists/netdev/msg932044.html
>
> In this case, please add the reason why it would work on this HW and
> will not break by any changes in PHYlib or micrel.c driver.
>
The ksz9477_config_cpu_port() is called from ksz_setup. In this
function we would clear 7.60 MMD register for EEE advertisement.
Only after the switch initialization, the phy code reads 7.60 register
for each port and on that basis decides if the EEE is supported or not.
(And only then ksz9477_get_features() is executed. Finally
ksz_get_phy_flags() is called.
> If I remember it correctly, in KSZ9477 variants, if you write to EEE
> advertisement register, it will affect the state of a EEE capability
> register. Which break IEEE 802.3 specification and the reason why
> ksz9477_get_features() actually exist. But can be used as workaround
> if it is written early enough before PHYlib tried to read EEE
> capability register.
>
> Please confirm my assumption by applying your workaround and testing
> it with ethtool --show-eee lanX.
>
# ethtool --show-eee lan1
EEE Settings for lan1:
EEE status: disabled
Tx LPI: 0 (us)
Supported EEE link modes: 100baseT/Full
1000baseT/Full
Advertised EEE link modes: Not reported
Link partner advertised EEE link modes: Not reported
#
# ethtool --show-eee lan2
EEE Settings for lan2:
EEE status: disabled
Tx LPI: 0 (us)
Supported EEE link modes: 100baseT/Full
1000baseT/Full
Advertised EEE link modes: Not reported
Link partner advertised EEE link modes: Not reported
> It should be commented in the code with all kind of warnings:
> Don't move!!! We use one bug to workaround another bug!!!
As I've pointed out in the previous e-mail. This kind of bug cannot be
easily fixed with modifying flags in ksz_get_phy_flags() as this
function is called after ksz9477_get_features().
I'm open for ideas to do it right...
> If PHYlib
> start scanning PHYs before this code is executed, then thing may
> break!!
Is it possible that PHY lib will start scanning for phys before the DSA
switch IC is probed with SPI?
KSZ9477-EVB DTS is not using "mdio" node - i.e. the "old" scheme for DSA
switch is used.
>
> ... it is broken as hell....
>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2023-08-30 13:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-30 9:21 [PATCH 1/2] net: phy: Rename KSZ9477 get features function (to ksz9131_get_features) Lukasz Majewski
2023-08-30 9:21 ` [PATCH 2/2] net: phy: Provide Module 4 KSZ9477 errata (DS80000754C) Lukasz Majewski
2023-08-30 9:48 ` Michal Swiatkowski
2023-08-30 10:37 ` Lukasz Majewski
2023-08-30 10:18 ` Oleksij Rempel
2023-08-30 10:52 ` Lukasz Majewski
2023-08-30 10:59 ` Oleksij Rempel
2023-08-30 11:51 ` Lukasz Majewski
2023-08-30 12:17 ` Oleksij Rempel
2023-08-30 12:35 ` Russell King (Oracle)
2023-08-30 13:06 ` Oleksij Rempel
2023-08-30 13:30 ` Russell King (Oracle)
2023-08-30 14:26 ` Oleksij Rempel
2023-08-30 14:38 ` Russell King (Oracle)
2023-08-30 14:48 ` Oleksij Rempel
2023-08-30 16:38 ` Lukasz Majewski
2023-08-31 4:40 ` Oleksij Rempel
2023-08-31 7:13 ` Russell King (Oracle)
2023-08-30 13:23 ` Lukasz Majewski [this message]
2023-08-30 11:20 ` Russell King (Oracle)
2023-08-30 11:08 ` Russell King (Oracle)
2023-08-30 11:20 ` Oleksij Rempel
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=20230830152354.57108943@wsk \
--to=lukma@denx.de \
--cc=Tristram.Ha@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=woojung.huh@microchip.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).