[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1571833940-26250-1-git-send-email-ioana.ciornei@nxp.com>
Date: Wed, 23 Oct 2019 15:32:20 +0300
From: Ioana Ciornei <ioana.ciornei@....com>
To: davem@...emloft.net, netdev@...r.kernel.org
Cc: andrew@...n.ch, linux@...linux.org.uk,
Ioana Ciornei <ioana.ciornei@....com>
Subject: [PATCH net-next] phylink: add ASSERT_RTNL() on phylink connect functions
The appropriate assert on the rtnl lock is not present in phylink's
connect functions which makes unusual calls to them not to be catched.
Add the appropriate ASSERT_RTNL().
Signed-off-by: Ioana Ciornei <ioana.ciornei@....com>
---
drivers/net/phy/phylink.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index be7a2c0fa59b..d0aa0c861b2d 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -786,6 +786,8 @@ static int __phylink_connect_phy(struct phylink *pl, struct phy_device *phy,
*/
int phylink_connect_phy(struct phylink *pl, struct phy_device *phy)
{
+ ASSERT_RTNL();
+
/* Use PHY device/driver interface */
if (pl->link_interface == PHY_INTERFACE_MODE_NA) {
pl->link_interface = phy->interface;
@@ -815,6 +817,8 @@ int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn,
struct phy_device *phy_dev;
int ret;
+ ASSERT_RTNL();
+
/* Fixed links and 802.3z are handled without needing a PHY */
if (pl->link_an_mode == MLO_AN_FIXED ||
(pl->link_an_mode == MLO_AN_INBAND &&
--
1.9.1
Powered by blists - more mailing lists