i40e: fix for PHY NVM interaction problem

This patch fixes a problem where the NVMUpdate Tool, when using the PHY
NVM feature, gets bad data from the PHY because of contention on the
MDIO interface from get PHY capability calls from the driver during
regular operations.  The problem is fixed by adding a check if media
is available before calling get PHY capability function because that
bit is not set when device is in PHY interaction mode.

Change-ID: Ib89991b0f841808dd92410f5e8683d6ee3301cd0
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
Carolyn Wyborny 2015-09-28 14:16:56 -04:00 committed by Jeff Kirsher
parent bcab2db97d
commit 8589af70d0

View file

@ -2278,13 +2278,15 @@ i40e_status i40e_update_link_info(struct i40e_hw *hw)
if (status) if (status)
return status; return status;
status = i40e_aq_get_phy_capabilities(hw, false, false, &abilities, if (hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) {
NULL); status = i40e_aq_get_phy_capabilities(hw, false, false,
if (status) &abilities, NULL);
return status; if (status)
return status;
memcpy(hw->phy.link_info.module_type, &abilities.module_type, memcpy(hw->phy.link_info.module_type, &abilities.module_type,
sizeof(hw->phy.link_info.module_type)); sizeof(hw->phy.link_info.module_type));
}
return status; return status;
} }