diff mbox series

[net,v4,2/5] net: phy: micrel: disable suspend/resume callbacks following errata

Message ID 20240531142430.678198-3-enguerrand.de-ribaucourt@savoirfairelinux.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Add Microchip KSZ 9897 Switch CPU PHY + Errata | expand

Checks

Context Check Description
netdev/series_format warning Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 902 this patch: 902
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 2 blamed authors not CCed: f.fainelli@gmail.com Woojung.Huh@microchip.com; 5 maintainers not CCed: pabeni@redhat.com Woojung.Huh@microchip.com kuba@kernel.org edumazet@google.com f.fainelli@gmail.com
netdev/build_clang success Errors and warnings before: 906 this patch: 906
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 906 this patch: 906
netdev/checkpatch warning WARNING: line length of 84 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Enguerrand de Ribaucourt May 31, 2024, 2:24 p.m. UTC
Microchip's erratas state that powering down a PHY may cause errors
on the adjacent PHYs due to the power supply noise. The suggested
workaround is to avoid toggling the powerdown bit dynamically while
traffic may be present.

Fixes: fc3973a1fa09 ("phy: micrel: add Microchip KSZ 9477 Switch PHY support")
Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
---
v4:
 - rebase on net/main
 - add Fixes tag
v3: https://lore.kernel.org/all/20240530102436.226189-3-enguerrand.de-ribaucourt@savoirfairelinux.com/
---
 drivers/net/phy/micrel.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Tristram.Ha@microchip.com May 31, 2024, 7:22 p.m. UTC | #1
> -----Original Message-----
> From: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
> Sent: Friday, May 31, 2024 7:24 AM
> To: netdev@vger.kernel.org
> Cc: andrew@lunn.ch; hkallweit1@gmail.com; linux@armlinux.org.uk; Woojung Huh -
> C21699 <Woojung.Huh@microchip.com>; UNGLinuxDriver
> <UNGLinuxDriver@microchip.com>; Enguerrand de Ribaucourt <enguerrand.de-
> ribaucourt@savoirfairelinux.com>
> Subject: [PATCH net v4 2/5] net: phy: micrel: disable suspend/resume callbacks
> following errata
> 
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content
> is safe
> 
> Microchip's erratas state that powering down a PHY may cause errors
> on the adjacent PHYs due to the power supply noise. The suggested
> workaround is to avoid toggling the powerdown bit dynamically while
> traffic may be present.
> 
> Fixes: fc3973a1fa09 ("phy: micrel: add Microchip KSZ 9477 Switch PHY support")
> Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-
> ribaucourt@savoirfairelinux.com>
> ---
> v4:
>  - rebase on net/main
>  - add Fixes tag
> v3: https://lore.kernel.org/all/20240530102436.226189-3-enguerrand.de-
> ribaucourt@savoirfairelinux.com/
> ---
>  drivers/net/phy/micrel.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 8a6dfaceeab3..2608d6cc7257 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -5492,8 +5492,9 @@ static struct phy_driver ksphy_driver[] = {
>         .config_init    = ksz9477_config_init,
>         .config_intr    = kszphy_config_intr,
>         .handle_interrupt = kszphy_handle_interrupt,
> -       .suspend        = genphy_suspend,
> -       .resume         = genphy_resume,
> +       /* No suspend/resume callbacks because of errata DS80000758:
> +        * Toggling PHY Powerdown can cause errors or link failures in adjacent PHYs
> +        */
>         .get_features   = ksz9477_get_features,
>  }, {
>         .phy_id         = PHY_ID_KSZ9897,

KSZ9893 uses the same PHY driver as KSZ9477.  KSZ9893 belongs to KSZ9893
family while KSZ9477 belongs to KSZ9897 family.  They share most
registers but KSZ9893 does not require PHY setup for link compatibility
and does not have this PHY power up link lost issue, so it is not
appropriate to completely disable PHY power down.

PHY power down is executed when the network device is turned off.  The
PHY is powered up when the network device is turned on.  This sometimes
can cause other ports in KSZ9897 switch to lose link temporarily.  The
link will come back.

In my opinion this problem does not impact much as the network devices
are not likely to be turned off/on many times and likely to be turned
off once during system initialization.
diff mbox series

Patch

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 8a6dfaceeab3..2608d6cc7257 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -5492,8 +5492,9 @@  static struct phy_driver ksphy_driver[] = {
 	.config_init	= ksz9477_config_init,
 	.config_intr	= kszphy_config_intr,
 	.handle_interrupt = kszphy_handle_interrupt,
-	.suspend	= genphy_suspend,
-	.resume		= genphy_resume,
+	/* No suspend/resume callbacks because of errata DS80000758:
+	 * Toggling PHY Powerdown can cause errors or link failures in adjacent PHYs
+	 */
 	.get_features	= ksz9477_get_features,
 }, {
 	.phy_id		= PHY_ID_KSZ9897,