blob: b34f20891d1e99e5c0581988adbbf7289bde5a34 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001When the Ethernet controller is powered down and someone wants to
2access the mdio bus like the witch driver (b53) the system crashed if
3PCI_D3hot was set before. This patch deactivates this power sawing mode
4when a switch driver is in use.
5
6--- a/drivers/net/ethernet/broadcom/tg3.c
7+++ b/drivers/net/ethernet/broadcom/tg3.c
8@@ -4279,7 +4279,8 @@ static int tg3_power_down_prepare(struct
9 static void tg3_power_down(struct tg3 *tp)
10 {
11 pci_wake_from_d3(tp->pdev, tg3_flag(tp, WOL_ENABLE));
12- pci_set_power_state(tp->pdev, PCI_D3hot);
13+ if (!tg3_flag(tp, ROBOSWITCH))
14+ pci_set_power_state(tp->pdev, PCI_D3hot);
15 }
16
17 static void tg3_aux_stat_to_speed_duplex(struct tg3 *tp, u32 val, u32 *speed, u8 *duplex)