From: Zheng Yan <zheng.z....@intel.com> [ Upstream commit 749ab2cd127046df79084b6b9165b23491b1db5f ]
During suspend/resume (and possibly in other scenarios as well), the ASSERT_RTNL() warning is triggered in netif_set_real_num_tx/rx_queues() functions, something like: [ 374.073629] igb 0000:06:00.0: irq 86 for MSI/MSI-X [ 374.073631] igb 0000:06:00.1: irq 87 for MSI/MSI-X [ 374.073634] igb 0000:06:00.0: irq 88 for MSI/MSI-X [ 374.073636] igb 0000:06:00.1: irq 89 for MSI/MSI-X [ 374.073639] igb 0000:06:00.0: irq 90 for MSI/MSI-X [ 374.073641] igb 0000:06:00.1: irq 91 for MSI/MSI-X [ 374.073644] igb 0000:06:00.0: irq 92 for MSI/MSI-X [ 374.073646] igb 0000:06:00.1: irq 93 for MSI/MSI-X [ 374.073649] igb 0000:06:00.0: irq 94 for MSI/MSI-X [ 374.073651] igb 0000:06:00.1: irq 95 for MSI/MSI-X [ 374.073654] igb 0000:06:00.0: irq 96 for MSI/MSI-X [ 374.073656] igb 0000:06:00.1: irq 97 for MSI/MSI-X [ 374.073659] igb 0000:06:00.0: irq 98 for MSI/MSI-X [ 374.073661] igb 0000:06:00.1: irq 99 for MSI/MSI-X [ 374.073666] igb 0000:06:00.1: irq 101 for MSI/MSI-X [ 374.073668] igb 0000:06:00.0: irq 100 for MSI/MSI-X [ 374.073685] igb 0000:06:00.1: irq 102 for MSI/MSI-X [ 374.073687] igb 0000:06:00.0: irq 103 for MSI/MSI-X [ 374.073702] serial 00:0b: activated [ 374.073765] RTNL: assertion failed at net/core/dev.c (1718) [ 374.073767] Pid: 566, comm: kworker/u:4 Not tainted 3.2.13-0.0.0.2.0f8ab74-trace #1 [ 374.073769] RTNL: assertion failed at net/core/dev.c (1718) [ 374.073771] Call Trace: [ 374.073772] Pid: 5271, comm: kworker/u:10 Not tainted 3.2.13-0.0.0.2.0f8ab74-trace #1 [ 374.073775] Call Trace: [ 374.073780] [<ffffffff81385e3e>] netif_set_real_num_tx_queues+0x1ae/0x1d0 [ 374.073785] [<ffffffff81385e3e>] netif_set_real_num_tx_queues+0x1ae/0x1d0 [ 374.073792] [<ffffffffa0323f92>] igb_set_interrupt_capability+0x152/0x1f0 [igb] [ 374.073797] [<ffffffffa0323f92>] igb_set_interrupt_capability+0x152/0x1f0 [igb] [ 374.073814] [<ffffffffa0328968>] igb_init_interrupt_scheme+0x28/0x330 [igb] [ 374.073819] [<ffffffffa0328968>] igb_init_interrupt_scheme+0x28/0x330 [igb] [ 374.073823] [<ffffffffa0329a9c>] igb_resume+0x9c/0x160 [igb] [ 374.073828] [<ffffffffa0329a9c>] igb_resume+0x9c/0x160 [igb] [ 374.073831] [<ffffffff812707b2>] pci_legacy_resume+0x42/0x60 [ 374.073835] [<ffffffff812707b2>] pci_legacy_resume+0x42/0x60 [ 374.073837] [<ffffffff812709c0>] pci_pm_resume+0x90/0xd0 [ 374.073840] [<ffffffff812709c0>] pci_pm_resume+0x90/0xd0 [ 374.073843] [<ffffffff8131b59c>] pm_op+0x10c/0x1e0 [ 374.073847] [<ffffffff8131b59c>] pm_op+0x10c/0x1e0 [ 374.073849] [<ffffffff8131c5ca>] device_resume+0x27a/0x2c0 [ 374.073852] [<ffffffff8131c5ca>] device_resume+0x27a/0x2c0 [ 374.073854] [<ffffffff8131c631>] async_resume+0x21/0x50 [ 374.073857] [<ffffffff8131c631>] async_resume+0x21/0x50 [ 374.073860] [<ffffffff8107e564>] async_run_entry_fn+0x84/0x180 [ 374.073864] [<ffffffff8107e564>] async_run_entry_fn+0x84/0x180 [ 374.073867] [<ffffffff8106ecb1>] process_one_work+0x171/0x350 [ 374.073871] [<ffffffff8106ecb1>] process_one_work+0x171/0x350 [ 374.073874] [<ffffffff8107e4e0>] ? async_schedule+0x20/0x20 [ 374.073876] [<ffffffff8107e4e0>] ? async_schedule+0x20/0x20 [ 374.073879] [<ffffffff81071eeb>] worker_thread+0x18b/0x430 [ 374.073881] [<ffffffff81071eeb>] worker_thread+0x18b/0x430 [ 374.073884] [<ffffffff81071d60>] ? manage_workers+0x120/0x120 [ 374.073887] [<ffffffff81071d60>] ? manage_workers+0x120/0x120 [ 374.073890] [<ffffffff8107683e>] kthread+0x9e/0xb0 [ 374.073892] [<ffffffff8107683e>] kthread+0x9e/0xb0 [ 374.073896] [<ffffffff81451e04>] kernel_thread_helper+0x4/0x10 [ 374.073899] [<ffffffff81451e04>] kernel_thread_helper+0x4/0x10 [ 374.073902] [<ffffffff81447c21>] ? retint_restore_args+0x13/0x13 [ 374.073905] [<ffffffff81447c21>] ? retint_restore_args+0x13/0x13 [ 374.073907] [<ffffffff810767a0>] ? kthread_worker_fn+0x1b0/0x1b0 [ 374.073911] [<ffffffff810767a0>] ? kthread_worker_fn+0x1b0/0x1b0 [ 374.073913] [<ffffffff81451e00>] ? gs_change+0x13/0x13 [ 374.073915] [<ffffffff81451e00>] ? gs_change+0x13/0x13 [ 374.073917] RTNL: assertion failed at net/core/dev.c (1756) [ 374.073919] RTNL: assertion failed at net/core/dev.c (1756) [ 374.073921] Pid: 566, comm: kworker/u:4 Not tainted 3.2.13-0.0.0.2.0f8ab74-trace #1 [ 374.073923] Pid: 5271, comm: kworker/u:10 Not tainted 3.2.13-0.0.0.2.0f8ab74-trace #1 [ 374.073925] Call Trace: [ 374.073926] Call Trace: [ 374.073929] [<ffffffff81385c8b>] netif_set_real_num_rx_queues+0x8b/0x90 [ 374.073932] [<ffffffff81385c8b>] netif_set_real_num_rx_queues+0x8b/0x90 [ 374.073937] [<ffffffffa0323fa4>] igb_set_interrupt_capability+0x164/0x1f0 [igb] [ 374.073941] [<ffffffffa0323fa4>] igb_set_interrupt_capability+0x164/0x1f0 [igb] [ 374.073945] [<ffffffffa0328968>] igb_init_interrupt_scheme+0x28/0x330 [igb] [ 374.073949] [<ffffffffa0328968>] igb_init_interrupt_scheme+0x28/0x330 [igb] [ 374.073954] [<ffffffffa0329a9c>] igb_resume+0x9c/0x160 [igb] [ 374.073958] [<ffffffffa0329a9c>] igb_resume+0x9c/0x160 [igb] [ 374.073960] [<ffffffff812707b2>] pci_legacy_resume+0x42/0x60 [ 374.073963] [<ffffffff812707b2>] pci_legacy_resume+0x42/0x60 [ 374.073965] [<ffffffff812709c0>] pci_pm_resume+0x90/0xd0 [ 374.073968] [<ffffffff812709c0>] pci_pm_resume+0x90/0xd0 [ 374.073971] [<ffffffff8131b59c>] pm_op+0x10c/0x1e0 [ 374.073974] [<ffffffff8131b59c>] pm_op+0x10c/0x1e0 [ 374.073976] [<ffffffff8131c5ca>] device_resume+0x27a/0x2c0 [ 374.073979] [<ffffffff8131c5ca>] device_resume+0x27a/0x2c0 [ 374.073981] [<ffffffff8131c631>] async_resume+0x21/0x50 [ 374.073984] [<ffffffff8131c631>] async_resume+0x21/0x50 [ 374.073986] [<ffffffff8107e564>] async_run_entry_fn+0x84/0x180 [ 374.073990] [<ffffffff8107e564>] async_run_entry_fn+0x84/0x180 [ 374.073992] [<ffffffff8106ecb1>] process_one_work+0x171/0x350 [ 374.073996] [<ffffffff8106ecb1>] process_one_work+0x171/0x350 [ 374.073999] [<ffffffff8107e4e0>] ? async_schedule+0x20/0x20 [ 374.074002] [<ffffffff8107e4e0>] ? async_schedule+0x20/0x20 [ 374.074004] [<ffffffff81071eeb>] worker_thread+0x18b/0x430 [ 374.074006] [<ffffffff81071eeb>] worker_thread+0x18b/0x430 [ 374.074009] [<ffffffff81071d60>] ? manage_workers+0x120/0x120 [ 374.074012] [<ffffffff81071d60>] ? manage_workers+0x120/0x120 [ 374.074014] [<ffffffff8107683e>] kthread+0x9e/0xb0 [ 374.074017] [<ffffffff8107683e>] kthread+0x9e/0xb0 [ 374.074019] [<ffffffff81451e04>] kernel_thread_helper+0x4/0x10 [ 374.074022] [<ffffffff81451e04>] kernel_thread_helper+0x4/0x10 [ 374.074025] [<ffffffff81447c21>] ? retint_restore_args+0x13/0x13 [ 374.074027] [<ffffffff81447c21>] ? retint_restore_args+0x13/0x13 [ 374.074030] [<ffffffff810767a0>] ? kthread_worker_fn+0x1b0/0x1b0 [ 374.074033] [<ffffffff810767a0>] ? kthread_worker_fn+0x1b0/0x1b0 [ 374.074036] [<ffffffff81451e00>] ? gs_change+0x13/0x13 [ 374.074038] [<ffffffff81451e00>] ? gs_change+0x13/0x13 The fix was to add proper locking in igb_resume(). And this fix was buried in the commit 749ab2cd (igb: add basic runtime PM support). This patch backports just that fix alone. The original patch description of commit 749ab2cd was: Use the runtime power management framework to add basic runtime PM support to the igb driver. Namely, make the driver suspend the device when the link is off and set it up for generating a wakeup event after the link has been detected again. This feature is disabled by default. Based on e1000e's runtime PM code. Changes since v1: Don't suspend the device when shutting down the interface. Avoid race between runtime suspending and ethtool operations. Signed-off-by: Zheng Yan <zheng.z....@intel.com> Tested-by: Aaron Brown <aaron.f.br...@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirs...@intel.com> Signed-off-by: David S. Miller <da...@davemloft.net> Signed-off-by: Srivatsa S. Bhat <srivatsa.b...@linux.vnet.ibm.com> --- drivers/net/ethernet/intel/igb/igb_main.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 222954d..8775087 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -6697,7 +6697,18 @@ static int igb_resume(struct pci_dev *pdev) pci_enable_wake(pdev, PCI_D3hot, 0); pci_enable_wake(pdev, PCI_D3cold, 0); - if (igb_init_interrupt_scheme(adapter)) { + if (!rtnl_is_locked()) { + /* + * shut up ASSERT_RTNL() warning in + * netif_set_real_num_tx/rx_queues. + */ + rtnl_lock(); + err = igb_init_interrupt_scheme(adapter); + rtnl_unlock(); + } else { + err = igb_init_interrupt_scheme(adapter); + } + if (err) { dev_err(&pdev->dev, "Unable to allocate memory for queues\n"); return -ENOMEM; } -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html