From: Greg Rose Date: Mon, 16 May 2016 17:26:38 +0000 (-0700) Subject: i40e: Save PCI state before suspend X-Git-Tag: v4.1.12-98.0.20170517_2143~42^2~241 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3918803634e020c8740c00ca36557b0a3c3f31ff;p=users%2Fjedix%2Flinux-maple.git i40e: Save PCI state before suspend Orabug: 24568124 The i40e_suspend() function was failing to save PCI state and this would result in a kernel stack trace from a WARN_ONCE in the pci_legacy_suspend() function. Add a call to pci_save_state() to fix that problem. Change-ID: I4736e62bb660966bd208cc8af617a14cb07fc4bd Signed-off-by: Greg Rose Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher (cherry picked from commit 059ff69b5fa136a23a2d71df6d9814e86485e8b9) Signed-off-by: Brian Maly Signed-off-by: Dhaval Giani --- diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 5fed8f6e0195f..49c4bff196bed 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -11391,6 +11391,7 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state) { struct i40e_pf *pf = pci_get_drvdata(pdev); struct i40e_hw *hw = &pf->hw; + int retval = 0; set_bit(__I40E_SUSPENDED, &pf->state); set_bit(__I40E_DOWN, &pf->state); @@ -11404,10 +11405,14 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state) i40e_stop_misc_vector(pf); + retval = pci_save_state(pdev); + if (retval) + return retval; + pci_wake_from_d3(pdev, pf->wol_en); pci_set_power_state(pdev, PCI_D3hot); - return 0; + return retval; } /**