From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
alan@lxorguk.ukuu.org.uk, Stefan Assmann <sassmann@kpanic.de>,
Aaron Brown <aaron.f.brown@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
Abdallah Chatila <abdallah.chatila@ericsson.com>
Subject: [ 20/33] igb: release already assigned MSI-X interrupts if setup fails
Date: Fri, 18 Jan 2013 17:16:45 -0800 [thread overview]
Message-ID: <20130119010353.099359883@linuxfoundation.org> (raw)
In-Reply-To: <20130119010345.885772698@linuxfoundation.org>
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Assmann <sassmann@kpanic.de>
commit 52285b762b3681669215bf1d17ca6143448ab7d3 upstream.
During MSI-X setup the system might run out of vectors. If this happens the
already assigned vectors for this NIC should be freed before trying the
disable MSI-X. Failing to do so results in the following oops.
kernel BUG at drivers/pci/msi.c:341!
[...]
Call Trace:
[<ffffffff8128f39d>] pci_disable_msix+0x3d/0x60
[<ffffffffa037d1ce>] igb_reset_interrupt_capability+0x27/0x5c [igb]
[<ffffffffa037d229>] igb_clear_interrupt_scheme+0x26/0x2d [igb]
[<ffffffffa0384268>] igb_request_irq+0x73/0x297 [igb]
[<ffffffffa0384554>] __igb_open+0xc8/0x223 [igb]
[<ffffffffa0384815>] igb_open+0x13/0x15 [igb]
[<ffffffff8144592f>] __dev_open+0xbf/0x120
[<ffffffff81443e51>] __dev_change_flags+0xa1/0x180
[<ffffffff81445828>] dev_change_flags+0x28/0x70
[<ffffffff814af537>] devinet_ioctl+0x5b7/0x620
[<ffffffff814b01c8>] inet_ioctl+0x88/0xa0
[<ffffffff8142e8a0>] sock_do_ioctl+0x30/0x70
[<ffffffff8142ecf2>] sock_ioctl+0x72/0x270
[<ffffffff8118062c>] do_vfs_ioctl+0x8c/0x340
[<ffffffff81180981>] sys_ioctl+0xa1/0xb0
[<ffffffff815161a9>] system_call_fastpath+0x16/0x1b
Code: 48 89 df e8 1f 40 ed ff 4d 39 e6 49 8b 45 10 75 b6 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f c9 c3 48 8b 7b 20 e8 3e 91 db ff eb ae <0f> 0b eb fe 0f 1f 84 00 00 00 00 00 55 48 89 e5 0f 1f 44 00 00
RIP [<ffffffff8128e144>] free_msi_irqs+0x124/0x130
RSP <ffff880037503bd8>
Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Abdallah Chatila <abdallah.chatila@ericsson.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -909,17 +909,18 @@ static int igb_request_msix(struct igb_a
{
struct net_device *netdev = adapter->netdev;
struct e1000_hw *hw = &adapter->hw;
- int i, err = 0, vector = 0;
+ int i, err = 0, vector = 0, free_vector = 0;
err = request_irq(adapter->msix_entries[vector].vector,
igb_msix_other, 0, netdev->name, adapter);
if (err)
- goto out;
- vector++;
+ goto err_out;
for (i = 0; i < adapter->num_q_vectors; i++) {
struct igb_q_vector *q_vector = adapter->q_vector[i];
+ vector++;
+
q_vector->itr_register = hw->hw_addr + E1000_EITR(vector);
if (q_vector->rx.ring && q_vector->tx.ring)
@@ -938,13 +939,22 @@ static int igb_request_msix(struct igb_a
igb_msix_ring, 0, q_vector->name,
q_vector);
if (err)
- goto out;
- vector++;
+ goto err_free;
}
igb_configure_msix(adapter);
return 0;
-out:
+
+err_free:
+ /* free already assigned IRQs */
+ free_irq(adapter->msix_entries[free_vector++].vector, adapter);
+
+ vector--;
+ for (i = 0; i < vector; i++) {
+ free_irq(adapter->msix_entries[free_vector++].vector,
+ adapter->q_vector[i]);
+ }
+err_out:
return err;
}
next prev parent reply other threads:[~2013-01-19 1:33 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-19 1:16 [ 00/33] 3.7.4-stable review Greg Kroah-Hartman
2013-01-19 1:16 ` [ 01/33] ALSA: hda/hdmi - Work around "alsactl restore" errors Greg Kroah-Hartman
2013-01-19 1:16 ` [ 02/33] sh: Fix FDPIC binary loader Greg Kroah-Hartman
2013-01-19 1:16 ` [ 03/33] firmware: make sure the fw file size is not 0 Greg Kroah-Hartman
2013-01-19 1:16 ` [ 04/33] arm64: mm: only wrprotect clean ptes if they are present Greg Kroah-Hartman
2013-01-19 1:16 ` [ 05/33] target: use correct sense code for LUN communication failure Greg Kroah-Hartman
2013-01-19 1:16 ` [ 06/33] tcm_fc: Do not indicate retry capability to initiators Greg Kroah-Hartman
2013-01-19 1:16 ` [ 07/33] tcm_fc: Do not report target role when target is not defined Greg Kroah-Hartman
2013-01-19 1:16 ` [ 08/33] target: Fix missing CMD_T_ACTIVE bit regression for pending WRITEs Greg Kroah-Hartman
2013-01-19 1:16 ` [ 09/33] target: Fix use-after-free in LUN RESET handling Greg Kroah-Hartman
2013-01-19 1:16 ` [ 10/33] target: Release se_cmd when LUN lookup fails for TMR Greg Kroah-Hartman
2013-01-19 1:16 ` [ 11/33] s390/time: fix sched_clock() overflow Greg Kroah-Hartman
2013-01-19 1:16 ` [ 12/33] x86/Sandy Bridge: reserve pages when integrated graphics is present Greg Kroah-Hartman
2013-01-19 1:16 ` [ 13/33] ALSA: usb - fix race in creation of M-Audio Fast track pro driver Greg Kroah-Hartman
2013-01-19 1:16 ` [ 14/33] ext4: init pagevec in ext4_da_block_invalidatepages Greg Kroah-Hartman
2013-01-19 1:16 ` [ 15/33] usb: chipidea: Allow disabling streaming not only in udc mode Greg Kroah-Hartman
2013-01-19 1:16 ` [ 16/33] drm/radeon: fix NULL pointer dereference in UMS mode Greg Kroah-Hartman
2013-01-19 1:16 ` [ 17/33] drm/radeon: fix a bogus kfree Greg Kroah-Hartman
2013-01-19 1:16 ` [ 18/33] target: Add link_magic for fabric allow_link destination target_items Greg Kroah-Hartman
2013-01-19 1:16 ` [ 19/33] intel-iommu: Prevent devices with RMRRs from being placed into SI Domain Greg Kroah-Hartman
2013-01-19 1:16 ` Greg Kroah-Hartman [this message]
2013-01-19 1:16 ` [ 21/33] xen/grant-table: correctly initialize grant table version 1 Greg Kroah-Hartman
2013-01-19 1:16 ` [ 22/33] xen: Fix stack corruption in xen_failsafe_callback for 32bit PVOPS guests Greg Kroah-Hartman
2013-01-19 1:16 ` [ 23/33] USB: io_ti: Fix NULL dereference in chase_port() Greg Kroah-Hartman
2013-01-19 1:16 ` [ 24/33] USB: option: add TP-LINK HSUPA Modem MA180 Greg Kroah-Hartman
2013-01-19 1:16 ` [ 25/33] USB: option: blacklist network interface on ONDA MT8205 4G LTE Greg Kroah-Hartman
2013-01-19 1:16 ` [ 26/33] serial:ifx6x60:Delete SPI timer when shut down port Greg Kroah-Hartman
2013-01-19 1:16 ` [ 27/33] tty: serial: vt8500: fix return value check in vt8500_serial_probe() Greg Kroah-Hartman
2013-01-19 1:16 ` [ 28/33] tty: 8250_dw: Fix inverted arguments to serial_out in IRQ handler Greg Kroah-Hartman
2013-01-19 1:16 ` [ 29/33] 8250/16?50: Add support for Broadcom TruManage redirected serial port Greg Kroah-Hartman
2013-01-19 1:16 ` [ 30/33] staging: wlan-ng: Fix clamping of returned SSID length Greg Kroah-Hartman
2013-01-19 1:16 ` [ 31/33] staging: vt6656: Fix inconsistent structure packing Greg Kroah-Hartman
2013-01-19 1:16 ` [ 32/33] mxs: uart: fix setting RTS from software Greg Kroah-Hartman
2013-01-19 1:16 ` [ 33/33] pty: return EINVAL for TIOCGPTN for BSD ptys Greg Kroah-Hartman
2013-01-19 18:51 ` [ 00/33] 3.7.4-stable review Shuah Khan
2013-01-20 9:22 ` Satoru Takeuchi
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=20130119010353.099359883@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=aaron.f.brown@intel.com \
--cc=abdallah.chatila@ericsson.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sassmann@kpanic.de \
--cc=stable@vger.kernel.org \
/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