From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Lyude Paul <lyude@redhat.com>,
Todd Fujinaka <todd.fujinaka@intel.com>,
Stephen Hemminger <stephen@networkplumber.org>,
Aaron Brown <aaron.f.brown@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [PATCH 4.9 16/86] igb: Free IRQs when device is hotplugged
Date: Fri, 2 Feb 2018 17:57:36 +0100 [thread overview]
Message-ID: <20180202140824.346496985@linuxfoundation.org> (raw)
In-Reply-To: <20180202140822.679101338@linuxfoundation.org>
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lyude Paul <lyude@redhat.com>
commit 888f22931478a05bc81ceb7295c626e1292bf0ed upstream.
Recently I got a Caldigit TS3 Thunderbolt 3 dock, and noticed that upon
hotplugging my kernel would immediately crash due to igb:
[ 680.825801] kernel BUG at drivers/pci/msi.c:352!
[ 680.828388] invalid opcode: 0000 [#1] SMP
[ 680.829194] Modules linked in: igb(O) thunderbolt i2c_algo_bit joydev vfat fat btusb btrtl btbcm btintel bluetooth ecdh_generic hp_wmi sparse_keymap rfkill wmi_bmof iTCO_wdt intel_rapl x86_pkg_temp_thermal coretemp crc32_pclmul snd_pcm rtsx_pci_ms mei_me snd_timer memstick snd pcspkr mei soundcore i2c_i801 tpm_tis psmouse shpchp wmi tpm_tis_core tpm video hp_wireless acpi_pad rtsx_pci_sdmmc mmc_core crc32c_intel serio_raw rtsx_pci mfd_core xhci_pci xhci_hcd i2c_hid i2c_core [last unloaded: igb]
[ 680.831085] CPU: 1 PID: 78 Comm: kworker/u16:1 Tainted: G O 4.15.0-rc3Lyude-Test+ #6
[ 680.831596] Hardware name: HP HP ZBook Studio G4/826B, BIOS P71 Ver. 01.03 06/09/2017
[ 680.832168] Workqueue: kacpi_hotplug acpi_hotplug_work_fn
[ 680.832687] RIP: 0010:free_msi_irqs+0x180/0x1b0
[ 680.833271] RSP: 0018:ffffc9000030fbf0 EFLAGS: 00010286
[ 680.833761] RAX: ffff8803405f9c00 RBX: ffff88033e3d2e40 RCX: 000000000000002c
[ 680.834278] RDX: 0000000000000000 RSI: 00000000000000ac RDI: ffff880340be2178
[ 680.834832] RBP: 0000000000000000 R08: ffff880340be1ff0 R09: ffff8803405f9c00
[ 680.835342] R10: 0000000000000000 R11: 0000000000000040 R12: ffff88033d63a298
[ 680.835822] R13: ffff88033d63a000 R14: 0000000000000060 R15: ffff880341959000
[ 680.836332] FS: 0000000000000000(0000) GS:ffff88034f440000(0000) knlGS:0000000000000000
[ 680.836817] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 680.837360] CR2: 000055e64044afdf CR3: 0000000001c09002 CR4: 00000000003606e0
[ 680.837954] Call Trace:
[ 680.838853] pci_disable_msix+0xce/0xf0
[ 680.839616] igb_reset_interrupt_capability+0x5d/0x60 [igb]
[ 680.840278] igb_remove+0x9d/0x110 [igb]
[ 680.840764] pci_device_remove+0x36/0xb0
[ 680.841279] device_release_driver_internal+0x157/0x220
[ 680.841739] pci_stop_bus_device+0x7d/0xa0
[ 680.842255] pci_stop_bus_device+0x2b/0xa0
[ 680.842722] pci_stop_bus_device+0x3d/0xa0
[ 680.843189] pci_stop_and_remove_bus_device+0xe/0x20
[ 680.843627] trim_stale_devices+0xf3/0x140
[ 680.844086] trim_stale_devices+0x94/0x140
[ 680.844532] trim_stale_devices+0xa6/0x140
[ 680.845031] ? get_slot_status+0x90/0xc0
[ 680.845536] acpiphp_check_bridge.part.5+0xfe/0x140
[ 680.846021] acpiphp_hotplug_notify+0x175/0x200
[ 680.846581] ? free_bridge+0x100/0x100
[ 680.847113] acpi_device_hotplug+0x8a/0x490
[ 680.847535] acpi_hotplug_work_fn+0x1a/0x30
[ 680.848076] process_one_work+0x182/0x3a0
[ 680.848543] worker_thread+0x2e/0x380
[ 680.848963] ? process_one_work+0x3a0/0x3a0
[ 680.849373] kthread+0x111/0x130
[ 680.849776] ? kthread_create_worker_on_cpu+0x50/0x50
[ 680.850188] ret_from_fork+0x1f/0x30
[ 680.850601] Code: 43 14 85 c0 0f 84 d5 fe ff ff 31 ed eb 0f 83 c5 01 39 6b 14 0f 86 c5 fe ff ff 8b 7b 10 01 ef e8 b7 e4 d2 ff 48 83 78 70 00 74 e3 <0f> 0b 49 8d b5 a0 00 00 00 e8 62 6f d3 ff e9 c7 fe ff ff 48 8b
[ 680.851497] RIP: free_msi_irqs+0x180/0x1b0 RSP: ffffc9000030fbf0
As it turns out, normally the freeing of IRQs that would fix this is called
inside of the scope of __igb_close(). However, since the device is
already gone by the point we try to unregister the netdevice from the
driver due to a hotplug we end up seeing that the netif isn't present
and thus, forget to free any of the device IRQs.
So: make sure that if we're in the process of dismantling the netdev, we
always allow __igb_close() to be called so that IRQs may be freed
normally. Additionally, only allow igb_close() to be called from
__igb_close() if it hasn't already been called for the given adapter.
Signed-off-by: Lyude Paul <lyude@redhat.com>
Fixes: 9474933caf21 ("igb: close/suspend race in netif_device_detach")
Cc: Todd Fujinaka <todd.fujinaka@intel.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3273,7 +3273,7 @@ static int __igb_close(struct net_device
int igb_close(struct net_device *netdev)
{
- if (netif_device_present(netdev))
+ if (netif_device_present(netdev) || netdev->dismantle)
return __igb_close(netdev, false);
return 0;
}
next prev parent reply other threads:[~2018-02-02 17:04 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 16:57 [PATCH 4.9 00/86] 4.9.80-stable review Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 02/86] net/mlx5: Define interface bits for fencing UMR wqe Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 03/86] RDMA/mlx5: set UMR wqe fence according to HCA cap Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 05/86] gpio: stmpe: i2c transfer are forbiden in atomic context Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 06/86] gpio: Fix kernel stack leak to userspace Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 07/86] crypto: ecdh - fix typo in KPP dependency of CRYPTO_ECDH Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 08/86] crypto: aesni - handle zero length dst buffer Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 09/86] crypto: sha3-generic - fixes for alignment and big endian operation Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 10/86] crypto: af_alg - whitelist mask and type Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 11/86] HID: wacom: EKR: ensure devres groups at higher indexes are released Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 12/86] power: reset: zx-reboot: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 13/86] gpio: iop: " Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 14/86] gpio: ath79: add missing MODULE_DESCRIPTION/LICENSE Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 15/86] mtd: nand: denali_pci: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE Greg Kroah-Hartman
2018-02-02 16:57 ` Greg Kroah-Hartman [this message]
2018-02-02 16:57 ` [PATCH 4.9 17/86] drm/vc4: Account for interrupts in flight Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 18/86] cpupowerutils: bench - Fix cpu online check Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 19/86] cpupower : Fix cpupower working when cpu0 is offline Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 25/86] ACPI / bus: Leave modalias empty for devices which are not present Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 27/86] cpufreq: Add Loongson machine dependencies Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 28/86] bcache: check return value of register_shrinker Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 29/86] drm/amdgpu: Fix SDMA load/unload sequence on HWS disabled mode Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 30/86] drm/amdkfd: Fix SDMA ring buffer size calculation Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 31/86] drm/amdkfd: Fix SDMA oversubsription handling Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 32/86] openvswitch: fix the incorrect flow action alloc size Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 33/86] mac80211: fix the update of path metric for RANN frame Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 34/86] btrfs: fix deadlock when writing out space cache Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 35/86] reiserfs: remove unneeded i_version bump Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 38/86] xfs: always free inline data before resetting inode fork during ifree Greg Kroah-Hartman
2018-02-02 16:57 ` [PATCH 4.9 39/86] xen-netfront: remove warning when unloading module Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 40/86] auxdisplay: img-ascii-lcd: Only build on archs that have IOMEM Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 41/86] nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0) Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 42/86] nfsd: Ensure we check stateid validity in the seqid operation checks Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 43/86] grace: replace BUG_ON by WARN_ONCE in exit_net hook Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 44/86] nfsd: check for use of the closed special stateid Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 45/86] lockd: fix "list_add double add" caused by legacy signal interface Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 46/86] hwmon: (pmbus) Use 64bit math for DIRECT format values Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 47/86] bnxt_en: Fix an error handling path in bnxt_get_module_eeprom() Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 48/86] xfs: fortify xfs_alloc_buftarg error handling Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 50/86] net: ethernet: xilinx: Mark XILINX_LL_TEMAC broken on 64-bit Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 51/86] quota: Check for register_shrinker() failure Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 52/86] SUNRPC: Allow connect to return EHOSTUNREACH Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 53/86] kmemleak: add scheduling point to kmemleak_scan() Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 54/86] drm/bridge: tc358767: do no fail on hi-res displays Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 55/86] drm/bridge: tc358767: filter out too high modes Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 56/86] drm/bridge: tc358767: fix DP0_MISC register set Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 57/86] drm/bridge: tc358767: fix timing calculations Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 58/86] drm/bridge: tc358767: fix AUXDATAn registers access Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 59/86] drm/bridge: tc358767: fix 1-lane behavior Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 60/86] drm/omap: Fix error handling path in omap_dmm_probe() Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 61/86] xfs: ubsan fixes Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 62/86] xfs: Properly retry failed dquot items in case of error during buffer writeback Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 63/86] scsi: aacraid: Prevent crash in case of free interrupt during scsi EH path Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 64/86] scsi: ufs: ufshcd: fix potential NULL pointer dereference in ufshcd_config_vreg Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 65/86] iwlwifi: mvm: fix the TX queue hang timeout for MONITOR vif type Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 66/86] ARM: dts: NSP: Fix PPI interrupt types Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 67/86] media: usbtv: add a new usbid Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 68/86] usb: gadget: dont dereference g until after it has been null checked Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 69/86] staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 70/86] drm/vc4: Move IRQ enable to PM path Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 71/86] staging: lustre: separate a connection destroy from free struct kib_conn Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 72/86] tty: fix data race between tty_init_dev and flush of buf Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 73/86] usb: option: Add support for FS040U modem Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 75/86] USB: cdc-acm: Do not log urb submission errors on disconnect Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 76/86] CDC-ACM: apply quirk for card reader Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 77/86] USB: serial: io_edgeport: fix possible sleep-in-atomic Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 78/86] usbip: prevent bind loops on devices attached to vhci_hcd Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 79/86] usbip: list: dont list " Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 80/86] USB: serial: simple: add Motorola Tetra driver Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 81/86] usb: f_fs: Prevent gadget unbind if it is already unbound Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 82/86] usb: uas: unconditionally bring back host after reset Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 83/86] usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc() Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 84/86] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 85/86] serial: imx: Only wakeup via RTSDEN bit if the system has RTS/CTS Greg Kroah-Hartman
2018-02-02 16:58 ` [PATCH 4.9 86/86] spi: imx: do not access registers while clocks disabled Greg Kroah-Hartman
2018-02-02 22:19 ` [PATCH 4.9 00/86] 4.9.80-stable review Shuah Khan
2018-02-02 22:45 ` Dan Rue
2018-02-03 15:29 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180202140824.346496985@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=aaron.f.brown@intel.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=stable@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=todd.fujinaka@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).