Commit e4135c2d authored by Dhananjay Phadke's avatar Dhananjay Phadke Committed by David S. Miller

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: default avatarDhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b2af9cb0
...@@ -1535,10 +1535,12 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter) ...@@ -1535,10 +1535,12 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
printk(KERN_ALERT printk(KERN_ALERT
"%s: Device temperature %d degrees C exceeds" "%s: Device temperature %d degrees C exceeds"
" maximum allowed. Hardware has been shut down.\n", " 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; rv = 1;
} else if (temp_state == NX_TEMP_WARN) { } else if (temp_state == NX_TEMP_WARN) {
if (adapter->temp == NX_TEMP_NORMAL) { if (adapter->temp == NX_TEMP_NORMAL) {
...@@ -1546,13 +1548,13 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter) ...@@ -1546,13 +1548,13 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
"%s: Device temperature %d degrees C " "%s: Device temperature %d degrees C "
"exceeds operating range." "exceeds operating range."
" Immediate action needed.\n", " Immediate action needed.\n",
netxen_nic_driver_name, temp_val); netdev->name, temp_val);
} }
} else { } else {
if (adapter->temp == NX_TEMP_WARN) { if (adapter->temp == NX_TEMP_WARN) {
printk(KERN_INFO printk(KERN_INFO
"%s: Device temperature is now %d degrees C" "%s: Device temperature is now %d degrees C"
" in normal range.\n", netxen_nic_driver_name, " in normal range.\n", netdev->name,
temp_val); temp_val);
} }
} }
...@@ -1625,7 +1627,7 @@ void netxen_watchdog_task(struct work_struct *work) ...@@ -1625,7 +1627,7 @@ void netxen_watchdog_task(struct work_struct *work)
struct netxen_adapter *adapter = struct netxen_adapter *adapter =
container_of(work, struct netxen_adapter, watchdog_task); container_of(work, struct netxen_adapter, watchdog_task);
if ((adapter->portnum == 0) && netxen_nic_check_temp(adapter)) if (netxen_nic_check_temp(adapter))
return; return;
if (!adapter->has_link_events) if (!adapter->has_link_events)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment