stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "net: phy: avoid genphy_aneg_done() for PHYs without clause 22 support" has been added to the 3.18-stable tree
@ 2018-04-10 12:33 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-04-10 12:33 UTC (permalink / raw)
  To: rmk+kernel, alexander.levin, andrew, davem, f.fainelli, gregkh
  Cc: stable, stable-commits


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

    net: phy: avoid genphy_aneg_done() for PHYs without clause 22 support

to the 3.18-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-avoid-genphy_aneg_done-for-phys-without-clause-22-support.patch
and it can be found in the queue-3.18 subdirectory.

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


>From foo@baz Tue Apr 10 13:58:07 CEST 2018
From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Mon, 5 Jun 2017 12:22:55 +0100
Subject: net: phy: avoid genphy_aneg_done() for PHYs without clause 22 support

From: Russell King <rmk+kernel@armlinux.org.uk>


[ Upstream commit 41408ad519f7a2a1c5229e61f2a97f4df1b61adc ]

Avoid calling genphy_aneg_done() for PHYs that do not implement the
Clause 22 register set.

Clause 45 PHYs may implement the Clause 22 register set along with the
Clause 22 extension MMD.  Hence, we can't simply block access to the
Clause 22 functions based on the PHY being a Clause 45 PHY.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/phy/phy.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -123,6 +123,12 @@ static inline int phy_aneg_done(struct p
 	if (phydev->drv->aneg_done)
 		return phydev->drv->aneg_done(phydev);
 
+	/* Avoid genphy_aneg_done() if the Clause 45 PHY does not
+	 * implement Clause 22 registers
+	 */
+	if (phydev->is_c45 && !(phydev->c45_ids.devices_in_package & BIT(0)))
+		return -EINVAL;
+
 	return genphy_aneg_done(phydev);
 }
 


Patches currently in stable-queue which might be from rmk+kernel@armlinux.org.uk are

queue-3.18/net-phy-avoid-genphy_aneg_done-for-phys-without-clause-22-support.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-10 12:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-10 12:33 Patch "net: phy: avoid genphy_aneg_done() for PHYs without clause 22 support" has been added to the 3.18-stable tree gregkh

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).