linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] Reapply DSA fix for dpaa-eth with proper Fixes: tag
@ 2020-06-16 14:41 Vladimir Oltean
  2020-06-16 14:41 ` [PATCH net 1/2] Revert "dpaa_eth: fix usage as DSA master, try 3" Vladimir Oltean
  2020-06-16 14:41 ` [PATCH net 2/2] dpaa_eth: fix usage as DSA master, try 4 Vladimir Oltean
  0 siblings, 2 replies; 9+ messages in thread
From: Vladimir Oltean @ 2020-06-16 14:41 UTC (permalink / raw)
  To: davem
  Cc: netdev, andrew, vivien.didelot, f.fainelli, joakim.tjernlund,
	madalin.bucur, fido_max, linux-kernel

From: Vladimir Oltean <vladimir.oltean@nxp.com>

Joakim notified me that this 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_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.

Vladimir Oltean (2):
  Revert "dpaa_eth: fix usage as DSA master, try 3"
  dpaa_eth: fix usage as DSA master, try 4


-- 
2.25.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH net 1/2] Revert "dpaa_eth: fix usage as DSA master, try 3"
  2020-06-16 14:41 [PATCH net 0/2] Reapply DSA fix for dpaa-eth with proper Fixes: tag Vladimir Oltean
@ 2020-06-16 14:41 ` Vladimir Oltean
  2020-06-16 14:41 ` [PATCH net 2/2] dpaa_eth: fix usage as DSA master, try 4 Vladimir Oltean
  1 sibling, 0 replies; 9+ messages in thread
From: Vladimir Oltean @ 2020-06-16 14:41 UTC (permalink / raw)
  To: davem
  Cc: netdev, andrew, vivien.didelot, f.fainelli, joakim.tjernlund,
	madalin.bucur, fido_max, linux-kernel

From: Vladimir Oltean <vladimir.oltean@nxp.com>

This reverts commit 5d14c304bfc14b4fd052dc83d5224376b48f52f0.

The Fixes: tag was incorrect, and it was subsequently backported to the
incorrect stable trees, breaking them.

Reported-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 2972244e6eb0..c4416a5f8816 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net 2/2] dpaa_eth: fix usage as DSA master, try 4
  2020-06-16 14:41 [PATCH net 0/2] Reapply DSA fix for dpaa-eth with proper Fixes: tag Vladimir Oltean
  2020-06-16 14:41 ` [PATCH net 1/2] Revert "dpaa_eth: fix usage as DSA master, try 3" Vladimir Oltean
@ 2020-06-16 14:41 ` Vladimir Oltean
  2020-06-16 14:51   ` Joakim Tjernlund
  1 sibling, 1 reply; 9+ messages in thread
From: Vladimir Oltean @ 2020-06-16 14:41 UTC (permalink / raw)
  To: davem
  Cc: netdev, andrew, vivien.didelot, f.fainelli, joakim.tjernlund,
	madalin.bucur, fido_max, linux-kernel

From: Vladimir Oltean <vladimir.oltean@nxp.com>

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:

../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/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:

../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/dpaa-ethernet.0/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.

Fixes: 060ad66f9795 ("dpaa_eth: change DMA device")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index c4416a5f8816..2972244e6eb0 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH net 2/2] dpaa_eth: fix usage as DSA master, try 4
  2020-06-16 14:41 ` [PATCH net 2/2] dpaa_eth: fix usage as DSA master, try 4 Vladimir Oltean
@ 2020-06-16 14:51   ` Joakim Tjernlund
  2020-06-16 14:56     ` Vladimir Oltean
  0 siblings, 1 reply; 9+ messages in thread
From: Joakim Tjernlund @ 2020-06-16 14:51 UTC (permalink / raw)
  To: olteanv, davem
  Cc: vivien.didelot, madalin.bucur, fido_max, netdev, f.fainelli,
	andrew, linux-kernel

On Tue, 2020-06-16 at 17:41 +0300, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> 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:
> 
> ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0

Just want to point out that on 4.19.x, the above patch still exists:
cd /sys
find -name eth0
./devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
./class/net/eth

