Skip to content

Commit 5c16727

Browse files
committed
net: revert partially applied PHY topology series
The series is causing issues with PHY drivers built as modules. Since it was only partially applied and the merge window has opened let's revert and try again for v6.11. Revert 6916e46 ("net: phy: Introduce ethernet link topology representation") Revert 0ec5ed6 ("net: sfp: pass the phy_device when disconnecting an sfp module's PHY") Revert e75e4e0 ("net: phy: add helpers to handle sfp phy connect/disconnect") Revert fdd3539 ("net: sfp: Add helper to return the SFP bus name") Revert 841942b ("net: ethtool: Allow passing a phy index for some commands") Link: https://lore.kernel.org/all/171242462917.4000.9759453824684907063.git-patchwork-notify@kernel.org/ Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b08191d commit 5c16727

File tree

22 files changed

+8
-385
lines changed

22 files changed

+8
-385
lines changed

Documentation/networking/ethtool-netlink.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ Structure of this header is
5757
``ETHTOOL_A_HEADER_DEV_INDEX`` u32 device ifindex
5858
``ETHTOOL_A_HEADER_DEV_NAME`` string device name
5959
``ETHTOOL_A_HEADER_FLAGS`` u32 flags common for all requests
60-
``ETHTOOL_A_HEADER_PHY_INDEX`` u32 phy device index
6160
============================== ====== =============================
6261

6362
``ETHTOOL_A_HEADER_DEV_INDEX`` and ``ETHTOOL_A_HEADER_DEV_NAME`` identify the
@@ -82,12 +81,6 @@ the behaviour is backward compatible, i.e. requests from old clients not aware
8281
of the flag should be interpreted the way the client expects. A client must
8382
not set flags it does not understand.
8483

85-
``ETHTOOL_A_HEADER_PHY_INDEX`` identifies the Ethernet PHY the message relates to.
86-
As there are numerous commands that are related to PHY configuration, and because
87-
there may be more than one PHY on the link, the PHY index can be passed in the
88-
request for the commands that needs it. It is, however, not mandatory, and if it
89-
is not passed for commands that target a PHY, the net_device.phydev pointer
90-
is used.
9184

9285
Bit sets
9386
========

MAINTAINERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8027,8 +8027,6 @@ F: include/linux/mii.h
80278027
F: include/linux/of_net.h
80288028
F: include/linux/phy.h
80298029
F: include/linux/phy_fixed.h
8030-
F: include/linux/phy_link_topology.h
8031-
F: include/linux/phy_link_topology_core.h
80328030
F: include/linux/phylib_stubs.h
80338031
F: include/linux/platform_data/mdio-bcm-unimac.h
80348032
F: include/linux/platform_data/mdio-gpio.h

drivers/net/phy/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Makefile for Linux PHY drivers
33

44
libphy-y := phy.o phy-c45.o phy-core.o phy_device.o \
5-
linkmode.o phy_link_topology.o
5+
linkmode.o
66
mdio-bus-y += mdio_bus.o mdio_device.o
77

88
ifdef CONFIG_MDIO_DEVICE

drivers/net/phy/marvell-88x2222.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,6 @@ static const struct sfp_upstream_ops sfp_phy_ops = {
553553
.link_down = mv2222_sfp_link_down,
554554
.attach = phy_sfp_attach,
555555
.detach = phy_sfp_detach,
556-
.connect_phy = phy_sfp_connect_phy,
557-
.disconnect_phy = phy_sfp_disconnect_phy,
558556
};
559557

560558
static int mv2222_probe(struct phy_device *phydev)

drivers/net/phy/marvell.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3613,8 +3613,6 @@ static const struct sfp_upstream_ops m88e1510_sfp_ops = {
36133613
.module_remove = m88e1510_sfp_remove,
36143614
.attach = phy_sfp_attach,
36153615
.detach = phy_sfp_detach,
3616-
.connect_phy = phy_sfp_connect_phy,
3617-
.disconnect_phy = phy_sfp_disconnect_phy,
36183616
};
36193617

36203618
static int m88e1510_probe(struct phy_device *phydev)

drivers/net/phy/marvell10g.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,6 @@ static int mv3310_sfp_insert(void *upstream, const struct sfp_eeprom_id *id)
503503
static const struct sfp_upstream_ops mv3310_sfp_ops = {
504504
.attach = phy_sfp_attach,
505505
.detach = phy_sfp_detach,
506-
.connect_phy = phy_sfp_connect_phy,
507-
.disconnect_phy = phy_sfp_disconnect_phy,
508506
.module_insert = mv3310_sfp_insert,
509507
};
510508

