The commit 898b2970e2c9 ("mvneta: implement SGMII-based in-band link state
signaling") implemented the link parameters auto-negotiation unconditionally.
Unfortunately it appears that some HW that implements SGMII protocol,
doesn't generate the inband status, so it is not possible to auto-negotiate
anything with such HW.
This patch enables the auto-negotiation only if the 'link' DT property
is set to "auto".
For old configurations where the 'link' property is not specified, the
default is to not use auto-negotiation.
This patch fixes the following regression:
https://lkml.org/lkml/2015/7/8/865
and is therefore CCed to stable.
Signed-off-by: Stas Sergeev <redacted>
CC: Thomas Petazzoni <redacted>
CC: netdev@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: stable@vger.kernel.org
---
drivers/net/ethernet/marvell/mvneta.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
@@ -3009,7 +3009,7 @@ static int mvneta_probe(struct platform_device *pdev)charhw_mac_addr[ETH_ALEN];constchar*mac_from;intphy_mode;-intfixed_phy=0;+intautoneg_link=0;interr;/* Our multiqueue support is not complete, so for now, only
@@ -3043,7 +3043,7 @@ static int mvneta_probe(struct platform_device *pdev)dev_err(&pdev->dev,"cannot register fixed PHY\n");gotoerr_free_irq;}-fixed_phy=1;+autoneg_link=of_phy_is_autoneg_link(dn);/* In the case of a fixed PHY, the DT node associated*tothePHYistheEthernetMACDTnode.
@@ -3068,7 +3068,7 @@ static int mvneta_probe(struct platform_device *pdev)pp->phy_node=phy_node;pp->phy_interface=phy_mode;pp->use_inband_status=(phy_mode==PHY_INTERFACE_MODE_SGMII)&&-fixed_phy;+autoneg_link;pp->clk=devm_clk_get(&pdev->dev,NULL);if(IS_ERR(pp->clk)){
The commit 898b2970e2c9 ("mvneta: implement SGMII-based in-band link state
signaling") implemented the link parameters auto-negotiation unconditionally.
Unfortunately it appears that some HW that implements SGMII protocol,
doesn't generate the inband status, so it is not possible to auto-negotiate
anything with such HW.
What is the purpose of using the in-band status in the first place if
you end-up having to specify a 'fixed-link' property which contains most
of the link parameters: speed, duplex etc...?
quoted hunk
This patch enables the auto-negotiation only if the 'link' DT property
is set to "auto".
For old configurations where the 'link' property is not specified, the
default is to not use auto-negotiation.
This patch fixes the following regression:
https://lkml.org/lkml/2015/7/8/865
and is therefore CCed to stable.
Signed-off-by: Stas Sergeev <redacted>
CC: Thomas Petazzoni <redacted>
CC: netdev@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: stable@vger.kernel.org
---
drivers/net/ethernet/marvell/mvneta.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
@@ -3009,7 +3009,7 @@ static int mvneta_probe(struct platform_device *pdev)charhw_mac_addr[ETH_ALEN];constchar*mac_from;intphy_mode;-intfixed_phy=0;+intautoneg_link=0;interr;/* Our multiqueue support is not complete, so for now, only
@@ -3043,7 +3043,7 @@ static int mvneta_probe(struct platform_device *pdev)dev_err(&pdev->dev,"cannot register fixed PHY\n");gotoerr_free_irq;}-fixed_phy=1;+autoneg_link=of_phy_is_autoneg_link(dn);/* In the case of a fixed PHY, the DT node associated*tothePHYistheEthernetMACDTnode.
@@ -3068,7 +3068,7 @@ static int mvneta_probe(struct platform_device *pdev)pp->phy_node=phy_node;pp->phy_interface=phy_mode;pp->use_inband_status=(phy_mode==PHY_INTERFACE_MODE_SGMII)&&-fixed_phy;+autoneg_link;pp->clk=devm_clk_get(&pdev->dev,NULL);if(IS_ERR(pp->clk)){
The commit 898b2970e2c9 ("mvneta: implement SGMII-based in-band link state
signaling") implemented the link parameters auto-negotiation unconditionally.
Unfortunately it appears that some HW that implements SGMII protocol,
doesn't generate the inband status, so it is not possible to auto-negotiate
anything with such HW.
What is the purpose of using the in-band status in the first place if
you end-up having to specify a 'fixed-link' property which contains most
of the link parameters: speed, duplex etc...?
You don't have to.
My config from today is as simple as:
fixed-link {
link = "auto";
};
and that's all.
Without my today's patch, only 'speed' is a mandatory - not too much.
The commit 898b2970e2c9 ("mvneta: implement SGMII-based in-band link
state
signaling") implemented the link parameters auto-negotiation
unconditionally.
Unfortunately it appears that some HW that implements SGMII protocol,
doesn't generate the inband status, so it is not possible to
auto-negotiate
anything with such HW.
What is the purpose of using the in-band status in the first place if
you end-up having to specify a 'fixed-link' property which contains most
of the link parameters: speed, duplex etc...?
You don't have to.
My config from today is as simple as:
fixed-link {
link = "auto";
};
and that's all.
Without my today's patch, only 'speed' is a mandatory - not too much.
That makes me think that 'fixed-link' is not exactly what you want then,
you would probably want something like "marvell,use-in-band-status" or
something like this. It could be a more generic property that is not
Marvell specific after all, that would be fine.
--
Florian
The commit 898b2970e2c9 ("mvneta: implement SGMII-based in-band link
state
signaling") implemented the link parameters auto-negotiation
unconditionally.
Unfortunately it appears that some HW that implements SGMII protocol,
doesn't generate the inband status, so it is not possible to
auto-negotiate
anything with such HW.
What is the purpose of using the in-band status in the first place if
you end-up having to specify a 'fixed-link' property which contains most
of the link parameters: speed, duplex etc...?
You don't have to.
My config from today is as simple as:
fixed-link {
link = "auto";
};
and that's all.
Without my today's patch, only 'speed' is a mandatory - not too much.
That makes me think that 'fixed-link' is not exactly what you want then,
you would probably want something like "marvell,use-in-band-status" or
something like this. It could be a more generic property that is not
Marvell specific after all, that would be fine.
I think there is some confusion around fixed-link, because
of its name. This is what fixed-link is:
---
Some Ethernet MACs have a "fixed link", and are not connected to a
normal MDIO-managed PHY device.
---
A bit vague, but to me it means "non-MDIO", and that's all.
If we make it like "marvell,use-in-band-status", then it will
suddenly cancel everything in a fixed-link definition, which
is non obvious. Or, if we make it so that fixed-link def is
not needed in presence of "marvell,use-in-band-status", then
this "marvell,use-in-band-status" will have to silently enable
the fixed-phy driver the way fixed-link does.
If we just view fixed-link as non-MDIO link, then everything
fits, IMHO.