> 
> 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:
> 
> ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/dpaa-ethernet.0/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.
> 
> Fixes: 060ad66f9795 ("dpaa_eth: change DMA device")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
>  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index c4416a5f8816..2972244e6eb0 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -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);
> --
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net 2/2] dpaa_eth: fix usage as DSA master, try 4
  2020-06-16 14:51   ` Joakim Tjernlund
@ 2020-06-16 14:56     ` Vladimir Oltean
  2020-06-16 15:04       ` Joakim Tjernlund
  0 siblings, 1 reply; 9+ messages in thread
From: Vladimir Oltean @ 2020-06-16 14:56 UTC (permalink / raw)
  To: Joakim Tjernlund
  Cc: davem, vivien.didelot, madalin.bucur, fido_max, netdev,
	f.fainelli, andrew, linux-kernel

Hi Joakim,

On Tue, 16 Jun 2020 at 17:51, Joakim Tjernlund
<Joakim.Tjernlund@infinera.com> wrote:
>
> On Tue, 2020-06-16 at 17:41 +0300, Vladimir Oltean wrote:
> > From: Vladimir Oltean <vladimir.oltean@nxp.com>
> >
> > 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:
> >
> > ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
>
> Just want to point out that on 4.19.x, the above patch still exists:
> cd /sys
> find -name eth0
> ./devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> ./class/net/eth
>

By 'current' I mean 'the net tree just before this patch is applied',
i.e. a v5.7 tree with "dpaa_eth: fix usage as DSA master, try 3"
reverted.

> >
> > 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:
> >
> > ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/dpaa-ethernet.0/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.
> >
> > Fixes: 060ad66f9795 ("dpaa_eth: change DMA device")
> > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> > ---
> >  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > index c4416a5f8816..2972244e6eb0 100644
> > --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > @@ -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);
> > --
> > 2.25.1
> >
>

Thanks,
-Vladimir

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net 2/2] dpaa_eth: fix usage as DSA master, try 4
  2020-06-16 14:56     ` Vladimir Oltean
@ 2020-06-16 15:04       ` Joakim Tjernlund
  2020-06-16 15:08         ` Vladimir Oltean
  0 siblings, 1 reply; 9+ messages in thread
From: Joakim Tjernlund @ 2020-06-16 15:04 UTC (permalink / raw)
  To: olteanv
  Cc: andrew, davem, fido_max, vivien.didelot, linux-kernel,
	f.fainelli, madalin.bucur, netdev

On Tue, 2020-06-16 at 17:56 +0300, Vladimir Oltean wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> Hi Joakim,
> 
> On Tue, 16 Jun 2020 at 17:51, Joakim Tjernlund
> <Joakim.Tjernlund@infinera.com> wrote:
> > On Tue, 2020-06-16 at 17:41 +0300, Vladimir Oltean wrote:
> > > From: Vladimir Oltean <vladimir.oltean@nxp.com>
> > > 
> > > 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:
> > > 
> > > ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> > 
> > Just want to point out that on 4.19.x, the above patch still exists:
> > cd /sys
> > find -name eth0
> > ./devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> > ./class/net/eth
> > 
> 
> By 'current' I mean 'the net tree just before this patch is applied',
> i.e. a v5.7 tree with "dpaa_eth: fix usage as DSA master, try 3"
> reverted.

Confused, with patch reverted(and DSA working) in 4.19, I have 
  ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
Is that the wanted path? Because I figured you wanted to change it to the path further down in this email?

 Jocke