drivers/net/phy/phy_device.c

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <linux/phy.h>
3030
#include <linux/phylib_stubs.h>
3131
#include <linux/phy_led_triggers.h>
32-
#include <linux/phy_link_topology.h>
3332
#include <linux/pse-pd/pse.h>
3433
#include <linux/property.h>
3534
#include <linux/rtnetlink.h>
@@ -277,14 +276,6 @@ static void phy_mdio_device_remove(struct mdio_device *mdiodev)
277276

278277
static struct phy_driver genphy_driver;
279278

280-
static struct phy_link_topology *phy_get_link_topology(struct phy_device *phydev)
281-
{
282-
if (phydev->attached_dev)
283-
return phydev->attached_dev->link_topo;
284-
285-
return NULL;
286-
}
287-
288279
static LIST_HEAD(phy_fixup_list);
289280
static DEFINE_MUTEX(phy_fixup_lock);
290281

@@ -1378,46 +1369,6 @@ phy_standalone_show(struct device *dev, struct device_attribute *attr,
13781369
}
13791370
static DEVICE_ATTR_RO(phy_standalone);
13801371

1381-
/**
1382-
* phy_sfp_connect_phy - Connect the SFP module's PHY to the upstream PHY
1383-
* @upstream: pointer to the upstream phy device
1384-
* @phy: pointer to the SFP module's phy device
1385-
*
1386-
* This helper allows keeping track of PHY devices on the link. It adds the
1387-
* SFP module's phy to the phy namespace of the upstream phy
1388-
*/
1389-
int phy_sfp_connect_phy(void *upstream, struct phy_device *phy)
1390-
{
1391-
struct phy_device *phydev = upstream;
1392-
struct phy_link_topology *topo = phy_get_link_topology(phydev);
1393-
1394-
if (topo)
1395-
return phy_link_topo_add_phy(topo, phy, PHY_UPSTREAM_PHY, phydev);
1396-
1397-
return 0;
1398-
}
1399-
EXPORT_SYMBOL(phy_sfp_connect_phy);
1400-
1401-
/**
1402-
* phy_sfp_disconnect_phy - Disconnect the SFP module's PHY from the upstream PHY
1403-
* @upstream: pointer to the upstream phy device
1404-
* @phy: pointer to the SFP module's phy device
1405-
*
1406-
* This helper allows keeping track of PHY devices on the link. It removes the
1407-
* SFP module's phy to the phy namespace of the upstream phy. As the module phy
1408-
* will be destroyed, re-inserting the same module will add a new phy with a
1409-
* new index.
1410-
*/
1411-
void phy_sfp_disconnect_phy(void *upstream, struct phy_device *phy)
1412-
{
1413-
struct phy_device *phydev = upstream;
1414-
struct phy_link_topology *topo = phy_get_link_topology(phydev);
1415-
1416-
if (topo)
1417-
phy_link_topo_del_phy(topo, phy);
1418-
}
1419-
EXPORT_SYMBOL(phy_sfp_disconnect_phy);
1420-
14211372
/**
14221373
* phy_sfp_attach - attach the SFP bus to the PHY upstream network device
14231374
* @upstream: pointer to the phy device
@@ -1560,11 +1511,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
15601511

15611512
if (phydev->sfp_bus_attached)
15621513
dev->sfp_bus = phydev->sfp_bus;
1563-
1564-
err = phy_link_topo_add_phy(dev->link_topo, phydev,
1565-
PHY_UPSTREAM_MAC, dev);
1566-
if (err)
1567-
goto error;
15681514
}
15691515

15701516
/* Some Ethernet drivers try to connect to a PHY device before
@@ -1992,7 +1938,6 @@ void phy_detach(struct phy_device *phydev)
19921938
if (dev) {
19931939
phydev->attached_dev->phydev = NULL;
19941940
phydev->attached_dev = NULL;
1995-
phy_link_topo_del_phy(dev->link_topo, phydev);
19961941
}
19971942
phydev->phylink = NULL;
19981943

drivers/net/phy/phy_link_topology.c

Lines changed: 0 additions & 105 deletions
This file was deleted.

drivers/net/phy/phylink.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3411,8 +3411,7 @@ static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy)
34113411
return ret;
34123412
}
34133413

3414-
static void phylink_sfp_disconnect_phy(void *upstream,
3415-
struct phy_device *phydev)
3414+
static void phylink_sfp_disconnect_phy(void *upstream)
34163415
{
34173416
phylink_disconnect_phy(upstream);
34183417
}

drivers/net/phy/qcom/at803x.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,8 +770,6 @@ static const struct sfp_upstream_ops at8031_sfp_ops = {
770770
.attach = phy_sfp_attach,
771771
.detach = phy_sfp_detach,
772772
.module_insert = at8031_sfp_insert,
773-
.connect_phy = phy_sfp_connect_phy,
774-
.disconnect_phy = phy_sfp_disconnect_phy,
775773
};
776774

777775
static int at8031_parse_dt(struct phy_device *phydev)

0 commit comments

Comments
 (0)