mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 21:40:53 +07:00
netxen: fix thermal check and shutdown
Check temperature for all PCI functions, that can allow graceful shutdown of all interfaces on the overheated card. Old code was only monitoring temperature for function 0 only. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b2af9cb06d
commit
e4135c2da1
@ -1535,10 +1535,12 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
|
||||
printk(KERN_ALERT
|
||||
"%s: Device temperature %d degrees C exceeds"
|
||||
" maximum allowed. Hardware has been shut down.\n",
|
||||
netxen_nic_driver_name, temp_val);
|
||||
netdev->name, temp_val);
|
||||
|
||||
netif_device_detach(netdev);
|
||||
netxen_nic_down(adapter, netdev);
|
||||
netxen_nic_detach(adapter);
|
||||
|
||||
netif_carrier_off(netdev);
|
||||
netif_stop_queue(netdev);
|
||||
rv = 1;
|
||||
} else if (temp_state == NX_TEMP_WARN) {
|
||||
if (adapter->temp == NX_TEMP_NORMAL) {
|
||||
@ -1546,13 +1548,13 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
|
||||
"%s: Device temperature %d degrees C "
|
||||
"exceeds operating range."
|
||||
" Immediate action needed.\n",
|
||||
netxen_nic_driver_name, temp_val);
|
||||
netdev->name, temp_val);
|
||||
}
|
||||
} else {
|
||||
if (adapter->temp == NX_TEMP_WARN) {
|
||||
printk(KERN_INFO
|
||||
"%s: Device temperature is now %d degrees C"
|
||||
" in normal range.\n", netxen_nic_driver_name,
|
||||
" in normal range.\n", netdev->name,
|
||||
temp_val);
|
||||
}
|
||||
}
|
||||
@ -1625,7 +1627,7 @@ void netxen_watchdog_task(struct work_struct *work)
|
||||
struct netxen_adapter *adapter =
|
||||
container_of(work, struct netxen_adapter, watchdog_task);
|
||||
|
||||
if ((adapter->portnum == 0) && netxen_nic_check_temp(adapter))
|
||||
if (netxen_nic_check_temp(adapter))
|
||||
return;
|
||||
|
||||
if (!adapter->has_link_events)
|
||||
|
Loading…
Reference in New Issue
Block a user