Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Browse files Browse the repository at this point in the history
Pull networking fixes from David Miller:

 1) Don't get per-cpu pointer with preemption enabled in nft_set_pipapo,
    fix from Stefano Brivio.

 2) Fix memory leak in ctnetlink, from Pablo Neira Ayuso.

 3) Multiple definitions of MPTCP_PM_MAX_ADDR, from Geliang Tang.

 4) Accidently disabling NAPI in non-error paths of macb_open(), from
    Charles Keepax.

 5) Fix races between alx_stop and alx_remove, from Zekun Shen.

 6) We forget to re-enable SRIOV during resume in bnxt_en driver, from
    Michael Chan.

 7) Fix memory leak in ipv6_mc_destroy_dev(), from Wang Hai.

 8) rxtx stats use wrong index in mvpp2 driver, from Sven Auhagen.

 9) Fix memory leak in mptcp_subflow_create_socket error path, from Wei
    Yongjun.

10) We should not adjust the TCP window advertised when sending dup acks
    in non-SACK mode, because it won't be counted as a dup by the sender
    if the window size changes. From Eric Dumazet.

11) Destroy the right number of queues during remove in mvpp2 driver,
    from Sven Auhagen.

12) Various WOL and PM fixes to e1000 driver, from Chen Yu, Vaibhav
    Gupta, and Arnd Bergmann.

* git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (35 commits)
  e1000e: fix unused-function warning
  e1000: use generic power management
  e1000e: Do not wake up the system via WOL if device wakeup is disabled
  lan743x: add MODULE_DEVICE_TABLE for module loading alias
  mlxsw: spectrum: Adjust headroom buffers for 8x ports
  bareudp: Fixed configuration to avoid having garbage values
  mvpp2: remove module bugfix
  tcp: grow window for OOO packets only for SACK flows
  mptcp: fix memory leak in mptcp_subflow_create_socket()
  netfilter: flowtable: Make nf_flow_table_offload_add/del_cb inline
  net/sched: act_ct: Make tcf_ct_flow_table_restore_skb inline
  net: dsa: sja1105: fix PTP timestamping with large tc-taprio cycles
  mvpp2: ethtool rxtx stats fix
  MAINTAINERS: switch to my private email for Renesas Ethernet drivers
  rocker: fix incorrect error handling in dma_rings_init
  test_objagg: Fix potential memory leak in error handling
  net: ethernet: mtk-star-emac: simplify interrupt handling
  mld: fix memory leak in ipv6_mc_destroy_dev()
  bnxt_en: Return from timer if interface is not in open state.
  bnxt_en: Fix AER reset logic on 57500 chips.
  ...
  • Loading branch information
Linus Torvalds committed Jun 17, 2020
2 parents 26c20ff + c9f66b4 commit 6911967
Show file tree
Hide file tree
Showing 33 changed files with 309 additions and 314 deletions.
30 changes: 13 additions & 17 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -11369,14 +11369,6 @@ L: dmaengine@vger.kernel.org
S: Supported
F: drivers/dma/at_xdmac.c

MICROSEMI ETHERNET SWITCH DRIVER
M: Alexandre Belloni <alexandre.belloni@bootlin.com>
M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
L: netdev@vger.kernel.org
S: Supported
F: drivers/net/ethernet/mscc/
F: include/soc/mscc/ocelot*

MICROSEMI MIPS SOCS
M: Alexandre Belloni <alexandre.belloni@bootlin.com>
M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
Expand Down Expand Up @@ -12335,6 +12327,18 @@ M: Peter Zijlstra <peterz@infradead.org>
S: Supported
F: tools/objtool/