> 
> > > 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:
> > > 
> > > ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/dpaa-ethernet.0/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.
> > > 
> > > Fixes: 060ad66f9795 ("dpaa_eth: change DMA device")
> > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> > > ---
> > >  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > > index c4416a5f8816..2972244e6eb0 100644
> > > --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > > +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > > @@ -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);
> > > --
> > > 2.25.1
> > > 
> 
> Thanks,
> -Vladimir


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net 2/2] dpaa_eth: fix usage as DSA master, try 4
  2020-06-16 15:04       ` Joakim Tjernlund
@ 2020-06-16 15:08         ` Vladimir Oltean
  2020-06-16 15:12           ` Vladimir Oltean
  0 siblings, 1 reply; 9+ messages in thread
From: Vladimir Oltean @ 2020-06-16 15:08 UTC (permalink / raw)
  To: Joakim Tjernlund
  Cc: andrew, davem, fido_max, vivien.didelot, linux-kernel,
	f.fainelli, madalin.bucur, netdev

On Tue, 16 Jun 2020 at 18:04, Joakim Tjernlund
<Joakim.Tjernlund@infinera.com> wrote:
>
> On Tue, 2020-06-16 at 17:56 +0300, Vladimir Oltean wrote:
> > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> >
> >
> > Hi Joakim,
> >
> > On Tue, 16 Jun 2020 at 17:51, Joakim Tjernlund
> > <Joakim.Tjernlund@infinera.com> wrote:
> > > On Tue, 2020-06-16 at 17:41 +0300, Vladimir Oltean wrote:
> > > > From: Vladimir Oltean <vladimir.oltean@nxp.com>
> > > >
> > > > 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:
> > > >
> > > > ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> > >
> > > Just want to point out that on 4.19.x, the above patch still exists:
> > > cd /sys
> > > find -name eth0
> > > ./devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> > > ./class/net/eth
> > >
> >
> > By 'current' I mean 'the net tree just before this patch is applied',
> > i.e. a v5.7 tree with "dpaa_eth: fix usage as DSA master, try 3"
> > reverted.
>
> Confused, with patch reverted(and DSA working) in 4.19, I have
>   ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> Is that the wanted path? Because I figured you wanted to change it to the path further down in this email?
>
>  Jocke
> >

Yes, this is the wanted path.
The path is fine for anything below commit 060ad66f9795 ("dpaa_eth:
change DMA device"), including your v4.19.y, that's the point. By
specifying that commit in the Fixes: tag, people who deal with
backporting to stable trees know to not backport it below that commit.
So your stable tree will only get the revert patch.

-Vladimir

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net 2/2] dpaa_eth: fix usage as DSA master, try 4
  2020-06-16 15:08         ` Vladimir Oltean
@ 2020-06-16 15:12           ` Vladimir Oltean
  2020-06-16 15:15             ` Joakim Tjernlund
  0 siblings, 1 reply; 9+ messages in thread
From: Vladimir Oltean @ 2020-06-16 15:12 UTC (permalink / raw)
  To: Joakim Tjernlund
  Cc: andrew, davem, fido_max, vivien.didelot, linux-kernel,
	f.fainelli, madalin.bucur, netdev

On Tue, 16 Jun 2020 at 18:08, Vladimir Oltean <olteanv@gmail.com> wrote:
>
> On Tue, 16 Jun 2020 at 18:04, Joakim Tjernlund
> <Joakim.Tjernlund@infinera.com> wrote:
> >
> > On Tue, 2020-06-16 at 17:56 +0300, Vladimir Oltean wrote:
> > > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> > >
> > >
> > > Hi Joakim,
> > >
> > > On Tue, 16 Jun 2020 at 17:51, Joakim Tjernlund
> > > <Joakim.Tjernlund@infinera.com> wrote:
> > > > On Tue, 2020-06-16 at 17:41 +0300, Vladimir Oltean wrote:
> > > > > From: Vladimir Oltean <vladimir.oltean@nxp.com>
> > > > >
> > > > > 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:
> > > > >
> > > > > ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> > > >
> > > > Just want to point out that on 4.19.x, the above patch still exists:
> > > > cd /sys
> > > > find -name eth0
> > > > ./devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> > > > ./class/net/eth
> > > >
> > >
> > > By 'current' I mean 'the net tree just before this patch is applied',
> > > i.e. a v5.7 tree with "dpaa_eth: fix usage as DSA master, try 3"
> > > reverted.
> >
> > Confused, with patch reverted(and DSA working) in 4.19, I have
> >   ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> > Is that the wanted path? Because I figured you wanted to change it to the path further down in this email?
> >
> >  Jocke
> > >
>
> Yes, this is the wanted path.
> The path is fine for anything below commit 060ad66f9795 ("dpaa_eth:
> change DMA device"), including your v4.19.y, that's the point. By
> specifying that commit in the Fixes: tag, people who deal with
> backporting to stable trees know to not backport it below that commit.
> So your stable tree will only get the revert patch.
>
> -Vladimir

Oh, sorry, now I see what you were saying. The paths are reversed in
the commit description. It should be:

Good:

../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0

Bad:

../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/dpaa-ethernet.0/net/eth0

So I need to spin another version.

Sorry for the confusion.

-Vladimir

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net 2/2] dpaa_eth: fix usage as DSA master, try 4
  2020-06-16 15:12           ` Vladimir Oltean
@ 2020-06-16 15:15             ` Joakim Tjernlund
  0 siblings, 0 replies; 9+ messages in thread
