* [PATCH net-next 0/5] tg3: Misc fixes
@ 2013-12-06 17:53 Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 1/5] tg3: Don't add rxbds_empty to rx_over_errors Nithin Nayak Sujir
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Nithin Nayak Sujir @ 2013-12-06 17:53 UTC (permalink / raw)
To: davem; +Cc: netdev, Nithin Nayak Sujir
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(-)
--
1.8.1.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net-next 1/5] tg3: Don't add rxbds_empty to rx_over_errors
2013-12-06 17:53 [PATCH net-next 0/5] tg3: Misc fixes Nithin Nayak Sujir
@ 2013-12-06 17:53 ` Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 2/5] tg3: Add flag to disable 1G Half Duplex advertisement Nithin Nayak Sujir
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Nithin Nayak Sujir @ 2013-12-06 17:53 UTC (permalink / raw)
To: davem; +Cc: netdev, Nithin Nayak Sujir, Michael Chan
rxbds_empty is an informational statistic signifying that a ring full
condition was observed. It does not mean an overflow has occurred.
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index e35a1c5..886d50b 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -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 +
--
1.8.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net-next 2/5] tg3: Add flag to disable 1G Half Duplex advertisement
2013-12-06 17:53 [PATCH net-next 0/5] tg3: Misc fixes Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 1/5] tg3: Don't add rxbds_empty to rx_over_errors Nithin Nayak Sujir
@ 2013-12-06 17:53 ` Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 3/5] tg3: Fix bit definition for the nvram Auto Power Down setting Nithin Nayak Sujir
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Nithin Nayak Sujir @ 2013-12-06 17:53 UTC (permalink / raw)
To: davem; +Cc: netdev, Nithin Nayak Sujir, Michael Chan
Some 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.
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 28 +++++++++++++++++++++-------
drivers/net/ethernet/broadcom/tg3.h | 4 ++++
2 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 886d50b..e8847cc 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -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 |
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 5c3835a..e128f37 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -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 0x00400000
u32 led_ctrl;
u32 phy_otp;
--
1.8.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net-next 3/5] tg3: Fix bit definition for the nvram Auto Power Down setting
2013-12-06 17:53 [PATCH net-next 0/5] tg3: Misc fixes Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 1/5] tg3: Don't add rxbds_empty to rx_over_errors Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 2/5] tg3: Add flag to disable 1G Half Duplex advertisement Nithin Nayak Sujir
@ 2013-12-06 17:53 ` Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 4/5] tg3: Expand multicast drop counter miscounting fix to 5762 Nithin Nayak Sujir
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Nithin Nayak Sujir @ 2013-12-06 17:53 UTC (permalink / raw)
To: davem; +Cc: netdev, Nithin Nayak Sujir, Michael Chan
The APD bit is 14 and not bit 10.
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index e128f37..e4da9d7 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -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
--
1.8.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net-next 4/5] tg3: Expand multicast drop counter miscounting fix to 5762
2013-12-06 17:53 [PATCH net-next 0/5] tg3: Misc fixes Nithin Nayak Sujir
` (2 preceding siblings ...)
2013-12-06 17:53 ` [PATCH net-next 3/5] tg3: Fix bit definition for the nvram Auto Power Down setting Nithin Nayak Sujir
@ 2013-12-06 17:53 ` Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 5/5] tg3: Update version to 3.135 Nithin Nayak Sujir
2013-12-06 20:11 ` [PATCH net-next 0/5] tg3: Misc fixes David Miller
5 siblings, 0 replies; 7+ messages in thread
From: Nithin Nayak Sujir @ 2013-12-06 17:53 UTC (permalink / raw)
To: davem; +Cc: netdev, Nithin Nayak Sujir, Michael Chan
commit 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.
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index e8847cc..7cba139 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -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;
--
1.8.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net-next 5/5] tg3: Update version to 3.135
2013-12-06 17:53 [PATCH net-next 0/5] tg3: Misc fixes Nithin Nayak Sujir
` (3 preceding siblings ...)
2013-12-06 17:53 ` [PATCH net-next 4/5] tg3: Expand multicast drop counter miscounting fix to 5762 Nithin Nayak Sujir
@ 2013-12-06 17:53 ` Nithin Nayak Sujir
2013-12-06 20:11 ` [PATCH net-next 0/5] tg3: Misc fixes David Miller
5 siblings, 0 replies; 7+ messages in thread
From: Nithin Nayak Sujir @ 2013-12-06 17:53 UTC (permalink / raw)
To: davem; +Cc: netdev, Nithin Nayak Sujir, Michael Chan
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 7cba139..9a4a601 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -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
--
1.8.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 0/5] tg3: Misc fixes
2013-12-06 17:53 [PATCH net-next 0/5] tg3: Misc fixes Nithin Nayak Sujir
` (4 preceding siblings ...)
2013-12-06 17:53 ` [PATCH net-next 5/5] tg3: Update version to 3.135 Nithin Nayak Sujir
@ 2013-12-06 20:11 ` David Miller
5 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2013-12-06 20:11 UTC (permalink / raw)
To: nsujir; +Cc: netdev
From: Nithin Nayak Sujir <nsujir@broadcom.com>
Date: Fri, 6 Dec 2013 09:53:15 -0800
> 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
Series applied, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-12-06 20:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-06 17:53 [PATCH net-next 0/5] tg3: Misc fixes Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 1/5] tg3: Don't add rxbds_empty to rx_over_errors Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 2/5] tg3: Add flag to disable 1G Half Duplex advertisement Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 3/5] tg3: Fix bit definition for the nvram Auto Power Down setting Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 4/5] tg3: Expand multicast drop counter miscounting fix to 5762 Nithin Nayak Sujir
2013-12-06 17:53 ` [PATCH net-next 5/5] tg3: Update version to 3.135 Nithin Nayak Sujir
2013-12-06 20:11 ` [PATCH net-next 0/5] tg3: Misc fixes David Miller
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).