| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | When the Ethernet controller is powered down and someone wants to |
| 2 | access the mdio bus like the witch driver (b53) the system crashed if |
| 3 | PCI_D3hot was set before. This patch deactivates this power sawing mode |
| 4 | when 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) |