2016-10-18 07:20:58

by Niklas Cassel

[permalink] [raw]
Subject: [PATCH v2 1/2] dwc_eth_qos: do not clear pause flags from phy_device->supported

From: Niklas Cassel <[email protected]>

phy_device->supported is originally set by the PHY driver.
The ethernet driver should filter phy_device->supported to only contain
flags supported by the IP.
The IP supports setting rx and tx flow control independently,
therefore SUPPORTED_Pause and SUPPORTED_Asym_Pause should not be cleared.
If the flags are cleared, pause frames cannot be enabled (even if they
are supported by the PHY).

Signed-off-by: Niklas Cassel <[email protected]>
Signed-off-by: Jesper Nilsson <[email protected]>
Acked-by: Lars Persson <[email protected]>
---
drivers/net/ethernet/synopsys/dwc_eth_qos.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/synopsys/dwc_eth_qos.c b/drivers/net/ethernet/synopsys/dwc_eth_qos.c
index 0d0053128542..d775729648ef 100644
--- a/drivers/net/ethernet/synopsys/dwc_eth_qos.c
+++ b/drivers/net/ethernet/synopsys/dwc_eth_qos.c
@@ -982,7 +982,8 @@ static int dwceqos_mii_probe(struct net_device *ndev)
if (netif_msg_probe(lp))
phy_attached_info(phydev);

- phydev->supported &= PHY_GBIT_FEATURES;
+ phydev->supported &= PHY_GBIT_FEATURES | SUPPORTED_Pause |
+ SUPPORTED_Asym_Pause;

lp->link = 0;
lp->speed = 0;
--
2.1.4


2016-10-18 14:30:23

by David Miller

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] dwc_eth_qos: do not clear pause flags from phy_device->supported

From: Niklas Cassel <[email protected]>
Date: Tue, 18 Oct 2016 09:20:33 +0200

> From: Niklas Cassel <[email protected]>
>
> phy_device->supported is originally set by the PHY driver.
> The ethernet driver should filter phy_device->supported to only contain
> flags supported by the IP.
> The IP supports setting rx and tx flow control independently,
> therefore SUPPORTED_Pause and SUPPORTED_Asym_Pause should not be cleared.
> If the flags are cleared, pause frames cannot be enabled (even if they
> are supported by the PHY).
>
> Signed-off-by: Niklas Cassel <[email protected]>
> Signed-off-by: Jesper Nilsson <[email protected]>
> Acked-by: Lars Persson <[email protected]>

Applied.