From: Aaron Ma <aaron.ma@canonical.com>
To: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Jesse Brandeburg <jesse.brandeburg@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: [Intel-wired-lan] [PATCH] igb: fix hang issue of AER error during resume
Date: Sat, 27 May 2023 00:30:01 +0800 [thread overview]
Message-ID: <20230526163001.67626-1-aaron.ma@canonical.com> (raw)
PCIe AER error_detected caused a race issue with igb_resume.
Protect error_detected when igb is in down state.
Error logs:
kernel: igb 0000:02:00.0: disabling already-disabled device
kernel: WARNING: CPU: 0 PID: 277 at drivers/pci/pci.c:2248 pci_disable_device+0xc4/0xf0
kernel: RIP: 0010:pci_disable_device+0xc4/0xf0
kernel: Call Trace:
kernel: <TASK>
kernel: igb_io_error_detected+0x3e/0x60
kernel: report_error_detected+0xd6/0x1c0
kernel: ? __pfx_report_normal_detected+0x10/0x10
kernel: report_normal_detected+0x16/0x30
kernel: pci_walk_bus+0x74/0xa0
kernel: pcie_do_recovery+0xb9/0x340
kernel: ? __pfx_aer_root_reset+0x10/0x10
kernel: aer_process_err_devices+0x168/0x220
kernel: aer_isr+0x1b5/0x1e0
kernel: ? __pfx_irq_thread_fn+0x10/0x10
kernel: irq_thread_fn+0x21/0x70
kernel: irq_thread+0xf8/0x1c0
kernel: ? __pfx_irq_thread_dtor+0x10/0x10
kernel: ? __pfx_irq_thread+0x10/0x10
kernel: kthread+0xef/0x120
kernel: ? __pfx_kthread+0x10/0x10
kernel: ret_from_fork+0x29/0x50
kernel: </TASK>
kernel: ---[ end trace 0000000000000000 ]---
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217446
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 58872a4c2540..8333d4ac8169 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -9581,14 +9581,21 @@ static pci_ers_result_t igb_io_error_detected(struct pci_dev *pdev,
struct net_device *netdev = pci_get_drvdata(pdev);
struct igb_adapter *adapter = netdev_priv(netdev);
+ if (test_bit(__IGB_DOWN, &adapter->state))
+ return PCI_ERS_RESULT_DISCONNECT;
+
+ rtnl_lock();
netif_device_detach(netdev);
- if (state == pci_channel_io_perm_failure)
+ if (state == pci_channel_io_perm_failure) {
+ rtnl_unlock();
return PCI_ERS_RESULT_DISCONNECT;
+ }
if (netif_running(netdev))
igb_down(adapter);
pci_disable_device(pdev);
+ rtnl_unlock();
/* Request a slot reset. */
return PCI_ERS_RESULT_NEED_RESET;
--
2.34.1
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next reply other threads:[~2023-05-26 16:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 16:30 Aaron Ma [this message]
2023-06-06 14:16 ` [Intel-wired-lan] [PATCH] igb: fix hang issue of AER error during resume Palczewski, Mateusz
2023-06-06 17:28 ` Tony Nguyen
2023-06-07 1:56 ` [Intel-wired-lan] [PATCH net v2] " Aaron Ma
2023-07-13 23:38 ` Mekala, SunithaX D
2023-07-14 5:18 ` Kai-Heng Feng
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=20230526163001.67626-1-aaron.ma@canonical.com \
--to=aaron.ma@canonical.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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