All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alice Michael <alice.michael@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [next PATCH S94 11/13] i40e: Prevent kernel panic when rebooting server while NIC is in recovery
Date: Wed,  1 Aug 2018 17:40:34 -0700	[thread overview]
Message-ID: <20180802004036.89363-11-alice.michael@intel.com> (raw)
In-Reply-To: <20180802004036.89363-1-alice.michael@intel.com>

From: Patryk Ma?ek <patryk.malek@intel.com>

If user triggers a reboot and the adapter is in recovery
mode, we are not taking this fact into account and we are
not freeing irq that has been specifically allocated for
NVM update/recover purposes, what bothers kernel when we issue
pci_disable_msi when irq still has an interrupt registered.
This patch fixes that and ensures that we free this irq.

Signed-off-by: Patryk Ma?ek <patryk.malek@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 3b1740d..ff04dc4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -14627,6 +14627,16 @@ static void i40e_shutdown(struct pci_dev *pdev)
 	wr32(hw, I40E_PFPM_WUFC,
 	     (pf->wol_en ? I40E_PFPM_WUFC_MAG_MASK : 0));
 
+	/* Free MSI/legacy interrupt 0 when in recovery mode.
+	 * This is normally done in i40e_vsi_free_irq on
+	 * VSI close but since recovery mode doesn't allow to up
+	 * an interface and we do not allocate all Rx/Tx resources
+	 * for it we'll just do it here
+	 */
+	if (test_bit(__I40E_RECOVERY_MODE, pf->state) &&
+	    !(pf->flags & I40E_FLAG_MSIX_ENABLED))
+		free_irq(pf->pdev->irq, pf);
+
 	i40e_clear_interrupt_scheme(pf);
 
 	if (system_state == SYSTEM_POWER_OFF) {
-- 
2.9.5


  parent reply	other threads:[~2018-08-02  0:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02  0:40 [Intel-wired-lan] [next PATCH S94 01/13] i40e: Introduce recovery mode support Alice Michael
2018-08-02  0:40 ` [Intel-wired-lan] [next PATCH S94 02/13] i40e: Add setting pf->lan_vsi in a recovery mode init path Alice Michael
2018-08-02  0:40 ` [Intel-wired-lan] [next PATCH S94 03/13] i40e: Don't read MAC address in recovery mode Alice Michael
2018-08-02  0:40 ` [Intel-wired-lan] [next PATCH S94 04/13] i40e: Display message when entering and leaving " Alice Michael
2018-08-02  0:40 ` [Intel-wired-lan] [next PATCH S94 05/13] i40e: Enable interrupts in " Alice Michael
2018-08-02  0:40 ` [Intel-wired-lan] [next PATCH S94 06/13] i40e: Limit initialization when going out of " Alice Michael
2018-08-02  0:40 ` [Intel-wired-lan] [next PATCH S94 07/13] i40e: Check for recovery mode before doing PF reset Alice Michael
2018-08-02  0:40 ` [Intel-wired-lan] [next PATCH S94 08/13] i40e: Reorder irq and adminq deinitialization in i40e_remove Alice Michael
2018-08-02  0:40 ` [Intel-wired-lan] [next PATCH S94 09/13] i40e: Set netdev_registered when registering netdev in recovery mode Alice Michael
2018-08-02  0:40 ` [Intel-wired-lan] [next PATCH S94 10/13] i40e: Reinitialize interrupt scheme when going out of " Alice Michael
2018-08-02  0:40 ` Alice Michael [this message]
2018-08-02  0:40 ` [Intel-wired-lan] [next PATCH S94 12/13] i40e: Lock the rtnl lock when restoring interrupt scheme for " Alice Michael
2018-08-02  0:40 ` [Intel-wired-lan] [next PATCH S94 13/13] i40e: set vsi->netdev to NULL after free_netdev() Alice Michael
2018-08-03 16:45 ` [Intel-wired-lan] [next PATCH S94 01/13] i40e: Introduce recovery mode support Shannon Nelson

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=20180802004036.89363-11-alice.michael@intel.com \
    --to=alice.michael@intel.com \
    --cc=intel-wired-lan@osuosl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.