aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c1
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c18
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h3
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c8
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_hw.c12
-rw-r--r--drivers/net/ethernet/dec/tulip/Kconfig1
-rw-r--r--drivers/net/ethernet/freescale/fec.c33
-rw-r--r--drivers/net/ethernet/freescale/fec.h1
-rw-r--r--drivers/net/ethernet/freescale/fec_ptp.c3
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_82575.c33
-rw-r--r--drivers/net/ethernet/intel/igb/igb_hwmon.c2
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c4
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ptp.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c24
-rw-r--r--drivers/net/ethernet/lantiq_etop.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c22
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/eq.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/resource_tracker.c45
-rw-r--r--drivers/net/ethernet/nxp/lpc_eth.c3
-rw-r--r--drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c4
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c10
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.h1
-rw-r--r--drivers/net/ethernet/sfc/nic.c3
-rw-r--r--drivers/net/ethernet/ti/cpsw.c4
-rw-r--r--drivers/net/ethernet/ti/davinci_emac.c2
25 files changed, 164 insertions, 79 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index a923bc4d5a1f..4046f97378c2 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2760,6 +2760,7 @@ load_error2:
2760 bp->port.pmf = 0; 2760 bp->port.pmf = 0;
2761load_error1: 2761load_error1:
2762 bnx2x_napi_disable(bp); 2762 bnx2x_napi_disable(bp);
2763 bnx2x_del_all_napi(bp);
2763 2764
2764 /* clear pf_load status, as it was already set */ 2765 /* clear pf_load status, as it was already set */
2765 if (IS_PF(bp)) 2766 if (IS_PF(bp))
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
index 568205436a15..91ecd6a00d05 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
@@ -2139,12 +2139,12 @@ static u8 bnx2x_dcbnl_get_cap(struct net_device *netdev, int capid, u8 *cap)
2139 break; 2139 break;
2140 default: 2140 default:
2141 BNX2X_ERR("Non valid capability ID\n"); 2141 BNX2X_ERR("Non valid capability ID\n");
2142 rval = -EINVAL; 2142 rval = 1;
2143 break; 2143 break;
2144 } 2144 }
2145 } else { 2145 } else {
2146 DP(BNX2X_MSG_DCB, "DCB disabled\n"); 2146 DP(BNX2X_MSG_DCB, "DCB disabled\n");
2147 rval = -EINVAL; 2147 rval = 1;
2148 } 2148 }
2149 2149
2150 DP(BNX2X_MSG_DCB, "capid %d:%x\n", capid, *cap); 2150 DP(BNX2X_MSG_DCB, "capid %d:%x\n", capid, *cap);
@@ -2170,12 +2170,12 @@ static int bnx2x_dcbnl_get_numtcs(struct net_device *netdev, int tcid, u8 *num)
2170 break; 2170 break;
2171 default: 2171 default:
2172 BNX2X_ERR("Non valid TC-ID\n"); 2172 BNX2X_ERR("Non valid TC-ID\n");
2173 rval = -EINVAL; 2173 rval = 1;
2174 break; 2174 break;
2175 } 2175 }
2176 } else { 2176 } else {
2177 DP(BNX2X_MSG_DCB, "DCB disabled\n"); 2177 DP(BNX2X_MSG_DCB, "DCB disabled\n");
2178 rval = -EINVAL; 2178 rval = 1;
2179 } 2179 }
2180 2180
2181 return rval; 2181 return rval;
@@ -2188,7 +2188,7 @@ static int bnx2x_dcbnl_set_numtcs(struct net_device *netdev, int tcid, u8 num)
2188 return -EINVAL; 2188 return -EINVAL;
2189} 2189}
2190 2190
2191static u8 bnx2x_dcbnl_get_pfc_state(struct net_device *netdev) 2191static u8 bnx2x_dcbnl_get_pfc_state(struct net_device *netdev)
2192{ 2192{
2193 struct bnx2x *bp = netdev_priv(netdev); 2193 struct bnx2x *bp = netdev_priv(netdev);
2194 DP(BNX2X_MSG_DCB, "state = %d\n", bp->dcbx_local_feat.pfc.enabled); 2194 DP(BNX2X_MSG_DCB, "state = %d\n", bp->dcbx_local_feat.pfc.enabled);
@@ -2390,12 +2390,12 @@ static u8 bnx2x_dcbnl_get_featcfg(struct net_device *netdev, int featid,
2390 break; 2390 break;
2391 default: 2391 default:
2392 BNX2X_ERR("Non valid featrue-ID\n"); 2392 BNX2X_ERR("Non valid featrue-ID\n");
2393 rval = -EINVAL; 2393 rval = 1;
2394 break; 2394 break;
2395 } 2395 }
2396 } else { 2396 } else {
2397 DP(BNX2X_MSG_DCB, "DCB disabled\n"); 2397 DP(BNX2X_MSG_DCB, "DCB disabled\n");
2398 rval = -EINVAL; 2398 rval = 1;
2399 } 2399 }
2400 2400
2401 return rval; 2401 return rval;
@@ -2431,12 +2431,12 @@ static u8 bnx2x_dcbnl_set_featcfg(struct net_device *netdev, int featid,
2431 break; 2431 break;
2432 default: 2432 default:
2433 BNX2X_ERR("Non valid featrue-ID\n"); 2433 BNX2X_ERR("Non valid featrue-ID\n");
2434 rval = -EINVAL; 2434 rval = 1;
2435 break; 2435 break;
2436 } 2436 }
2437 } else { 2437 } else {
2438 DP(BNX2X_MSG_DCB, "dcbnl call not valid\n"); 2438 DP(BNX2X_MSG_DCB, "dcbnl call not valid\n");
2439 rval = -EINVAL; 2439 rval = 1;
2440 } 2440 }
2441 2441
2442 return rval; 2442 return rval;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
index 364e37ecbc5c..198f6f1c9ad5 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
@@ -459,8 +459,9 @@ struct bnx2x_fw_port_stats_old {
459 459
460#define UPDATE_QSTAT(s, t) \ 460#define UPDATE_QSTAT(s, t) \
461 do { \ 461 do { \
462 qstats->t##_hi = qstats_old->t##_hi + le32_to_cpu(s.hi); \
463 qstats->t##_lo = qstats_old->t##_lo + le32_to_cpu(s.lo); \ 462 qstats->t##_lo = qstats_old->t##_lo + le32_to_cpu(s.lo); \
463 qstats->t##_hi = qstats_old->t##_hi + le32_to_cpu(s.hi) \
464 + ((qstats->t##_lo < qstats_old->t##_lo) ? 1 : 0); \
464 } while (0) 465 } while (0)
465 466
466#define UPDATE_QSTAT_OLD(f) \ 467#define UPDATE_QSTAT_OLD(f) \
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 93729f942358..67d2663b3974 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -4130,6 +4130,14 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
4130 tp->link_config.active_speed = tp->link_config.speed; 4130 tp->link_config.active_speed = tp->link_config.speed;
4131 tp->link_config.active_duplex = tp->link_config.duplex; 4131 tp->link_config.active_duplex = tp->link_config.duplex;
4132 4132
4133 if (tg3_asic_rev(tp) == ASIC_REV_5714) {
4134 /* With autoneg disabled, 5715 only links up when the
4135 * advertisement register has the configured speed
4136 * enabled.
4137 */
4138 tg3_writephy(tp, MII_ADVERTISE, ADVERTISE_ALL);
4139 }
4140
4133 bmcr = 0; 4141 bmcr = 0;
4134 switch (tp->link_config.speed) { 4142 switch (tp->link_config.speed) {
4135 default: 4143 default:
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 4ce62031f62f..8049268ce0f2 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -497,8 +497,9 @@ int t4_memory_write(struct adapter *adap, int mtype, u32 addr, u32 len,
497} 497}
498 498
499#define EEPROM_STAT_ADDR 0x7bfc 499#define EEPROM_STAT_ADDR 0x7bfc
500#define VPD_BASE 0
501#define VPD_LEN 512 500#define VPD_LEN 512
501#define VPD_BASE 0x400
502#define VPD_BASE_OLD 0
502 503
503/** 504/**
504 * t4_seeprom_wp - enable/disable EEPROM write protection 505 * t4_seeprom_wp - enable/disable EEPROM write protection
@@ -524,7 +525,7 @@ int t4_seeprom_wp(struct adapter *adapter, bool enable)
524int get_vpd_params(struct adapter *adapter, struct vpd_params *p) 525int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
525{ 526{
526 u32 cclk_param, cclk_val; 527 u32 cclk_param, cclk_val;
527 int i, ret; 528 int i, ret, addr;
528 int ec, sn; 529 int ec, sn;
529 u8 *vpd, csum; 530 u8 *vpd, csum;
530 unsigned int vpdr_len, kw_offset, id_len; 531 unsigned int vpdr_len, kw_offset, id_len;
@@ -533,7 +534,12 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
533 if (!vpd) 534 if (!vpd)
534 return -ENOMEM; 535 return -ENOMEM;
535 536
536 ret = pci_read_vpd(adapter->pdev, VPD_BASE, VPD_LEN, vpd); 537 ret = pci_read_vpd(adapter->pdev, VPD_BASE, sizeof(u32), vpd);
538 if (ret < 0)
539 goto out;
540 addr = *vpd == 0x82 ? VPD_BASE : VPD_BASE_OLD;
541
542 ret = pci_read_vpd(adapter->pdev, addr, VPD_LEN, vpd);
537 if (ret < 0) 543 if (ret < 0)
538 goto out; 544 goto out;
539 545
diff --git a/drivers/net/ethernet/dec/tulip/Kconfig b/drivers/net/ethernet/dec/tulip/Kconfig
index 0c37fb2cc867..1df33c799c00 100644
--- a/drivers/net/ethernet/dec/tulip/Kconfig
+++ b/drivers/net/ethernet/dec/tulip/Kconfig
@@ -108,6 +108,7 @@ config TULIP_DM910X
108config DE4X5 108config DE4X5
109 tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA" 109 tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA"
110 depends on (PCI || EISA) 110 depends on (PCI || EISA)
111 depends on VIRT_TO_BUS || ALPHA || PPC || SPARC
111 select CRC32 112 select CRC32
112 ---help--- 113 ---help---
113 This is support for the DIGITAL series of PCI/EISA Ethernet cards. 114 This is support for the DIGITAL series of PCI/EISA Ethernet cards.
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 069a155d16ed..911d0253dbb2 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -934,24 +934,28 @@ static void fec_enet_adjust_link(struct net_device *ndev)
934 goto spin_unlock; 934 goto spin_unlock;
935 } 935 }
936 936
937 /* Duplex link change */
938 if (phy_dev->link) { 937 if (phy_dev->link) {
939 if (fep->full_duplex != phy_dev->duplex) { 938 if (!fep->link) {
940 fec_restart(ndev, phy_dev->duplex);
941 /* prevent unnecessary second fec_restart() below */
942 fep->link = phy_dev->link; 939 fep->link = phy_dev->link;
943 status_change = 1; 940 status_change = 1;
944 } 941 }
945 }
946 942
947 /* Link on or off change */ 943 if (fep->full_duplex != phy_dev->duplex)
948 if (phy_dev->link != fep->link) { 944 status_change = 1;
949 fep->link = phy_dev->link; 945
950 if (phy_dev->link) 946 if (phy_dev->speed != fep->speed) {
947 fep->speed = phy_dev->speed;
948 status_change = 1;
949 }
950
951 /* if any of the above changed restart the FEC */
952 if (status_change)
951 fec_restart(ndev, phy_dev->duplex); 953 fec_restart(ndev, phy_dev->duplex);
952 else 954 } else {
955 if (fep->link) {
953 fec_stop(ndev); 956 fec_stop(ndev);
954 status_change = 1; 957 status_change = 1;
958 }
955 } 959 }
956 960
957spin_unlock: 961spin_unlock:
@@ -1328,7 +1332,7 @@ static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
1328static void fec_enet_free_buffers(struct net_device *ndev) 1332static void fec_enet_free_buffers(struct net_device *ndev)
1329{ 1333{
1330 struct fec_enet_private *fep = netdev_priv(ndev); 1334 struct fec_enet_private *fep = netdev_priv(ndev);
1331 int i; 1335 unsigned int i;
1332 struct sk_buff *skb; 1336 struct sk_buff *skb;
1333 struct bufdesc *bdp; 1337 struct bufdesc *bdp;
1334 1338
@@ -1352,7 +1356,7 @@ static void fec_enet_free_buffers(struct net_device *ndev)
1352static int fec_enet_alloc_buffers(struct net_device *ndev) 1356static int fec_enet_alloc_buffers(struct net_device *ndev)
1353{ 1357{
1354 struct fec_enet_private *fep = netdev_priv(ndev); 1358 struct fec_enet_private *fep = netdev_priv(ndev);
1355 int i; 1359 unsigned int i;
1356 struct sk_buff *skb; 1360 struct sk_buff *skb;
1357 struct bufdesc *bdp; 1361 struct bufdesc *bdp;
1358 1362
@@ -1437,6 +1441,7 @@ fec_enet_close(struct net_device *ndev)
1437 struct fec_enet_private *fep = netdev_priv(ndev); 1441 struct fec_enet_private *fep = netdev_priv(ndev);
1438 1442
1439 /* Don't know what to do yet. */ 1443 /* Don't know what to do yet. */
1444 napi_disable(&fep->napi);
1440 fep->opened = 0; 1445 fep->opened = 0;
1441 netif_stop_queue(ndev); 1446 netif_stop_queue(ndev);
1442 fec_stop(ndev); 1447 fec_stop(ndev);
@@ -1593,7 +1598,7 @@ static int fec_enet_init(struct net_device *ndev)
1593 struct fec_enet_private *fep = netdev_priv(ndev); 1598 struct fec_enet_private *fep = netdev_priv(ndev);
1594 struct bufdesc *cbd_base; 1599 struct bufdesc *cbd_base;
1595 struct bufdesc *bdp; 1600 struct bufdesc *bdp;
1596 int i; 1601 unsigned int i;
1597 1602
1598 /* Allocate memory for buffer descriptors. */ 1603 /* Allocate memory for buffer descriptors. */
1599 cbd_base = dma_alloc_coherent(NULL, PAGE_SIZE, &fep->bd_dma, 1604 cbd_base = dma_alloc_coherent(NULL, PAGE_SIZE, &fep->bd_dma,
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index f5390071efd0..eb4372962839 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -240,6 +240,7 @@ struct fec_enet_private {
240 phy_interface_t phy_interface; 240 phy_interface_t phy_interface;
241 int link; 241 int link;
242 int full_duplex; 242 int full_duplex;
243 int speed;
243 struct completion mdio_done; 244 struct completion mdio_done;
244 int irq[FEC_IRQ_NUM]; 245 int irq[FEC_IRQ_NUM];
245 int bufdesc_ex; 246 int bufdesc_ex;
diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
index 1f17ca0f2201..0d8df400a479 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -128,6 +128,7 @@ void fec_ptp_start_cyclecounter(struct net_device *ndev)
128 128
129 spin_unlock_irqrestore(&fep->tmreg_lock, flags); 129 spin_unlock_irqrestore(&fep->tmreg_lock, flags);
130} 130}
131EXPORT_SYMBOL(fec_ptp_start_cyclecounter);
131 132
132/** 133/**
133 * fec_ptp_adjfreq - adjust ptp cycle frequency 134 * fec_ptp_adjfreq - adjust ptp cycle frequency
@@ -318,6 +319,7 @@ int fec_ptp_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd)
318 return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ? 319 return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ?
319 -EFAULT : 0; 320 -EFAULT : 0;
320} 321}
322EXPORT_SYMBOL(fec_ptp_ioctl);
321 323
322/** 324/**
323 * fec_time_keep - call timecounter_read every second to avoid timer overrun 325 * fec_time_keep - call timecounter_read every second to avoid timer overrun
@@ -383,3 +385,4 @@ void fec_ptp_init(struct net_device *ndev, struct platform_device *pdev)
383 pr_info("registered PHC device on %s\n", ndev->name); 385 pr_info("registered PHC device on %s\n", ndev->name);
384 } 386 }
385} 387}
388EXPORT_SYMBOL(fec_ptp_init);
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index b64542acfa34..12b1d8480808 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -1818,27 +1818,32 @@ out:
1818 **/ 1818 **/
1819void igb_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf) 1819void igb_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf)
1820{ 1820{
1821 u32 dtxswc; 1821 u32 reg_val, reg_offset;
1822 1822
1823 switch (hw->mac.type) { 1823 switch (hw->mac.type) {
1824 case e1000_82576: 1824 case e1000_82576:
1825 reg_offset = E1000_DTXSWC;
1826 break;
1825 case e1000_i350: 1827 case e1000_i350:
1826 dtxswc = rd32(E1000_DTXSWC); 1828 reg_offset = E1000_TXSWC;
1827 if (enable) {
1828 dtxswc |= (E1000_DTXSWC_MAC_SPOOF_MASK |
1829 E1000_DTXSWC_VLAN_SPOOF_MASK);
1830 /* The PF can spoof - it has to in order to
1831 * support emulation mode NICs */
1832 dtxswc ^= (1 << pf | 1 << (pf + MAX_NUM_VFS));
1833 } else {
1834 dtxswc &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
1835 E1000_DTXSWC_VLAN_SPOOF_MASK);
1836 }
1837 wr32(E1000_DTXSWC, dtxswc);
1838 break; 1829 break;
1839 default: 1830 default:
1840 break; 1831 return;
1832 }
1833
1834 reg_val = rd32(reg_offset);
1835 if (enable) {
1836 reg_val |= (E1000_DTXSWC_MAC_SPOOF_MASK |
1837 E1000_DTXSWC_VLAN_SPOOF_MASK);
1838 /* The PF can spoof - it has to in order to
1839 * support emulation mode NICs
1840 */
1841 reg_val ^= (1 << pf | 1 << (pf + MAX_NUM_VFS));
1842 } else {
1843 reg_val &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
1844 E1000_DTXSWC_VLAN_SPOOF_MASK);
1841 } 1845 }
1846 wr32(reg_offset, reg_val);
1842} 1847}
1843 1848
1844/** 1849/**
diff --git a/drivers/net/ethernet/intel/igb/igb_hwmon.c b/drivers/net/ethernet/intel/igb/igb_hwmon.c
index 4623502054d5..0478a1abe541 100644
--- a/drivers/net/ethernet/intel/igb/igb_hwmon.c
+++ b/drivers/net/ethernet/intel/igb/igb_hwmon.c
@@ -39,7 +39,7 @@
39#include <linux/pci.h> 39#include <linux/pci.h>
40 40
41#ifdef CONFIG_IGB_HWMON 41#ifdef CONFIG_IGB_HWMON
42struct i2c_board_info i350_sensor_info = { 42static struct i2c_board_info i350_sensor_info = {
43 I2C_BOARD_INFO("i350bb", (0Xf8 >> 1)), 43 I2C_BOARD_INFO("i350bb", (0Xf8 >> 1)),
44}; 44};
45 45
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 4dbd62968c7a..8496adfc6a68 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2542,8 +2542,8 @@ static void igb_probe_vfs(struct igb_adapter *adapter)
2542 if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211)) 2542 if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211))
2543 return; 2543 return;
2544 2544
2545 igb_enable_sriov(pdev, max_vfs);
2546 pci_sriov_set_totalvfs(pdev, 7); 2545 pci_sriov_set_totalvfs(pdev, 7);
2546 igb_enable_sriov(pdev, max_vfs);
2547 2547
2548#endif /* CONFIG_PCI_IOV */ 2548#endif /* CONFIG_PCI_IOV */
2549} 2549}
@@ -2652,7 +2652,7 @@ static int igb_sw_init(struct igb_adapter *adapter)
2652 if (max_vfs > 7) { 2652 if (max_vfs > 7) {
2653 dev_warn(&pdev->dev, 2653 dev_warn(&pdev->dev,
2654 "Maximum of 7 VFs per PF, using max\n"); 2654 "Maximum of 7 VFs per PF, using max\n");
2655 adapter->vfs_allocated_count = 7; 2655 max_vfs = adapter->vfs_allocated_count = 7;
2656 } else 2656 } else
2657 adapter->vfs_allocated_count = max_vfs; 2657 adapter->vfs_allocated_count = max_vfs;
2658 if (adapter->vfs_allocated_count) 2658 if (adapter->vfs_allocated_count)
diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 0987822359f0..0a237507ee85 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -740,7 +740,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
740 case e1000_82576: 740 case e1000_82576:
741 snprintf(adapter->ptp_caps.name, 16, "%pm", netdev->dev_addr); 741 snprintf(adapter->ptp_caps.name, 16, "%pm", netdev->dev_addr);
742 adapter->ptp_caps.owner = THIS_MODULE; 742 adapter->ptp_caps.owner = THIS_MODULE;
743 adapter->ptp_caps.max_adj = 1000000000; 743 adapter->ptp_caps.max_adj = 999999881;
744 adapter->ptp_caps.n_ext_ts = 0; 744 adapter->ptp_caps.n_ext_ts = 0;
745 adapter->ptp_caps.pps = 0; 745 adapter->ptp_caps.pps = 0;
746 adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82576; 746 adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82576;
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index c3db6cd69b68..2b6cb5ca48ee 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -944,9 +944,17 @@ free_queue_irqs:
944 free_irq(adapter->msix_entries[vector].vector, 944 free_irq(adapter->msix_entries[vector].vector,
945 adapter->q_vector[vector]); 945 adapter->q_vector[vector]);
946 } 946 }
947 pci_disable_msix(adapter->pdev); 947 /* This failure is non-recoverable - it indicates the system is
948 kfree(adapter->msix_entries); 948 * out of MSIX vector resources and the VF driver cannot run
949 adapter->msix_entries = NULL; 949 * without them. Set the number of msix vectors to zero
950 * indicating that not enough can be allocated. The error
951 * will be returned to the user indicating device open failed.
952 * Any further attempts to force the driver to open will also
953 * fail. The only way to recover is to unload the driver and
954 * reload it again. If the system has recovered some MSIX
955 * vectors then it may succeed.
956 */
957 adapter->num_msix_vectors = 0;
950 return err; 958 return err;
951} 959}
952 960
@@ -2572,6 +2580,15 @@ static int ixgbevf_open(struct net_device *netdev)
2572 struct ixgbe_hw *hw = &adapter->hw; 2580 struct ixgbe_hw *hw = &adapter->hw;
2573 int err; 2581 int err;
2574 2582
2583 /* A previous failure to open the device because of a lack of
2584 * available MSIX vector resources may have reset the number
2585 * of msix vectors variable to zero. The only way to recover
2586 * is to unload/reload the driver and hope that the system has
2587 * been able to recover some MSIX vector resources.
2588 */
2589 if (!adapter->num_msix_vectors)
2590 return -ENOMEM;
2591
2575 /* disallow open during test */ 2592 /* disallow open during test */
2576 if (test_bit(__IXGBEVF_TESTING, &adapter->state)) 2593 if (test_bit(__IXGBEVF_TESTING, &adapter->state))
2577 return -EBUSY; 2594 return -EBUSY;
@@ -2628,7 +2645,6 @@ static int ixgbevf_open(struct net_device *netdev)
2628 2645
2629err_req_irq: 2646err_req_irq:
2630 ixgbevf_down(adapter); 2647 ixgbevf_down(adapter);
2631 ixgbevf_free_irq(adapter);
2632err_setup_rx: 2648err_setup_rx:
2633 ixgbevf_free_all_rx_resources(adapter); 2649 ixgbevf_free_all_rx_resources(adapter);
2634err_setup_tx: 2650err_setup_tx:
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 6a2127489af7..bfdb06860397 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -769,7 +769,7 @@ ltq_etop_probe(struct platform_device *pdev)
769 return 0; 769 return 0;
770 770
771err_free: 771err_free:
772 kfree(dev); 772 free_netdev(dev);
773err_out: 773err_out:
774 return err; 774 return err;
775} 775}
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 995d4b6d5c1e..f278b10ef714 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1637,6 +1637,17 @@ void mlx4_en_stop_port(struct net_device *dev, int detach)
1637 /* Flush multicast filter */ 1637 /* Flush multicast filter */
1638 mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0, 1, MLX4_MCAST_CONFIG); 1638 mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0, 1, MLX4_MCAST_CONFIG);
1639 1639
1640 /* Remove flow steering rules for the port*/
1641 if (mdev->dev->caps.steering_mode ==
1642 MLX4_STEERING_MODE_DEVICE_MANAGED) {
1643 ASSERT_RTNL();
1644 list_for_each_entry_safe(flow, tmp_flow,
1645 &priv->ethtool_list, list) {
1646 mlx4_flow_detach(mdev->dev, flow->id);
1647 list_del(&flow->list);
1648 }
1649 }
1650
1640 mlx4_en_destroy_drop_qp(priv); 1651 mlx4_en_destroy_drop_qp(priv);
1641 1652
1642 /* Free TX Rings */ 1653 /* Free TX Rings */
@@ -1657,17 +1668,6 @@ void mlx4_en_stop_port(struct net_device *dev, int detach)
1657 if (!(mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN)) 1668 if (!(mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN))
1658 mdev->mac_removed[priv->port] = 1; 1669 mdev->mac_removed[priv->port] = 1;
1659 1670
1660 /* Remove flow steering rules for the port*/
1661 if (mdev->dev->caps.steering_mode ==
1662 MLX4_STEERING_MODE_DEVICE_MANAGED) {
1663 ASSERT_RTNL();
1664 list_for_each_entry_safe(flow, tmp_flow,
1665 &priv->ethtool_list, list) {
1666 mlx4_flow_detach(mdev->dev, flow->id);
1667 list_del(&flow->list);
1668 }
1669 }
1670
1671 /* Free RX Rings */ 1671 /* Free RX Rings */
1672 for (i = 0; i < priv->rx_ring_num; i++) { 1672 for (i = 0; i < priv->rx_ring_num; i++) {
1673 mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[i]); 1673 mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[i]);
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c
index 251ae2f93116..8e3123a1df88 100644
--- a/drivers/net/ethernet/mellanox/mlx4/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx4/eq.c
@@ -771,7 +771,7 @@ int mlx4_MAP_EQ_wrapper(struct mlx4_dev *dev, int slave,
771 struct mlx4_slave_event_eq_info *event_eq = 771 struct mlx4_slave_event_eq_info *event_eq =
772 priv->mfunc.master.slave_state[slave].event_eq; 772 priv->mfunc.master.slave_state[slave].event_eq;
773 u32 in_modifier = vhcr->in_modifier; 773 u32 in_modifier = vhcr->in_modifier;
774 u32 eqn = in_modifier & 0x1FF; 774 u32 eqn = in_modifier & 0x3FF;
775 u64 in_param = vhcr->in_param; 775 u64 in_param = vhcr->in_param;
776 int err = 0; 776 int err = 0;
777 int i; 777 int i;
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 2995687f1aee..1391b52f443a 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -99,6 +99,7 @@ struct res_qp {
99 struct list_head mcg_list; 99 struct list_head mcg_list;
100 spinlock_t mcg_spl; 100 spinlock_t mcg_spl;
101 int local_qpn; 101 int local_qpn;
102 atomic_t ref_count;
102}; 103};
103 104
104enum res_mtt_states { 105enum res_mtt_states {
@@ -197,6 +198,7 @@ enum res_fs_rule_states {
197 198
198struct res_fs_rule { 199struct res_fs_rule {
199 struct res_common com; 200 struct res_common com;
201 int qpn;
200}; 202};
201 203
202static void *res_tracker_lookup(struct rb_root *root, u64 res_id) 204static void *res_tracker_lookup(struct rb_root *root, u64 res_id)
@@ -355,7 +357,7 @@ static int mpt_mask(struct mlx4_dev *dev)
355 return dev->caps.num_mpts - 1; 357 return dev->caps.num_mpts - 1;
356} 358}
357 359
358static void *find_res(struct mlx4_dev *dev, int res_id, 360static void *find_res(struct mlx4_dev *dev, u64 res_id,
359 enum mlx4_resource type) 361 enum mlx4_resource type)
360{ 362{
361 struct mlx4_priv *priv = mlx4_priv(dev); 363 struct mlx4_priv *priv = mlx4_priv(dev);
@@ -447,6 +449,7 @@ static struct res_common *alloc_qp_tr(int id)
447 ret->local_qpn = id; 449 ret->local_qpn = id;
448 INIT_LIST_HEAD(&ret->mcg_list); 450 INIT_LIST_HEAD(&ret->mcg_list);
449 spin_lock_init(&ret->mcg_spl); 451 spin_lock_init(&ret->mcg_spl);
452 atomic_set(&ret->ref_count, 0);
450 453
451 return &ret->com; 454 return &ret->com;
452} 455}
@@ -554,7 +557,7 @@ static struct res_common *alloc_xrcdn_tr(int id)
554 return &ret->com; 557 return &ret->com;
555} 558}
556 559
557static struct res_common *alloc_fs_rule_tr(u64 id) 560static struct res_common *alloc_fs_rule_tr(u64 id, int qpn)
558{ 561{
559 struct res_fs_rule *ret; 562 struct res_fs_rule *ret;
560 563
@@ -564,7 +567,7 @@ static struct res_common *alloc_fs_rule_tr(u64 id)
564 567
565 ret->com.res_id = id; 568 ret->com.res_id = id;
566 ret->com.state = RES_FS_RULE_ALLOCATED; 569 ret->com.state = RES_FS_RULE_ALLOCATED;
567 570 ret->qpn = qpn;
568 return &ret->com; 571 return &ret->com;
569} 572}
570 573
@@ -602,7 +605,7 @@ static struct res_common *alloc_tr(u64 id, enum mlx4_resource type, int slave,
602 ret = alloc_xrcdn_tr(id); 605 ret = alloc_xrcdn_tr(id);
603 break; 606 break;
604 case RES_FS_RULE: 607 case RES_FS_RULE:
605 ret = alloc_fs_rule_tr(id); 608 ret = alloc_fs_rule_tr(id, extra);
606 break; 609 break;
607 default: 610 default:
608 return NULL; 611 return NULL;
@@ -671,10 +674,14 @@ undo:
671 674
672static int remove_qp_ok(struct res_qp *res) 675static int remove_qp_ok(struct res_qp *res)
673{ 676{
674 if (res->com.state == RES_QP_BUSY) 677 if (res->com.state == RES_QP_BUSY || atomic_read(&res->ref_count) ||
678 !list_empty(&res->mcg_list)) {
679 pr_err("resource tracker: fail to remove qp, state %d, ref_count %d\n",
680 res->com.state, atomic_read(&res->ref_count));
675 return -EBUSY; 681 return -EBUSY;
676 else if (res->com.state != RES_QP_RESERVED) 682 } else if (res->com.state != RES_QP_RESERVED) {
677 return -EPERM; 683 return -EPERM;
684 }
678 685
679 return 0; 686 return 0;
680} 687}
@@ -3124,6 +3131,7 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
3124 struct list_head *rlist = &tracker->slave_list[slave].res_list[RES_MAC]; 3131 struct list_head *rlist = &tracker->slave_list[slave].res_list[RES_MAC];
3125 int err; 3132 int err;
3126 int qpn; 3133 int qpn;
3134 struct res_qp *rqp;
3127 struct mlx4_net_trans_rule_hw_ctrl *ctrl; 3135 struct mlx4_net_trans_rule_hw_ctrl *ctrl;
3128 struct _rule_hw *rule_header; 3136 struct _rule_hw *rule_header;
3129 int header_id; 3137 int header_id;
@@ -3134,7 +3142,7 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
3134 3142
3135 ctrl = (struct mlx4_net_trans_rule_hw_ctrl *)inbox->buf; 3143 ctrl = (struct mlx4_net_trans_rule_hw_ctrl *)inbox->buf;
3136 qpn = be32_to_cpu(ctrl->qpn) & 0xffffff; 3144 qpn = be32_to_cpu(ctrl->qpn) & 0xffffff;
3137 err = get_res(dev, slave, qpn, RES_QP, NULL); 3145 err = get_res(dev, slave, qpn, RES_QP, &rqp);
3138 if (err) { 3146 if (err) {
3139 pr_err("Steering rule with qpn 0x%x rejected.\n", qpn); 3147 pr_err("Steering rule with qpn 0x%x rejected.\n", qpn);
3140 return err; 3148 return err;
@@ -3175,14 +3183,16 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
3175 if (err) 3183 if (err)
3176 goto err_put; 3184 goto err_put;
3177 3185
3178 err = add_res_range(dev, slave, vhcr->out_param, 1, RES_FS_RULE, 0); 3186 err = add_res_range(dev, slave, vhcr->out_param, 1, RES_FS_RULE, qpn);
3179 if (err) { 3187 if (err) {
3180 mlx4_err(dev, "Fail to add flow steering resources.\n "); 3188 mlx4_err(dev, "Fail to add flow steering resources.\n ");
3181 /* detach rule*/ 3189 /* detach rule*/
3182 mlx4_cmd(dev, vhcr->out_param, 0, 0, 3190 mlx4_cmd(dev, vhcr->out_param, 0, 0,
3183 MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A, 3191 MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A,
3184 MLX4_CMD_NATIVE); 3192 MLX4_CMD_NATIVE);
3193 goto err_put;
3185 } 3194 }
3195 atomic_inc(&rqp->ref_count);
3186err_put: 3196err_put:
3187 put_res(dev, slave, qpn, RES_QP); 3197 put_res(dev, slave, qpn, RES_QP);
3188 return err; 3198 return err;
@@ -3195,20 +3205,35 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave,
3195 struct mlx4_cmd_info *cmd) 3205 struct mlx4_cmd_info *cmd)
3196{ 3206{
3197 int err; 3207 int err;
3208 struct res_qp *rqp;
3209 struct res_fs_rule *rrule;
3198 3210
3199 if (dev->caps.steering_mode != 3211 if (dev->caps.steering_mode !=
3200 MLX4_STEERING_MODE_DEVICE_MANAGED) 3212 MLX4_STEERING_MODE_DEVICE_MANAGED)
3201 return -EOPNOTSUPP; 3213 return -EOPNOTSUPP;
3202 3214
3215 err = get_res(dev, slave, vhcr->in_param, RES_FS_RULE, &rrule);
3216 if (err)
3217 return err;
3218 /* Release the rule form busy state before removal */
3219 put_res(dev, slave, vhcr->in_param, RES_FS_RULE);
3220 err = get_res(dev, slave, rrule->qpn, RES_QP, &rqp);
3221 if (err)
3222 return err;
3223
3203 err = rem_res_range(dev, slave, vhcr->in_param, 1, RES_FS_RULE, 0); 3224 err = rem_res_range(dev, slave, vhcr->in_param, 1, RES_FS_RULE, 0);
3204 if (err) { 3225 if (err) {
3205 mlx4_err(dev, "Fail to remove flow steering resources.\n "); 3226 mlx4_err(dev, "Fail to remove flow steering resources.\n ");
3206 return err; 3227 goto out;
3207 } 3228 }
3208 3229
3209 err = mlx4_cmd(dev, vhcr->in_param, 0, 0, 3230 err = mlx4_cmd(dev, vhcr->in_param, 0, 0,
3210 MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A, 3231 MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A,
3211 MLX4_CMD_NATIVE); 3232 MLX4_CMD_NATIVE);
3233 if (!err)
3234 atomic_dec(&rqp->ref_count);
3235out:
3236 put_res(dev, slave, rrule->qpn, RES_QP);
3212 return err; 3237 return err;
3213} 3238}
3214 3239
@@ -3806,6 +3831,7 @@ void mlx4_delete_all_resources_for_slave(struct mlx4_dev *dev, int slave)
3806 mutex_lock(&priv->mfunc.master.res_tracker.slave_list[slave].mutex); 3831 mutex_lock(&priv->mfunc.master.res_tracker.slave_list[slave].mutex);
3807 /*VLAN*/ 3832 /*VLAN*/
3808 rem_slave_macs(dev, slave); 3833 rem_slave_macs(dev, slave);
3834 rem_slave_fs_rule(dev, slave);
3809 rem_slave_qps(dev, slave); 3835 rem_slave_qps(dev, slave);
3810 rem_slave_srqs(dev, slave); 3836 rem_slave_srqs(dev, slave);
3811 rem_slave_cqs(dev, slave); 3837 rem_slave_cqs(dev, slave);
@@ -3814,6 +3840,5 @@ void mlx4_delete_all_resources_for_slave(struct mlx4_dev *dev, int slave)
3814 rem_slave_mtts(dev, slave); 3840 rem_slave_mtts(dev, slave);
3815 rem_slave_counters(dev, slave); 3841 rem_slave_counters(dev, slave);
3816 rem_slave_xrcdns(dev, slave); 3842 rem_slave_xrcdns(dev, slave);
3817 rem_slave_fs_rule(dev, slave);
3818 mutex_unlock(&priv->mfunc.master.res_tracker.slave_list[slave].mutex); 3843 mutex_unlock(&priv->mfunc.master.res_tracker.slave_list[slave].mutex);
3819} 3844}
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index c4122c86f829..efa29b712d5f 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1472,7 +1472,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
1472 } 1472 }
1473 platform_set_drvdata(pdev, ndev); 1473 platform_set_drvdata(pdev, ndev);
1474 1474
1475 if (lpc_mii_init(pldat) != 0) 1475 ret = lpc_mii_init(pldat);
1476 if (ret)
1476 goto err_out_unregister_netdev; 1477 goto err_out_unregister_netdev;
1477 1478
1478 netdev_info(ndev, "LPC mac at 0x%08x irq %d\n", 1479 netdev_info(ndev, "LPC mac at 0x%08x irq %d\n",
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 39ab4d09faaa..73ce7dd6b954 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -1726,9 +1726,9 @@ pch_gbe_clean_rx(struct pch_gbe_adapter *adapter,
1726 1726
1727 skb->protocol = eth_type_trans(skb, netdev); 1727 skb->protocol = eth_type_trans(skb, netdev);
1728 if (tcp_ip_status & PCH_GBE_RXD_ACC_STAT_TCPIPOK) 1728 if (tcp_ip_status & PCH_GBE_RXD_ACC_STAT_TCPIPOK)
1729 skb->ip_summed = CHECKSUM_NONE;
1730 else
1731 skb->ip_summed = CHECKSUM_UNNECESSARY; 1729 skb->ip_summed = CHECKSUM_UNNECESSARY;
1730 else
1731 skb->ip_summed = CHECKSUM_NONE;
1732 1732
1733 napi_gro_receive(&adapter->napi, skb); 1733 napi_gro_receive(&adapter->napi, skb);
1734 (*work_done)++; 1734 (*work_done)++;
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 33e96176e4d8..bf5e3cf97c4d 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2220,6 +2220,7 @@ static void sh_eth_tsu_init(struct sh_eth_private *mdp)
2220/* MDIO bus release function */ 2220/* MDIO bus release function */
2221static int sh_mdio_release(struct net_device *ndev) 2221static int sh_mdio_release(struct net_device *ndev)
2222{ 2222{
2223 struct sh_eth_private *mdp = netdev_priv(ndev);
2223 struct mii_bus *bus = dev_get_drvdata(&ndev->dev); 2224 struct mii_bus *bus = dev_get_drvdata(&ndev->dev);
2224 2225
2225 /* unregister mdio bus */ 2226 /* unregister mdio bus */
@@ -2234,6 +2235,9 @@ static int sh_mdio_release(struct net_device *ndev)
2234 /* free bitbang info */ 2235 /* free bitbang info */
2235 free_mdio_bitbang(bus); 2236 free_mdio_bitbang(bus);
2236 2237
2238 /* free bitbang memory */
2239 kfree(mdp->bitbang);
2240
2237 return 0; 2241 return 0;
2238} 2242}
2239 2243
@@ -2262,6 +2266,7 @@ static int sh_mdio_init(struct net_device *ndev, int id,
2262 bitbang->ctrl.ops = &bb_ops; 2266 bitbang->ctrl.ops = &bb_ops;
2263 2267
2264 /* MII controller setting */ 2268 /* MII controller setting */
2269 mdp->bitbang = bitbang;
2265 mdp->mii_bus = alloc_mdio_bitbang(&bitbang->ctrl); 2270 mdp->mii_bus = alloc_mdio_bitbang(&bitbang->ctrl);
2266 if (!mdp->mii_bus) { 2271 if (!mdp->mii_bus) {
2267 ret = -ENOMEM; 2272 ret = -ENOMEM;
@@ -2441,6 +2446,11 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
2441 } 2446 }
2442 mdp->tsu_addr = ioremap(rtsu->start, 2447 mdp->tsu_addr = ioremap(rtsu->start,
2443 resource_size(rtsu)); 2448 resource_size(rtsu));
2449 if (mdp->tsu_addr == NULL) {
2450 ret = -ENOMEM;
2451 dev_err(&pdev->dev, "TSU ioremap failed.\n");
2452 goto out_release;
2453 }
2444 mdp->port = devno % 2; 2454 mdp->port = devno % 2;
2445 ndev->features = NETIF_F_HW_VLAN_FILTER; 2455 ndev->features = NETIF_F_HW_VLAN_FILTER;
2446 } 2456 }
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index bae84fd2e73a..e6655678458e 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -705,6 +705,7 @@ struct sh_eth_private {
705 const u16 *reg_offset; 705 const u16 *reg_offset;
706 void __iomem *addr; 706 void __iomem *addr;
707 void __iomem *tsu_addr; 707 void __iomem *tsu_addr;
708 struct bb_info *bitbang;
708 u32 num_rx_ring; 709 u32 num_rx_ring;
709 u32 num_tx_ring; 710 u32 num_tx_ring;
710 dma_addr_t rx_desc_dma; 711 dma_addr_t rx_desc_dma;
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c
index 0ad790cc473c..eaa8e874a3cb 100644
--- a/drivers/net/ethernet/sfc/nic.c
+++ b/drivers/net/ethernet/sfc/nic.c
@@ -376,7 +376,8 @@ efx_may_push_tx_desc(struct efx_tx_queue *tx_queue, unsigned int write_count)
376 return false; 376 return false;
377 377
378 tx_queue->empty_read_count = 0; 378 tx_queue->empty_read_count = 0;
379 return ((empty_read_count ^ write_count) & ~EFX_EMPTY_COUNT_VALID) == 0; 379 return ((empty_read_count ^ write_count) & ~EFX_EMPTY_COUNT_VALID) == 0
380 && tx_queue->write_count - write_count == 1;
380} 381}
381 382
382/* For each entry inserted into the software descriptor ring, create a 383/* For each entry inserted into the software descriptor ring, create a
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 01ffbc486982..df32a090d08e 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -905,7 +905,7 @@ static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb,
905 /* If there is no more tx desc left free then we need to 905 /* If there is no more tx desc left free then we need to
906 * tell the kernel to stop sending us tx frames. 906 * tell the kernel to stop sending us tx frames.
907 */ 907 */
908 if (unlikely(cpdma_check_free_tx_desc(priv->txch))) 908 if (unlikely(!cpdma_check_free_tx_desc(priv->txch)))
909 netif_stop_queue(ndev); 909 netif_stop_queue(ndev);
910 910
911 return NETDEV_TX_OK; 911 return NETDEV_TX_OK;
@@ -1364,7 +1364,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
1364 struct platform_device *mdio; 1364 struct platform_device *mdio;
1365 1365
1366 parp = of_get_property(slave_node, "phy_id", &lenp); 1366 parp = of_get_property(slave_node, "phy_id", &lenp);
1367 if ((parp == NULL) && (lenp != (sizeof(void *) * 2))) { 1367 if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) {
1368 pr_err("Missing slave[%d] phy_id property\n", i); 1368 pr_err("Missing slave[%d] phy_id property\n", i);
1369 ret = -EINVAL; 1369 ret = -EINVAL;
1370 goto error_ret; 1370 goto error_ret;
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 52c05366599a..ae1b77aa199f 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1102,7 +1102,7 @@ static int emac_dev_xmit(struct sk_buff *skb, struct net_device *ndev)
1102 /* If there is no more tx desc left free then we need to 1102 /* If there is no more tx desc left free then we need to
1103 * tell the kernel to stop sending us tx frames. 1103 * tell the kernel to stop sending us tx frames.
1104 */ 1104 */
1105 if (unlikely(cpdma_check_free_tx_desc(priv->txchan))) 1105 if (unlikely(!cpdma_check_free_tx_desc(priv->txchan)))
1106 netif_stop_queue(ndev); 1106 netif_stop_queue(ndev);
1107 1107
1108 return NETDEV_TX_OK; 1108 return NETDEV_TX_OK;