sfc: Use lm87 and lm90 drivers for board temperature/power monitoring
Add board monitoring to periodic work whenever link is down. For SFE4001, report when a fault has caused the PHY to turn off. For SFE4002, switch XFP PHY into low-power state in case of a fault. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:

committed by
Jeff Garzik

parent
f41507245e
commit
3e133c44d2
@@ -376,6 +376,7 @@ static int tenxpress_phy_check_hw(struct efx_nic *efx)
|
||||
{
|
||||
struct tenxpress_phy_data *phy_data = efx->phy_data;
|
||||
bool link_ok;
|
||||
int rc = 0;
|
||||
|
||||
link_ok = tenxpress_link_ok(efx, true);
|
||||
|
||||
@@ -391,7 +392,22 @@ static int tenxpress_phy_check_hw(struct efx_nic *efx)
|
||||
atomic_set(&phy_data->bad_crc_count, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
rc = efx->board_info.monitor(efx);
|
||||
if (rc) {
|
||||
EFX_ERR(efx, "Board sensor %s; shutting down PHY\n",
|
||||
(rc == -ERANGE) ? "reported fault" : "failed");
|
||||
if (efx->phy_mode & PHY_MODE_OFF) {
|
||||
/* Assume that board has shut PHY off */
|
||||
phy_data->phy_mode = PHY_MODE_OFF;
|
||||
} else {
|
||||
efx->phy_mode |= PHY_MODE_LOW_POWER;
|
||||
mdio_clause45_set_mmds_lpower(efx, true,
|
||||
efx->phy_op->mmds);
|
||||
phy_data->phy_mode |= PHY_MODE_LOW_POWER;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void tenxpress_phy_fini(struct efx_nic *efx)
|
||||
|
Reference in New Issue
Block a user