Reapply DSA fix for dpaa-eth with proper Fixes: tag
Subsystems (3)
v2 cover Reapply DSA fix for dpaa-eth with proper Fixes: tag
From: Vladimir Oltean <[email protected]>
Joakim notified me that this fix breaks stable trees. It turns out that my assessment about who-broke-who was wrong. The real Fixes: tag should have been:
which changes the device on which SET_NETDEV_DEV is made.
git describe --tags 060ad66f97954
v5.4-rc3-783-g060ad66f9795
Which means that it shouldn't have been backported to 4.19 and below. This series reverts the commit with the misleading commit message, and reapplies it with a corrected one. The resulting code is exactly the same, but now, the revert should make it to the stable trees (along with the bad fix), and the new fix should only make it down to v5.4.y.
Changes in v2:
Corrected the reversed sysfs paths in the new commit description.
Vladimir Oltean (2):
Revert "dpaa_eth: fix usage as DSA master, try 3"
dpaa_eth: fix usage as DSA master, try 4
Signature · 1 line
2.25.1
PATCH v2 1/2 Revert "dpaa_eth: fix usage as DSA master, try 3"
From: Vladimir Oltean <[email protected]>
This reverts commit 5d14c304bfc14b4fd052dc83d5224376b48f52f0.
The Fixes: tag was incorrect, and it was subsequently backported to the incorrect stable trees, breaking them.
---
Changes in v2:
None.
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +1 -1
@@ -2914,7 +2914,7 @@ static int dpaa_eth_probe(struct platform_device *pdev) }/* Do this here, so we can be verbose early */ -SET_NETDEV_DEV (net_dev, dev->parent); +SET_NETDEV_DEV (net_dev, dev);dev_set_drvdata (dev, net_dev); priv =netdev_priv (net_dev);
Signature · 1 line
2.25.1
PATCH v2 2/2 dpaa_eth: fix usage as DSA master, try 4
In reply to Vladimir OlteanFrom: Vladimir Oltean <[email protected]>
The dpaa-eth driver probes on compatible string for the MAC node, and the fman/mac.c driver allocates a dpaa-ethernet platform device that triggers the probing of the dpaa-eth net device driver.
All of this is fine, but the problem is that the struct device of the dpaa_eth net_device is 2 parents away from the MAC which can be referenced via of_node. So of_find_net_device_by_node can't find it, and DSA switches won't be able to probe on top of FMan ports.
It would be a bit silly to modify a core function (of_find_net_device_by_node) to look for dev->parent->parent->of_node just for one driver. We're just 1 step away from implementing full recursion.
On T1040, the /sys/class/net/eth0 symlink currently points to:
/sys/devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/dpaa-ethernet.0/net/eth0
which pretty much illustrates the problem. The closest of_node we've got is the "fsl,fman-memac" at /soc@ffe000000/fman@400000/ethernet@e6000, which is what we'd like to be able to reference from DSA as host port.
For of_find_net_device_by_node to find the eth0 port, we would need the parent of the eth0 net_device to not be the "dpaa-ethernet" platform device, but to point 1 level higher, aka the "fsl,fman-memac" node directly. The new sysfs path would look like this:
/sys/devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
Actually this has worked before, through the SET_NETDEV_DEV mechanism, which sets the parent of the net_device as the parent of the platform device. But the device which was set as sysfs parent was inadvertently changed through commit 060ad66f9795 ("dpaa_eth: change DMA device"), which did not take into consideration the effect it would have upon of_find_net_device_by_node. So restore the old sysfs parent to make that work correctly.
---
Changes in v2:
Corrected the reversed sysfs paths in the commit description (thanks Jocke!)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +1 -1
@@ -2914,7 +2914,7 @@ static int dpaa_eth_probe(struct platform_device *pdev) }/* Do this here, so we can be verbose early */ -SET_NETDEV_DEV (net_dev, dev); +SET_NETDEV_DEV (net_dev, dev->parent);dev_set_drvdata (dev, net_dev); priv =netdev_priv (net_dev);
Signature · 1 line
2.25.1
David Miller
maintainerFrom: Vladimir Oltean <[email protected]>
Date: Tue, 16 Jun 2020 18:19:08 +0300
Quoted 13 lines
From: Vladimir Oltean <[email protected]>
Joakim notified me that this fix breaks stable trees. It turns out that my assessment about who-broke-who was wrong. The real Fixes: tag should have been:
Fixes 060ad66f9795 ("dpaa_eth: change DMA device")which changes the device on which
SET_NETDEV_DEVis made.git describe --tags
060ad66f97954
v5.4-rc3-783-g060ad66f9795
Quoted 8 lines
Which means that it shouldn't have been backported to 4.19 and below. This series reverts the commit with the misleading commit message, and reapplies it with a corrected one. The resulting code is exactly the same, but now, the revert should make it to the stable trees (along with the bad fix), and the new fix should only make it down to v5.4.y.
Changes in v2:
Corrected the reversed sysfs paths in the new commit description.
This is so messy.
What's done is done, just submit the necessary revert to -stable if necessary and let's not just change things back and forth because then we'll have two commits which make identical changes and each having a different Fixes: tag which is confusing.
Thanks.