OCELOT ETHERNET SWITCH DRIVER
M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
M: Vladimir Oltean <vladimir.oltean@nxp.com>
M: Claudiu Manoil <claudiu.manoil@nxp.com>
M: Alexandre Belloni <alexandre.belloni@bootlin.com>
L: netdev@vger.kernel.org
S: Supported
F: drivers/net/dsa/ocelot/*
F: drivers/net/ethernet/mscc/
F: include/soc/mscc/ocelot*
F: net/dsa/tag_ocelot.c

OCXL (Open Coherent Accelerator Processor Interface OpenCAPI) DRIVER
M: Frederic Barrat <fbarrat@linux.ibm.com>
M: Andrew Donnellan <ajd@linux.ibm.com>
Expand Down Expand Up @@ -14534,7 +14538,7 @@ F: Documentation/devicetree/bindings/i2c/renesas,iic-emev2.txt
F: drivers/i2c/busses/i2c-emev2.c

RENESAS ETHERNET DRIVERS
R: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
R: Sergei Shtylyov <sergei.shtylyov@gmail.com>
L: netdev@vger.kernel.org
L: linux-renesas-soc@vger.kernel.org
F: Documentation/devicetree/bindings/net/renesas,*.txt
Expand Down Expand Up @@ -18254,14 +18258,6 @@ S: Maintained
F: drivers/input/serio/userio.c
F: include/uapi/linux/userio.h

VITESSE FELIX ETHERNET SWITCH DRIVER
M: Vladimir Oltean <vladimir.oltean@nxp.com>
M: Claudiu Manoil <claudiu.manoil@nxp.com>
L: netdev@vger.kernel.org
S: Maintained
F: drivers/net/dsa/ocelot/*
F: net/dsa/tag_ocelot.c

VIVID VIRTUAL VIDEO DRIVER
M: Hans Verkuil <hverkuil@xs4all.nl>
L: linux-media@vger.kernel.org
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/bareudp.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@ static int bareudp_validate(struct nlattr *tb[], struct nlattr *data[],
static int bareudp2info(struct nlattr *data[], struct bareudp_conf *conf,
struct netlink_ext_ack *extack)
{
memset(conf, 0, sizeof(*conf));

if (!data[IFLA_BAREUDP_PORT]) {
NL_SET_ERR_MSG(extack, "port not specified");
return -EINVAL;
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/dsa/sja1105/sja1105_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,16 +891,16 @@ void sja1105_ptp_txtstamp_skb(struct dsa_switch *ds, int port,

mutex_lock(&ptp_data->lock);

rc = sja1105_ptpclkval_read(priv, &ticks, NULL);
rc = sja1105_ptpegr_ts_poll(ds, port, &ts);
if (rc < 0) {
dev_err(ds->dev, "Failed to read PTP clock: %d\n", rc);
dev_err(ds->dev, "timed out polling for tstamp\n");
kfree_skb(skb);
goto out;
}

rc = sja1105_ptpegr_ts_poll(ds, port, &ts);
rc = sja1105_ptpclkval_read(priv, &ticks, NULL);
if (rc < 0) {
dev_err(ds->dev, "timed out polling for tstamp\n");
dev_err(ds->dev, "Failed to read PTP clock: %d\n", rc);
kfree_skb(skb);
goto out;
}
Expand Down
9 changes: 5 additions & 4 deletions drivers/net/ethernet/atheros/alx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,8 +1249,12 @@ static int __alx_open(struct alx_priv *alx, bool resume)

static void __alx_stop(struct alx_priv *alx)
{
alx_halt(alx);
alx_free_irq(alx);

cancel_work_sync(&alx->link_check_wk);
cancel_work_sync(&alx->reset_wk);

alx_halt(alx);
alx_free_rings(alx);
alx_free_napis(alx);
}
Expand Down Expand Up @@ -1855,9 +1859,6 @@ static void alx_remove(struct pci_dev *pdev)
struct alx_priv *alx = pci_get_drvdata(pdev);
struct alx_hw *hw = &alx->hw;

cancel_work_sync(&alx->link_check_wk);
cancel_work_sync(&alx->reset_wk);

/* restore permanent mac address */
alx_set_macaddr(hw, hw->perm_addr);

