Patch "net: phy: lan87xx: fix access to wrong register of LAN87xx" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: phy: lan87xx: fix access to wrong register of LAN87xx

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-phy-lan87xx-fix-access-to-wrong-register-of-lan8.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f1b3cde15e0bd7628ca9fa8fc92d8f5930883843
Author: Andre Edich <andre.edich@xxxxxxxxxxxxx>
Date:   Mon Mar 29 11:45:36 2021 +0200

    net: phy: lan87xx: fix access to wrong register of LAN87xx
    
    [ Upstream commit fdb5cc6ab3b6a1c0122d3644a63ef9dc7a610d35 ]
    
    The function lan87xx_config_aneg_ext was introduced to configure
    LAN95xxA but as well writes to undocumented register of LAN87xx.
    This fix prevents that access.
    
    The function lan87xx_config_aneg_ext gets more suitable for the new
    behavior name.
    
    Reported-by: Måns Rullgård <mans@xxxxxxxxx>
    Fixes: 05b35e7eb9a1 ("smsc95xx: add phylib support")
    Signed-off-by: Andre Edich <andre.edich@xxxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index 10722fed666d..caf7291ffaf8 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -152,10 +152,13 @@ static int lan87xx_config_aneg(struct phy_device *phydev)
 	return genphy_config_aneg(phydev);
 }
 
-static int lan87xx_config_aneg_ext(struct phy_device *phydev)
+static int lan95xx_config_aneg_ext(struct phy_device *phydev)
 {
 	int rc;
 
+	if (phydev->phy_id != 0x0007c0f0) /* not (LAN9500A or LAN9505A) */
+		return lan87xx_config_aneg(phydev);
+
 	/* Extend Manual AutoMDIX timer */
 	rc = phy_read(phydev, PHY_EDPD_CONFIG);
 	if (rc < 0)
@@ -408,7 +411,7 @@ static struct phy_driver smsc_phy_driver[] = {
 	.read_status	= lan87xx_read_status,
 	.config_init	= smsc_phy_config_init,
 	.soft_reset	= smsc_phy_reset,
-	.config_aneg	= lan87xx_config_aneg_ext,
+	.config_aneg	= lan95xx_config_aneg_ext,
 
 	/* IRQ related */
 	.ack_interrupt	= smsc_phy_ack_interrupt,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux