aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-22 11:28:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-22 11:28:16 -0400
commitf75b6f303bd80249a56cce9028954b4f731270e3 (patch)
tree3efcb909852964382b7b34fc4942a2eee0284a8c /drivers
parent86f9e56d08852961a1b9e062d59b71491d8c793a (diff)
parentad70411a978d1e6e97b1e341a7bde9a79af0c93d (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Clear up some recent tipc regressions because of registration ordering. Fix from Junwei Hu. 2) tipc's TLV_SET() can read past the end of the supplied buffer during the copy. From Chris Packham. 3) ptp example program doesn't match the kernel, from Richard Cochran. 4) Outgoing message type fix in qrtr, from Bjorn Andersson. 5) Flow control regression in stmmac, from Tan Tee Min. 6) Fix inband autonegotiation in phylink, from Russell King. 7) Fix sk_bound_dev_if handling in rawv6_bind(), from Mike Manning. 8) Fix usbnet crash after disconnect, from Kloetzke Jan. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (21 commits) usbnet: fix kernel crash after disconnect selftests: fib_rule_tests: use pre-defined DEV_ADDR net-next: net: Fix typos in ip-sysctl.txt ipv6: Consider sk_bound_dev_if when binding a raw socket to an address net: phylink: ensure inband AN works correctly usbnet: ipheth: fix racing condition net: stmmac: dma channel control register need to be init first net: stmmac: fix ethtool flow control not able to get/set net: qrtr: Fix message type of outgoing packets networking: : fix typos in code comments ptp: Fix example program to match kernel. fddi: fix typos in code comments selftests: fib_rule_tests: enable forwarding before ipv4 from/iif test selftests: fib_rule_tests: fix local IPv4 address typo tipc: Avoid copying bytes beyond the supplied data 2/2] net: xilinx_emaclite: use readx_poll_timeout() in mdio wait function 1/2] net: axienet: use readx_poll_timeout() in mdio wait function vlan: Mark expected switch fall-through macvlan: Mark expected switch fall-through net/mlx4_en: ethtool, Remove unsupported SFP EEPROM high pages query ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_ethtool.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/port.c5
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c4
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c8
-rw-r--r--drivers/net/ethernet/xilinx/xilinx_axienet.h5
-rw-r--r--drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c16
-rw-r--r--drivers/net/ethernet/xilinx/xilinx_emaclite.c16
-rw-r--r--drivers/net/fddi/skfp/hwmtm.c4
-rw-r--r--drivers/net/macvlan.c1
-rw-r--r--drivers/net/phy/phylink.c37
-rw-r--r--drivers/net/usb/ipheth.c3
-rw-r--r--drivers/net/usb/usbnet.c6
12 files changed, 52 insertions, 57 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index d290f0787dfb..94c59939a8cf 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -2010,6 +2010,8 @@ static int mlx4_en_set_tunable(struct net_device *dev,
2010 return ret; 2010 return ret;
2011} 2011}
2012 2012
2013#define MLX4_EEPROM_PAGE_LEN 256
2014
2013static int mlx4_en_get_module_info(struct net_device *dev, 2015static int mlx4_en_get_module_info(struct net_device *dev,
2014 struct ethtool_modinfo *modinfo) 2016 struct ethtool_modinfo *modinfo)
2015{ 2017{
@@ -2044,7 +2046,7 @@ static int mlx4_en_get_module_info(struct net_device *dev,
2044 break; 2046 break;
2045 case MLX4_MODULE_ID_SFP: 2047 case MLX4_MODULE_ID_SFP:
2046 modinfo->type = ETH_MODULE_SFF_8472; 2048 modinfo->type = ETH_MODULE_SFF_8472;
2047 modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN; 2049 modinfo->eeprom_len = MLX4_EEPROM_PAGE_LEN;
2048 break; 2050 break;
2049 default: 2051 default:
2050 return -EINVAL; 2052 return -EINVAL;
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index 10fcc22f4590..ba6ac31a339d 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -2077,11 +2077,6 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port,
2077 size -= offset + size - I2C_PAGE_SIZE; 2077 size -= offset + size - I2C_PAGE_SIZE;
2078 2078
2079 i2c_addr = I2C_ADDR_LOW; 2079 i2c_addr = I2C_ADDR_LOW;
2080 if (offset >= I2C_PAGE_SIZE) {
2081 /* Reset offset to high page */
2082 i2c_addr = I2C_ADDR_HIGH;
2083 offset -= I2C_PAGE_SIZE;
2084 }
2085 2080
2086 cable_info = (struct mlx4_cable_info *)inmad->data; 2081 cable_info = (struct mlx4_cable_info *)inmad->data;
2087 cable_info->dev_mem_address = cpu_to_be16(offset); 2082 cable_info->dev_mem_address = cpu_to_be16(offset);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index 3c749c327cbd..e09522c5509a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -460,7 +460,7 @@ stmmac_get_pauseparam(struct net_device *netdev,
460 } else { 460 } else {
461 if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT, 461 if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
462 netdev->phydev->supported) || 462 netdev->phydev->supported) ||
463 linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, 463 !linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
464 netdev->phydev->supported)) 464 netdev->phydev->supported))
465 return; 465 return;
466 } 466 }
@@ -491,7 +491,7 @@ stmmac_set_pauseparam(struct net_device *netdev,
491 } else { 491 } else {
492 if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT, 492 if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
493 phy->supported) || 493 phy->supported) ||
494 linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, 494 !linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
495 phy->supported)) 495 phy->supported))
496 return -EOPNOTSUPP; 496 return -EOPNOTSUPP;
497 } 497 }
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 5678b869cbff..2a1052704885 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2208,6 +2208,10 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
2208 if (priv->plat->axi) 2208 if (priv->plat->axi)
2209 stmmac_axi(priv, priv->ioaddr, priv->plat->axi); 2209 stmmac_axi(priv, priv->ioaddr, priv->plat->axi);
2210 2210
2211 /* DMA CSR Channel configuration */
2212 for (chan = 0; chan < dma_csr_ch; chan++)
2213 stmmac_init_chan(priv, priv->ioaddr, priv->plat->dma_cfg, chan);
2214
2211 /* DMA RX Channel Configuration */ 2215 /* DMA RX Channel Configuration */
2212 for (chan = 0; chan < rx_channels_count; chan++) { 2216 for (chan = 0; chan < rx_channels_count; chan++) {
2213 rx_q = &priv->rx_queue[chan]; 2217 rx_q = &priv->rx_queue[chan];
@@ -2233,10 +2237,6 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
2233 tx_q->tx_tail_addr, chan); 2237 tx_q->tx_tail_addr, chan);
2234 } 2238 }
2235 2239
2236 /* DMA CSR Channel configuration */
2237 for (chan = 0; chan < dma_csr_ch; chan++)
2238 stmmac_init_chan(priv, priv->ioaddr, priv->plat->dma_cfg, chan);
2239
2240 return ret; 2240 return ret;
2241} 2241}
2242 2242
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h
index c337400485da..011adae32b89 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet.h
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h
@@ -484,6 +484,11 @@ static inline u32 axienet_ior(struct axienet_local *lp, off_t offset)
484 return in_be32(lp->regs + offset); 484 return in_be32(lp->regs + offset);
485} 485}
486 486
487static inline u32 axinet_ior_read_mcr(struct axienet_local *lp)
488{
489 return axienet_ior(lp, XAE_MDIO_MCR_OFFSET);
490}
491
487/** 492/**
488 * axienet_iow - Memory mapped Axi Ethernet register write 493 * axienet_iow - Memory mapped Axi Ethernet register write
489 * @lp: Pointer to axienet local structure 494 * @lp: Pointer to axienet local structure
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c
index 757a3b37ae8a..704babdbc8a2 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c
@@ -11,6 +11,7 @@
11#include <linux/of_address.h> 11#include <linux/of_address.h>
12#include <linux/of_mdio.h> 12#include <linux/of_mdio.h>
13#include <linux/jiffies.h> 13#include <linux/jiffies.h>
14#include <linux/iopoll.h>
14 15
15#include "xilinx_axienet.h" 16#include "xilinx_axienet.h"
16 17
@@ -20,16 +21,11 @@
20/* Wait till MDIO interface is ready to accept a new transaction.*/ 21/* Wait till MDIO interface is ready to accept a new transaction.*/
21int axienet_mdio_wait_until_ready(struct axienet_local *lp) 22int axienet_mdio_wait_until_ready(struct axienet_local *lp)
22{ 23{
23 unsigned long end = jiffies + 2; 24 u32 val;
24 while (!(axienet_ior(lp, XAE_MDIO_MCR_OFFSET) & 25
25 XAE_MDIO_MCR_READY_MASK)) { 26 return readx_poll_timeout(axinet_ior_read_mcr, lp,
26 if (time_before_eq(end, jiffies)) { 27 val, val & XAE_MDIO_MCR_READY_MASK,
27 WARN_ON(1); 28 1, 20000);
28 return -ETIMEDOUT;
29 }
30 udelay(1);
31 }
32 return 0;
33} 29}
34 30
35/** 31/**
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 6886270da695..c409bab63bd3 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -27,6 +27,7 @@
27#include <linux/of_net.h> 27#include <linux/of_net.h>
28#include <linux/phy.h> 28#include <linux/phy.h>
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30#include <linux/iopoll.h>
30 31
31#define DRIVER_NAME "xilinx_emaclite" 32#define DRIVER_NAME "xilinx_emaclite"
32 33
@@ -714,20 +715,15 @@ static irqreturn_t xemaclite_interrupt(int irq, void *dev_id)
714 715
715static int xemaclite_mdio_wait(struct net_local *lp) 716static int xemaclite_mdio_wait(struct net_local *lp)
716{ 717{
717 unsigned long end = jiffies + 2; 718 u32 val;
718 719
719 /* wait for the MDIO interface to not be busy or timeout 720 /* wait for the MDIO interface to not be busy or timeout
720 * after some time. 721 * after some time.
721 */ 722 */
722 while (xemaclite_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET) & 723 return readx_poll_timeout(xemaclite_readl,
723 XEL_MDIOCTRL_MDIOSTS_MASK) { 724 lp->base_addr + XEL_MDIOCTRL_OFFSET,
724 if (time_before_eq(end, jiffies)) { 725 val, !(val & XEL_MDIOCTRL_MDIOSTS_MASK),
725 WARN_ON(1); 726 1000, 20000);
726 return -ETIMEDOUT;
727 }
728 msleep(1);
729 }
730 return 0;
731} 727}
732 728
733/** 729/**
diff --git a/drivers/net/fddi/skfp/hwmtm.c b/drivers/net/fddi/skfp/hwmtm.c
index abbe309051d9..3d0f417e8586 100644
--- a/drivers/net/fddi/skfp/hwmtm.c
+++ b/drivers/net/fddi/skfp/hwmtm.c
@@ -1206,7 +1206,7 @@ void process_receive(struct s_smc *smc)
1206 } 1206 }
1207 /* 1207 /*
1208 * SUPERNET 3 Bug: FORMAC delivers status words 1208 * SUPERNET 3 Bug: FORMAC delivers status words
1209 * of aborded frames to the BMU 1209 * of aborted frames to the BMU
1210 */ 1210 */
1211 if (len <= 4) { 1211 if (len <= 4) {
1212 DB_RX(2, "Frame length = 0"); 1212 DB_RX(2, "Frame length = 0");
@@ -1343,7 +1343,7 @@ void process_receive(struct s_smc *smc)
1343 break ; 1343 break ;
1344 default : 1344 default :
1345 /* 1345 /*
1346 * unknown FC abord the frame 1346 * unknown FC abort the frame
1347 */ 1347 */
1348 DB_RX(2, "unknown FC error"); 1348 DB_RX(2, "unknown FC error");
1349 smt_free_mbuf(smc,mb) ; 1349 smt_free_mbuf(smc,mb) ;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 92efa93649f0..61550122b563 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -838,6 +838,7 @@ static int macvlan_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
838 case SIOCSHWTSTAMP: 838 case SIOCSHWTSTAMP:
839 if (!net_eq(dev_net(dev), &init_net)) 839 if (!net_eq(dev_net(dev), &init_net))
840 break; 840 break;
841 /* fall through */
841 case SIOCGHWTSTAMP: 842 case SIOCGHWTSTAMP:
842 if (netif_device_present(real_dev) && ops->ndo_do_ioctl) 843 if (netif_device_present(real_dev) && ops->ndo_do_ioctl)
843 err = ops->ndo_do_ioctl(real_dev, &ifrr, cmd); 844 err = ops->ndo_do_ioctl(real_dev, &ifrr, cmd);
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 89750c7dfd6f..74983593834b 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -422,28 +422,21 @@ static void phylink_resolve(struct work_struct *w)
422 422
423 case MLO_AN_INBAND: 423 case MLO_AN_INBAND:
424 phylink_get_mac_state(pl, &link_state); 424 phylink_get_mac_state(pl, &link_state);
425 if (pl->phydev) { 425
426 bool changed = false; 426 /* If we have a phy, the "up" state is the union of
427 427 * both the PHY and the MAC */
428 link_state.link = link_state.link && 428 if (pl->phydev)
429 pl->phy_state.link; 429 link_state.link &= pl->phy_state.link;
430 430
431 if (pl->phy_state.interface != 431 /* Only update if the PHY link is up */
432 link_state.interface) { 432 if (pl->phydev && pl->phy_state.link) {
433 link_state.interface = pl->phy_state.interface; 433 link_state.interface = pl->phy_state.interface;
434 changed = true; 434
435 } 435 /* If we have a PHY, we need to update with
436 436 * the pause mode bits. */
437 /* Propagate the flow control from the PHY 437 link_state.pause |= pl->phy_state.pause;
438 * to the MAC. Also propagate the interface 438 phylink_resolve_flow(pl, &link_state);
439 * if changed. 439 phylink_mac_config(pl, &link_state);
440 */
441 if (pl->phy_state.link || changed) {
442 link_state.pause |= pl->phy_state.pause;
443 phylink_resolve_flow(pl, &link_state);
444
445 phylink_mac_config(pl, &link_state);
446 }
447 } 440 }
448 break; 441 break;
449 } 442 }
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index c247aed2dceb..8c01fbf68a89 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -383,17 +383,18 @@ static int ipheth_tx(struct sk_buff *skb, struct net_device *net)
383 dev); 383 dev);
384 dev->tx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 384 dev->tx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
385 385
386 netif_stop_queue(net);
386 retval = usb_submit_urb(dev->tx_urb, GFP_ATOMIC); 387 retval = usb_submit_urb(dev->tx_urb, GFP_ATOMIC);
387 if (retval) { 388 if (retval) {
388 dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n", 389 dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n",
389 __func__, retval); 390 __func__, retval);
390 dev->net->stats.tx_errors++; 391 dev->net->stats.tx_errors++;
391 dev_kfree_skb_any(skb); 392 dev_kfree_skb_any(skb);
393 netif_wake_queue(net);
392 } else { 394 } else {
393 dev->net->stats.tx_packets++; 395 dev->net->stats.tx_packets++;
394 dev->net->stats.tx_bytes += skb->len; 396 dev->net->stats.tx_bytes += skb->len;
395 dev_consume_skb_any(skb); 397 dev_consume_skb_any(skb);
396 netif_stop_queue(net);
397 } 398 }
398 399
399 return NETDEV_TX_OK; 400 return NETDEV_TX_OK;
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 66f0e0f51711..72514c46b478 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -494,6 +494,7 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
494 494
495 if (netif_running (dev->net) && 495 if (netif_running (dev->net) &&
496 netif_device_present (dev->net) && 496 netif_device_present (dev->net) &&
497 test_bit(EVENT_DEV_OPEN, &dev->flags) &&
497 !test_bit (EVENT_RX_HALT, &dev->flags) && 498 !test_bit (EVENT_RX_HALT, &dev->flags) &&
498 !test_bit (EVENT_DEV_ASLEEP, &dev->flags)) { 499 !test_bit (EVENT_DEV_ASLEEP, &dev->flags)) {
499 switch (retval = usb_submit_urb (urb, GFP_ATOMIC)) { 500 switch (retval = usb_submit_urb (urb, GFP_ATOMIC)) {
@@ -1419,6 +1420,11 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
1419 spin_unlock_irqrestore(&dev->txq.lock, flags); 1420 spin_unlock_irqrestore(&dev->txq.lock, flags);
1420 goto drop; 1421 goto drop;
1421 } 1422 }
1423 if (netif_queue_stopped(net)) {
1424 usb_autopm_put_interface_async(dev->intf);
1425 spin_unlock_irqrestore(&dev->txq.lock, flags);
1426 goto drop;
1427 }
1422 1428
1423#ifdef CONFIG_PM 1429#ifdef CONFIG_PM
1424 /* if this triggers the device is still a sleep */ 1430 /* if this triggers the device is still a sleep */