From: Joakim Tjernlund @ 2020-06-16 15:15 UTC (permalink / raw)
  To: olteanv
  Cc: andrew, davem, fido_max, vivien.didelot, linux-kernel, netdev,
	madalin.bucur, f.fainelli

On Tue, 2020-06-16 at 18:12 +0300, Vladimir Oltean wrote:
> On Tue, 16 Jun 2020 at 18:08, Vladimir Oltean <olteanv@gmail.com> wrote:
> > On Tue, 16 Jun 2020 at 18:04, Joakim Tjernlund
> > <Joakim.Tjernlund@infinera.com> wrote:
> > > On Tue, 2020-06-16 at 17:56 +0300, Vladimir Oltean wrote:
> > > > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> > > > 
> > > > 
> > > > Hi Joakim,
> > > > 
> > > > On Tue, 16 Jun 2020 at 17:51, Joakim Tjernlund
> > > > <Joakim.Tjernlund@infinera.com> wrote:
> > > > > On Tue, 2020-06-16 at 17:41 +0300, Vladimir Oltean wrote:
> > > > > > From: Vladimir Oltean <vladimir.oltean@nxp.com>
> > > > > > 
> > > > > > 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:
> > > > > > 
> > > > > > ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> > > > > 
> > > > > Just want to point out that on 4.19.x, the above patch still exists:
> > > > > cd /sys
> > > > > find -name eth0
> > > > > ./devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> > > > > ./class/net/eth
> > > > > 
> > > > 
> > > > By 'current' I mean 'the net tree just before this patch is applied',
> > > > i.e. a v5.7 tree with "dpaa_eth: fix usage as DSA master, try 3"
> > > > reverted.
> > > 
> > > Confused, with patch reverted(and DSA working) in 4.19, I have
> > >   ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> > > Is that the wanted path? Because I figured you wanted to change it to the path further down in this email?
> > > 
> > >  Jocke
> > 
> > Yes, this is the wanted path.
> > The path is fine for anything below commit 060ad66f9795 ("dpaa_eth:
> > change DMA device"), including your v4.19.y, that's the point. By
> > specifying that commit in the Fixes: tag, people who deal with
> > backporting to stable trees know to not backport it below that commit.
> > So your stable tree will only get the revert patch.
> > 
> > -Vladimir
> 
> Oh, sorry, now I see what you were saying. The paths are reversed in
> the commit description. It should be:
> 
> Good:
> 
> ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/net/eth0
> 
> Bad:
> 
> ../../devices/platform/ffe000000.soc/ffe400000.fman/ffe4e6000.ethernet/dpaa-ethernet.0/net/eth0
> 
> So I need to spin another version.

Thank you, I was doubting my(non native) understanding of English :)

 Jocke

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-16 15:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 14:41 [PATCH net 0/2] Reapply DSA fix for dpaa-eth with proper Fixes: tag Vladimir Oltean
2020-06-16 14:41 ` [PATCH net 1/2] Revert "dpaa_eth: fix usage as DSA master, try 3" Vladimir Oltean
2020-06-16 14:41 ` [PATCH net 2/2] dpaa_eth: fix usage as DSA master, try 4 Vladimir Oltean
2020-06-16 14:51   ` Joakim Tjernlund
2020-06-16 14:56     ` Vladimir Oltean
2020-06-16 15:04       ` Joakim Tjernlund
2020-06-16 15:08         ` Vladimir Oltean
2020-06-16 15:12           ` Vladimir Oltean
2020-06-16 15:15             ` Joakim Tjernlund

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