Expand Down
35 changes: 17 additions & 18 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -10037,7 +10037,7 @@ static void bnxt_timer(struct timer_list *t)
struct bnxt *bp = from_timer(bp, t, timer);
struct net_device *dev = bp->dev;

if (!netif_running(dev))
if (!netif_running(dev) || !test_bit(BNXT_STATE_OPEN, &bp->state))
return;

if (atomic_read(&bp->intr_sem) != 0)
Expand Down Expand Up @@ -12133,19 +12133,9 @@ static int bnxt_resume(struct device *device)
goto resume_exit;
}

if (bnxt_hwrm_queue_qportcfg(bp)) {
rc = -ENODEV;
rc = bnxt_hwrm_func_qcaps(bp);
if (rc)
goto resume_exit;
}

if (bp->hwrm_spec_code >= 0x10803) {
if (bnxt_alloc_ctx_mem(bp)) {
rc = -ENODEV;
goto resume_exit;
}
}
if (BNXT_NEW_RM(bp))
bnxt_hwrm_func_resc_qcaps(bp, false);

if (bnxt_hwrm_func_drv_rgtr(bp, NULL, 0, false)) {
rc = -ENODEV;
Expand All @@ -12161,6 +12151,8 @@ static int bnxt_resume(struct device *device)

resume_exit:
bnxt_ulp_start(bp, rc);
if (!rc)
bnxt_reenable_sriov(bp);
rtnl_unlock();
return rc;
}
Expand Down Expand Up @@ -12204,6 +12196,9 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev,
bnxt_close(netdev);

pci_disable_device(pdev);
bnxt_free_ctx_mem(bp);
kfree(bp->ctx);
bp->ctx = NULL;
rtnl_unlock();

/* Request a slot slot reset. */
Expand Down Expand Up @@ -12237,12 +12232,16 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
pci_set_master(pdev);

err = bnxt_hwrm_func_reset(bp);
if (!err && netif_running(netdev))
err = bnxt_open(netdev);

if (!err)
result = PCI_ERS_RESULT_RECOVERED;
if (!err) {
err = bnxt_hwrm_func_qcaps(bp);
if (!err && netif_running(netdev))
err = bnxt_open(netdev);
}
bnxt_ulp_start(bp, err);
if (!err) {
bnxt_reenable_sriov(bp);
result = PCI_ERS_RESULT_RECOVERED;
}
}

if (result != PCI_ERS_RESULT_RECOVERED) {
Expand Down
9 changes: 4 additions & 5 deletions drivers/net/ethernet/cadence/macb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2565,15 +2565,14 @@ static int macb_open(struct net_device *dev)
if (bp->ptp_info)
bp->ptp_info->ptp_init(dev);

return 0;

napi_exit:
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
napi_disable(&queue->napi);
pm_exit:
if (err) {
pm_runtime_put_sync(&bp->pdev->dev);
return err;
}
return 0;
pm_runtime_put_sync(&bp->pdev->dev);
return err;
}

static int macb_close(struct net_device *dev)
Expand Down
21 changes: 17 additions & 4 deletions drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,12 +842,13 @@ static int ibmvnic_login(struct net_device *netdev)
struct ibmvnic_adapter *adapter = netdev_priv(netdev);
unsigned long timeout = msecs_to_jiffies(30000);
int retry_count = 0;
int retries = 10;
bool retry;
int rc;

