This is a note to let you know that I've just added the patch titled sfc: Detach net device when stopping queues for reconfiguration to the 3.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: sfc-detach-net-device-when-stopping-queues-for-reconfiguration.patch and it can be found in the queue-3.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 0013c4ed507a351c4f5d26afc5bf0fb3e11528aa Mon Sep 17 00:00:00 2001 From: Ben Hutchings <bhutchings@xxxxxxxxxxxxxx> Date: Mon, 28 Jan 2013 19:01:06 +0000 Subject: sfc: Detach net device when stopping queues for reconfiguration From: Ben Hutchings <bhutchings@xxxxxxxxxxxxxx> [ Upstream commit 29c69a4882641285a854d6d03ca5adbba68c0034 ] We must only ever stop TX queues when they are full or the net device is not 'ready' so far as the net core, and specifically the watchdog, is concerned. Otherwise, the watchdog may fire *immediately* if no packets have been added to the queue in the last 5 seconds. The device is ready if all the following are true: (a) It has a qdisc (b) It is marked present (c) It is running (d) The link is reported up (a) and (c) are normally true, and must not be changed by a driver. (d) is under our control, but fake link changes may disturb userland. This leaves (b). We already mark the device absent during reset and self-test, but we need to do the same during MTU changes and ring reallocation. We don't need to do this when the device is brought down because then (c) is already false. Signed-off-by: Ben Hutchings <bhutchings@xxxxxxxxxxxxxx> [bwh: Backported to 3.0: adjust context] Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/sfc/efx.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c @@ -720,6 +720,7 @@ efx_realloc_channels(struct efx_nic *efx unsigned i; int rc; + efx_device_detach_sync(efx); efx_stop_all(efx); efx_fini_channels(efx); @@ -763,6 +764,7 @@ out: efx_init_channels(efx); efx_start_all(efx); + netif_device_attach(efx->net_dev); return rc; rollback: @@ -1530,8 +1532,12 @@ static void efx_stop_all(struct efx_nic /* Flush efx_mac_work(), refill_workqueue, monitor_work */ efx_flush_all(efx); - /* Stop the kernel transmit interface late, so the watchdog - * timer isn't ticking over the flush */ + /* Stop the kernel transmit interface. This is only valid if + * the device is stopped or detached; otherwise the watchdog + * may fire immediately. + */ + WARN_ON(netif_running(efx->net_dev) && + netif_device_present(efx->net_dev)); if (efx_dev_registered(efx)) { netif_tx_stop_all_queues(efx->net_dev); netif_tx_lock_bh(efx->net_dev); @@ -1801,10 +1807,11 @@ static int efx_change_mtu(struct net_dev if (new_mtu > EFX_MAX_MTU) return -EINVAL; - efx_stop_all(efx); - netif_dbg(efx, drv, efx->net_dev, "changing MTU to %d\n", new_mtu); + efx_device_detach_sync(efx); + efx_stop_all(efx); + efx_fini_channels(efx); mutex_lock(&efx->mac_lock); @@ -1817,6 +1824,7 @@ static int efx_change_mtu(struct net_dev efx_init_channels(efx); efx_start_all(efx); + netif_device_attach(efx->net_dev); return rc; } Patches currently in stable-queue which might be from bhutchings@xxxxxxxxxxxxxx are queue-3.0/sfc-fix-siena-mac-statistics-on-big-endian-platforms.patch queue-3.0/sfc-do-not-attempt-to-flush-queues-if-dma-is-disabled.patch queue-3.0/sfc-fix-two-causes-of-flush-failure.patch queue-3.0/sfc-properly-sync-rx-dma-buffer-when-it-is-not-the-last-in-the-page.patch queue-3.0/sfc-only-use-tx-push-if-a-single-descriptor-is-to-be-written.patch queue-3.0/sfc-fix-efx_rx_buf_offset-in-the-presence-of-swiotlb.patch queue-3.0/sfc-lock-tx-queues-when-calling-netif_device_detach.patch queue-3.0/sfc-convert-firmware-subtypes-to-native-byte-order-in-efx_mcdi_get_board_cfg.patch queue-3.0/sfc-fix-timekeeping-in-efx_mcdi_poll.patch queue-3.0/sfc-disable-soft-interrupt-handling-during-efx_device_detach_sync.patch queue-3.0/sfc-fix-loop-condition-for-efx_filter_search-when-for_insert.patch queue-3.0/sfc-detach-net-device-when-stopping-queues-for-reconfiguration.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html