Skip to content

Commit e0efe83

Browse files
LennySzubowiczdavem330
authored andcommitted
tg3: Disable tg3 PCIe AER on system reboot
Disable PCIe AER on the tg3 device on system reboot on a limited list of Dell PowerEdge systems. This prevents a fatal PCIe AER event on the tg3 device during the ACPI _PTS (prepare to sleep) method for S5 on those systems. The _PTS is invoked by acpi_enter_sleep_state_prep() as part of the kernel's reboot sequence as a result of commit 38f34db ("PM: ACPI: reboot: Reinstate S5 for reboot"). There was an earlier fix for this problem by commit 2ca1c94 ("tg3: Disable tg3 device on system reboot to avoid triggering AER"). But it was discovered that this earlier fix caused a reboot hang when some Dell PowerEdge servers were booted via ipxe. To address this reboot hang, the earlier fix was essentially reverted by commit 9fc3bc7 ("tg3: power down device only on SYSTEM_POWER_OFF"). This re-exposed the tg3 PCIe AER on reboot problem. This fix is not an ideal solution because the root cause of the AER is in system firmware. Instead, it's a targeted work-around in the tg3 driver. Note also that the PCIe AER must be disabled on the tg3 device even if the system is configured to use "firmware first" error handling. V3: - Fix sparse warning on improper comparison of pdev->current_state - Adhere to netdev comment style Fixes: 9fc3bc7 ("tg3: power down device only on SYSTEM_POWER_OFF") Signed-off-by: Lenny Szubowicz <[email protected]> Reviewed-by: Pavan Chebbi <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3f1baa9 commit e0efe83

File tree

1 file changed

+58
-0
lines changed
  • drivers/net/ethernet/broadcom

1 file changed

+58
-0
lines changed

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#include <linux/hwmon.h>
5656
#include <linux/hwmon-sysfs.h>
5757
#include <linux/crc32poly.h>
58+
#include <linux/dmi.h>
5859

5960
#include <net/checksum.h>
6061
#include <net/gso.h>
@@ -18212,6 +18213,50 @@ static int tg3_resume(struct device *device)
1821218213

1821318214
static SIMPLE_DEV_PM_OPS(tg3_pm_ops, tg3_suspend, tg3_resume);
1821418215

18216+
/* Systems where ACPI _PTS (Prepare To Sleep) S5 will result in a fatal
18217+
* PCIe AER event on the tg3 device if the tg3 device is not, or cannot
18218+
* be, powered down.
18219+
*/
18220+
static const struct dmi_system_id tg3_restart_aer_quirk_table[] = {
18221+
{
18222+
.matches = {
18223+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
18224+
DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R440"),
18225+
},
18226+
},
18227+
{
18228+
.matches = {
18229+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
18230+
DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R540"),
18231+
},
18232+
},
18233+
{
18234+
.matches = {
18235+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
18236+
DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R640"),
18237+
},
18238+
},
18239+
{
18240+
.matches = {
18241+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
18242+
DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R650"),
18243+
},
18244+
},
18245+
{
18246+
.matches = {
18247+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
18248+
DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740"),
18249+
},
18250+
},
18251+
{
18252+
.matches = {
18253+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
18254+
DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R750"),
18255+
},
18256+
},
18257+
{}
18258+
};
18259+
1821518260
static void tg3_shutdown(struct pci_dev *pdev)
1821618261
{
1821718262
struct net_device *dev = pci_get_drvdata(pdev);
@@ -18228,6 +18273,19 @@ static void tg3_shutdown(struct pci_dev *pdev)
1822818273

1822918274
if (system_state == SYSTEM_POWER_OFF)
1823018275
tg3_power_down(tp);
18276+
else if (system_state == SYSTEM_RESTART &&
18277+
dmi_first_match(tg3_restart_aer_quirk_table) &&
18278+
pdev->current_state != PCI_D3cold &&
18279+
pdev->current_state != PCI_UNKNOWN) {
18280+
/* Disable PCIe AER on the tg3 to avoid a fatal
18281+
* error during this system restart.
18282+
*/
18283+
pcie_capability_clear_word(pdev, PCI_EXP_DEVCTL,
18284+
PCI_EXP_DEVCTL_CERE |
18285+
PCI_EXP_DEVCTL_NFERE |
18286+
PCI_EXP_DEVCTL_FERE |
18287+
PCI_EXP_DEVCTL_URRE);
18288+
}
1823118289

1823218290
rtnl_unlock();
1823318291

0 commit comments

Comments
 (0)