do {
retry = false;
if (retry_count > IBMVNIC_MAX_QUEUES) {
if (retry_count > retries) {
netdev_warn(netdev, "Login attempts exceeded\n");
return -1;
}
Expand All @@ -862,11 +863,23 @@ static int ibmvnic_login(struct net_device *netdev)

if (!wait_for_completion_timeout(&adapter->init_done,
timeout)) {
netdev_warn(netdev, "Login timed out\n");
return -1;
netdev_warn(netdev, "Login timed out, retrying...\n");
retry = true;
adapter->init_done_rc = 0;
retry_count++;
continue;
}

if (adapter->init_done_rc == PARTIALSUCCESS) {
if (adapter->init_done_rc == ABORTED) {
netdev_warn(netdev, "Login aborted, retrying...\n");
retry = true;
adapter->init_done_rc = 0;
retry_count++;
/* FW or device may be busy, so
* wait a bit before retrying login
*/
msleep(500);
} else if (adapter->init_done_rc == PARTIALSUCCESS) {
retry_count++;
release_sub_crqs(adapter, 1);

Expand Down
49 changes: 13 additions & 36 deletions drivers/net/ethernet/intel/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,8 @@ static int e1000_vlan_rx_kill_vid(struct net_device *netdev,
__be16 proto, u16 vid);
static void e1000_restore_vlan(struct e1000_adapter *adapter);

#ifdef CONFIG_PM
static int e1000_suspend(struct pci_dev *pdev, pm_message_t state);
static int e1000_resume(struct pci_dev *pdev);
#endif
static int __maybe_unused e1000_suspend(struct device *dev);
static int __maybe_unused e1000_resume(struct device *dev);
static void e1000_shutdown(struct pci_dev *pdev);

#ifdef CONFIG_NET_POLL_CONTROLLER
Expand All @@ -179,16 +177,16 @@ static const struct pci_error_handlers e1000_err_handler = {
.resume = e1000_io_resume,
};

static SIMPLE_DEV_PM_OPS(e1000_pm_ops, e1000_suspend, e1000_resume);

static struct pci_driver e1000_driver = {
.name = e1000_driver_name,
.id_table = e1000_pci_tbl,
.probe = e1000_probe,
.remove = e1000_remove,
#ifdef CONFIG_PM
/* Power Management Hooks */
.suspend = e1000_suspend,
.resume = e1000_resume,
#endif
.driver = {
.pm = &e1000_pm_ops,
},
.shutdown = e1000_shutdown,
.err_handler = &e1000_err_handler
};
Expand Down Expand Up @@ -5060,9 +5058,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
struct e1000_hw *hw = &adapter->hw;
u32 ctrl, ctrl_ext, rctl, status;
u32 wufc = adapter->wol;
#ifdef CONFIG_PM
int retval = 0;
#endif

netif_device_detach(netdev);

Expand All @@ -5076,12 +5071,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
e1000_down(adapter);
}

#ifdef CONFIG_PM
retval = pci_save_state(pdev);
if (retval)
return retval;
#endif

status = er32(STATUS);
if (status & E1000_STATUS_LU)
wufc &= ~E1000_WUFC_LNKC;
Expand Down Expand Up @@ -5142,37 +5131,26 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
return 0;
}

#ifdef CONFIG_PM
static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
static int __maybe_unused e1000_suspend(struct device *dev)
{
int retval;
struct pci_dev *pdev = to_pci_dev(dev);
bool wake;

retval = __e1000_shutdown(pdev, &wake);
if (retval)
return retval;

if (wake) {
pci_prepare_to_sleep(pdev);
} else {
pci_wake_from_d3(pdev, false);
pci_set_power_state(pdev, PCI_D3hot);
}
device_set_wakeup_enable(dev, wake);

return 0;
return retval;
}

static int e1000_resume(struct pci_dev *pdev)
static int __maybe_unused e1000_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
u32 err;

pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
pci_save_state(pdev);

if (adapter->need_ioport)
err = pci_enable_device(pdev);
else
Expand Down Expand Up @@ -5209,7 +5187,6 @@ static int e1000_resume(struct pci_dev *pdev)

return 0;
}
#endif

static void e1000_shutdown(struct pci_dev *pdev)
{
Expand Down
Loading

0 comments on commit 6911967

Please sign in to comment.