tg3: Misc fixes
Subsystems (3)
cover tg3: Misc fixes
Nithin Nayak Sujir (5):
tg3: Don't add rxbds_empty to rx_over_errors
tg3: Add flag to disable 1G Half Duplex advertisement
tg3: Fix bit definition for the nvram Auto Power Down setting
tg3: Expand multicast drop counter miscounting fix to 5762
tg3: Update version to 3.135
drivers/net/ethernet/broadcom/tg3.c | 37 ++++++++++++++++++++++++++----------- drivers/net/ethernet/broadcom/tg3.h | 6 +++++- 2 files changed, 31 insertions(+), 12 deletions(-)
Signature · 1 line
1.8.1.4
PATCH 1/5 tg3: Don't add rxbds_empty to rx_over_errors
rxbds_empty is an informational statistic signifying that a ring full condition was observed. It does not mean an overflow has occurred.
--- drivers/net/ethernet/broadcom/tg3.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +0 -2
@@ -11746,8 +11746,6 @@ static void tg3_get_nstats(struct tg3 *tp, struct rtnl_link_stats64 *stats)get_stat64 (&hw_stats->rx_frame_too_long_errors) +get_stat64 (&hw_stats->rx_undersize_packets); - stats->rx_over_errors = old_stats->rx_over_errors + -get_stat64 (&hw_stats->rxbds_empty); stats->rx_frame_errors = old_stats->rx_frame_errors +get_stat64 (&hw_stats->rx_align_errors); stats->tx_aborted_errors = old_stats->tx_aborted_errors +
Signature · 1 line
1.8.1.4
PATCH 2/5 tg3: Add flag to disable 1G Half Duplex advertisement
In reply to Nithin Nayak SujirSome link partners have issues if the non-standard 1G half duplex is advertised. This patch adds support for an nvram setting to disable the advertisement.
--- drivers/net/ethernet/broadcom/tg3.c | 28 +++++++++++++++++++++------- drivers/net/ethernet/broadcom/tg3.h | 4 ++++ 2 files changed, 25 insertions(+), 7 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +21 -7
@@ -4403,9 +4403,12 @@ static void tg3_phy_copper_begin(struct tg3 *tp)if (tg3_flag (tp,WOL_SPEED_100MB )) adv |= ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full; -if (tp->phy_flags &TG3_PHYFLG_1G_ON_VAUX_OK ) - adv |= ADVERTISED_1000baseT_Half | - ADVERTISED_1000baseT_Full; +if (tp->phy_flags &TG3_PHYFLG_1G_ON_VAUX_OK ) { +if (!(tp->phy_flags & +TG3_PHYFLG_DISABLE_1G_HD_ADV )) + adv |= ADVERTISED_1000baseT_Half; + adv |= ADVERTISED_1000baseT_Full; + } fc =FLOW_CTRL_TX |FLOW_CTRL_RX ; }else {
@@ -14917,7 +14920,8 @@ static void tg3_get_eeprom_hw_cfg(struct tg3 *tp)tg3_read_mem (tp,NIC_SRAM_DATA_SIG , &val);if (val ==NIC_SRAM_DATA_SIG_MAGIC ) {u32 nic_cfg, led_cfg; -u32 nic_phy_id, ver, cfg2 =0 , cfg4 =0 , eeprom_phy_id; +u32 cfg2 =0 , cfg4 =0 , cfg5 =0 ; +u32 nic_phy_id, ver, eeprom_phy_id;int eeprom_phy_serdes =0 ;tg3_read_mem (tp,NIC_SRAM_DATA_CFG , &nic_cfg);
@@ -14934,6 +14938,11 @@ static void tg3_get_eeprom_hw_cfg(struct tg3 *tp)if (tg3_asic_rev (tp) ==ASIC_REV_5785 )tg3_read_mem (tp,NIC_SRAM_DATA_CFG_4 , &cfg4); +if (tg3_asic_rev (tp) ==ASIC_REV_5717 || +tg3_asic_rev (tp) ==ASIC_REV_5719 || +tg3_asic_rev (tp) ==ASIC_REV_5720 ) +tg3_read_mem (tp,NIC_SRAM_DATA_CFG_5 , &cfg5); +if ((nic_cfg &NIC_SRAM_DATA_CFG_PHY_TYPE_MASK ) ==NIC_SRAM_DATA_CFG_PHY_TYPE_FIBER ) eeprom_phy_serdes =1 ;
@@ -15086,6 +15095,9 @@ static void tg3_get_eeprom_hw_cfg(struct tg3 *tp)tg3_flag_set (tp,RGMII_EXT_IBND_RX_EN );if (cfg4 &NIC_SRAM_RGMII_EXT_IBND_TX_EN )tg3_flag_set (tp,RGMII_EXT_IBND_TX_EN ); + +if (cfg5 &NIC_SRAM_DISABLE_1G_HALF_ADV ) + tp->phy_flags |=TG3_PHYFLG_DISABLE_1G_HD_ADV ; } done:if (tg3_flag (tp,WOL_CAP ))
@@ -15181,9 +15193,11 @@ static void tg3_phy_init_link_config(struct tg3 *tp) {u32 adv = ADVERTISED_Autoneg; -if (!(tp->phy_flags &TG3_PHYFLG_10_100_ONLY )) - adv |= ADVERTISED_1000baseT_Half | - ADVERTISED_1000baseT_Full; +if (!(tp->phy_flags &TG3_PHYFLG_10_100_ONLY )) { +if (!(tp->phy_flags &TG3_PHYFLG_DISABLE_1G_HD_ADV )) + adv |= ADVERTISED_1000baseT_Half; + adv |= ADVERTISED_1000baseT_Full; + }if (!(tp->phy_flags &TG3_PHYFLG_ANY_SERDES )) adv |= ADVERTISED_100baseT_Half |
drivers/net/ethernet/broadcom/tg3.h +4 -0
@@ -2226,6 +2226,9 @@#define NIC_SRAM_CPMUSTAT_SIG 0x0000362c#define NIC_SRAM_CPMUSTAT_SIG_MSK 0x0000ffff +#define NIC_SRAM_DATA_CFG_5 0x00000e0c +#define NIC_SRAM_DISABLE_1G_HALF_ADV 0x00000002 +#define NIC_SRAM_RX_MINI_BUFFER_DESC 0x00001000#define NIC_SRAM_DMA_DESC_POOL_BASE 0x00002000
@@ -3325,6 +3328,7 @@ struct tg3 {#define TG3_PHYFLG_1G_ON_VAUX_OK 0x00080000#define TG3_PHYFLG_KEEP_LINK_ON_PWRDN 0x00100000#define TG3_PHYFLG_MDIX_STATE 0x00200000 +#define TG3_PHYFLG_DISABLE_1G_HD_ADV 0x00400000u32 led_ctrl;u32 phy_otp;
Signature · 1 line
1.8.1.4
PATCH 3/5 tg3: Fix bit definition for the nvram Auto Power Down setting
In reply to Nithin Nayak SujirThe APD bit is 14 and not bit 10.
--- drivers/net/ethernet/broadcom/tg3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/tg3.h +1 -1
@@ -2204,7 +2204,7 @@#define NIC_SRAM_DATA_CFG_2 0x00000d38 -#define NIC_SRAM_DATA_CFG_2_APD_EN 0x00000400 +#define NIC_SRAM_DATA_CFG_2_APD_EN 0x00004000#define SHASTA_EXT_LED_MODE_MASK 0x00018000#define SHASTA_EXT_LED_LEGACY 0x00000000#define SHASTA_EXT_LED_SHARED 0x00008000
Signature · 1 line
1.8.1.4
PATCH 4/5 tg3: Expand multicast drop counter miscounting fix to 5762
In reply to Nithin Nayak Sujircommit 4d95847381228639844c7197deb8b2211274ef22 - "tg3: Workaround rx_discards stat bug", added a workaround for miscounted statistics for multicast packets. This fix needs to be applied to the 5762.
--- drivers/net/ethernet/broadcom/tg3.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/broadcom/tg3.c +3 -0
@@ -9969,6 +9969,7 @@ static int tg3_reset_hw(struct tg3 *tp, bool reset_phy)if (tg3_asic_rev (tp) ==ASIC_REV_5719 ) val |=BUFMGR_MODE_NO_TX_UNDERRUN ;if (tg3_asic_rev (tp) ==ASIC_REV_5717 || +tg3_asic_rev (tp) ==ASIC_REV_5762 ||tg3_chip_rev_id (tp) ==CHIPREV_ID_5719_A0 ||tg3_chip_rev_id (tp) ==CHIPREV_ID_5720_A0 ) val |=BUFMGR_MODE_MBLOW_ATTN_ENAB ;
@@ -10754,6 +10755,7 @@ static void tg3_periodic_fetch_stats(struct tg3 *tp)TG3_STAT_ADD32 (&sp->rxbds_empty,RCVLPC_NO_RCV_BD_CNT );if (tg3_asic_rev (tp) !=ASIC_REV_5717 && +tg3_asic_rev (tp) !=ASIC_REV_5762 &&tg3_chip_rev_id (tp) !=CHIPREV_ID_5719_A0 &&tg3_chip_rev_id (tp) !=CHIPREV_ID_5720_A0 ) {TG3_STAT_ADD32 (&sp->rx_discards,RCVLPC_IN_DISCARDS_CNT );
@@ -16545,6 +16547,7 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)/* Set these bits to enable statistics workaround. */ if (tg3_asic_rev (tp) ==ASIC_REV_5717 || +tg3_asic_rev (tp) ==ASIC_REV_5762 ||tg3_chip_rev_id (tp) ==CHIPREV_ID_5719_A0 ||tg3_chip_rev_id (tp) ==CHIPREV_ID_5720_A0 ) { tp->coalesce_mode |=HOSTCC_MODE_ATTN ;
Signature · 1 line
1.8.1.4
PATCH 5/5 tg3: Update version to 3.135
In reply to Nithin Nayak Sujir--- drivers/net/ethernet/broadcom/tg3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +2 -2
@@ -94,10 +94,10 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits)#define DRV_MODULE_NAME "tg3"#define TG3_MAJ_NUM 3 -#define TG3_MIN_NUM 134 +#define TG3_MIN_NUM 135#define DRV_MODULE_VERSION \ __stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM) -#define DRV_MODULE_RELDATE "Sep 16, 2013" +#define DRV_MODULE_RELDATE "Nov 14, 2013"#define RESET_KIND_SHUTDOWN 0#define RESET_KIND_INIT 1
Signature · 1 line
1.8.1.4
David Miller
maintainerFrom: Nithin Nayak Sujir <[email protected]>
Date: Fri, 6 Dec 2013 09:53:15 -0800
Quoted 6 lines
Nithin Nayak Sujir (5):
tg3: Don't addrxbds_emptytorx_over_errors
tg3: Add flag to disable 1G Half Duplex advertisement
tg3: Fix bit definition for the nvram Auto Power Down setting
tg3: Expand multicast drop counter miscounting fix to 5762
tg3: Update version to 3.135
Series applied, thanks.