Skip to content

Commit 2882b06

Browse files
committed
Merge branch 'ravb-Duplex-handling-update-V3'
Magnus Damm says: ==================== ravb: Duplex handling update V3 [PATCH v3 01/02] ravb: Do not announce HDX as supported [PATCH v3 02/02] ravb: Clean up duplex handling This series is V3 of duplex handling improvements for the Ethernet-AVB driver. Previous versions of this series have been posted to linux-renesas-soc as RFC so V3 is the first actual version to make it to netdev. Based on the latest data sheet for R-Car Gen3 [1] and R-Car Gen2 [2] the following information is part of the EthernetAVB-IF overview page: Transfer speed: Supports transfer at 100 and 1000 Mbps Mode: Full-duplex mode It seems that the driver implementation is not matching the information provided in the friendly data sheet, and on top of this during run-time when changing PHY configuration of the link partner the Ethernet-AVB PHY seems to want to announce unsupported modes. [1] R-Car Series, 3rd Generation Rev.1.00 (Apr 2018) [2] R-Car Series, 2nd Generation Rev.2.00 (Feb 2016) Changes since V2: - Updated patch 1/2 to make use of phy_remove_link_mode() - Added Reviewed-by from Sergei - thanks! Changes since V1: - Updated patches to reflect input from Sergei and Geert - thanks! ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 02d805d + 08b4385 commit 2882b06

2 files changed

Lines changed: 5 additions & 19 deletions

File tree

‎drivers/net/ethernet/renesas/ravb.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,6 @@ struct ravb_private {
10321032
phy_interface_t phy_interface;
10331033
int msg_enable;
10341034
int speed;
1035-
int duplex;
10361035
int emac_irq;
10371036
enum ravb_chip_id chip_id;
10381037
int rx_irqs[NUM_RX_QUEUE];

‎drivers/net/ethernet/renesas/ravb_main.c‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@ static int ravb_config(struct net_device *ndev)
8282
return error;
8383
}
8484

85-
static void ravb_set_duplex(struct net_device *ndev)
86-
{
87-
struct ravb_private *priv = netdev_priv(ndev);
88-
89-
ravb_modify(ndev, ECMR, ECMR_DM, priv->duplex ? ECMR_DM : 0);
90-
}
91-
9285
static void ravb_set_rate(struct net_device *ndev)
9386
{
9487
struct ravb_private *priv = netdev_priv(ndev);
@@ -406,13 +399,11 @@ static int ravb_ring_init(struct net_device *ndev, int q)
406399
/* E-MAC init function */
407400
static void ravb_emac_init(struct net_device *ndev)
408401
{
409-
struct ravb_private *priv = netdev_priv(ndev);
410-
411402
/* Receive frame limit set register */
412403
ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR);
413404

414405
/* EMAC Mode: PAUSE prohibition; Duplex; RX Checksum; TX; RX */
415-
ravb_write(ndev, ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) |
406+
ravb_write(ndev, ECMR_ZPF | ECMR_DM |
416407
(ndev->features & NETIF_F_RXCSUM ? ECMR_RCSC : 0) |
417408
ECMR_TE | ECMR_RE, ECMR);
418409

@@ -995,12 +986,6 @@ static void ravb_adjust_link(struct net_device *ndev)
995986
ravb_rcv_snd_disable(ndev);
996987

997988
if (phydev->link) {
998-
if (phydev->duplex != priv->duplex) {
999-
new_state = true;
1000-
priv->duplex = phydev->duplex;
1001-
ravb_set_duplex(ndev);
1002-
}
1003-
1004989
if (phydev->speed != priv->speed) {
1005990
new_state = true;
1006991
priv->speed = phydev->speed;
@@ -1015,7 +1000,6 @@ static void ravb_adjust_link(struct net_device *ndev)
10151000
new_state = true;
10161001
priv->link = 0;
10171002
priv->speed = 0;
1018-
priv->duplex = -1;
10191003
}
10201004

10211005
/* Enable TX and RX right over here, if E-MAC change is ignored */
@@ -1045,7 +1029,6 @@ static int ravb_phy_init(struct net_device *ndev)
10451029

10461030
priv->link = 0;
10471031
priv->speed = 0;
1048-
priv->duplex = -1;
10491032

10501033
/* Try connecting to PHY */
10511034
pn = of_parse_phandle(np, "phy-handle", 0);
@@ -1088,6 +1071,10 @@ static int ravb_phy_init(struct net_device *ndev)
10881071
phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_Pause_BIT);
10891072
phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_Asym_Pause_BIT);
10901073

1074+
/* Half Duplex is not supported */
1075+
phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
1076+
phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT);
1077+
10911078
phy_attached_info(phydev);
10921079

10931080
return 0;

0 commit comments

Comments
 (0)