aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/sfc/mdio_10g.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/sfc/mdio_10g.c b/drivers/net/sfc/mdio_10g.c
index f9e2f95c3b48..4462fb58a3a9 100644
--- a/drivers/net/sfc/mdio_10g.c
+++ b/drivers/net/sfc/mdio_10g.c
@@ -125,24 +125,25 @@ int mdio_clause45_wait_reset_mmds(struct efx_nic *efx,
125int mdio_clause45_check_mmds(struct efx_nic *efx, 125int mdio_clause45_check_mmds(struct efx_nic *efx,
126 unsigned int mmd_mask, unsigned int fatal_mask) 126 unsigned int mmd_mask, unsigned int fatal_mask)
127{ 127{
128 int mmd = 0, probe_mmd, devs0, devs1;
128 u32 devices; 129 u32 devices;
129 int mmd = 0, probe_mmd;
130 130
131 /* Historically we have probed the PHYXS to find out what devices are 131 /* Historically we have probed the PHYXS to find out what devices are
132 * present,but that doesn't work so well if the PHYXS isn't expected 132 * present,but that doesn't work so well if the PHYXS isn't expected
133 * to exist, if so just find the first item in the list supplied. */ 133 * to exist, if so just find the first item in the list supplied. */
134 probe_mmd = (mmd_mask & MDIO_MMDREG_DEVS_PHYXS) ? MDIO_MMD_PHYXS : 134 probe_mmd = (mmd_mask & MDIO_MMDREG_DEVS_PHYXS) ? MDIO_MMD_PHYXS :
135 __ffs(mmd_mask); 135 __ffs(mmd_mask);
136 devices = (mdio_clause45_read(efx, efx->mii.phy_id,
137 probe_mmd, MDIO_MMDREG_DEVS0) |
138 mdio_clause45_read(efx, efx->mii.phy_id,
139 probe_mmd, MDIO_MMDREG_DEVS1) << 16);
140 136
141 /* Check all the expected MMDs are present */ 137 /* Check all the expected MMDs are present */
142 if (devices < 0) { 138 devs0 = mdio_clause45_read(efx, efx->mii.phy_id,
139 probe_mmd, MDIO_MMDREG_DEVS0);
140 devs1 = mdio_clause45_read(efx, efx->mii.phy_id,
141 probe_mmd, MDIO_MMDREG_DEVS1);
142 if (devs0 < 0 || devs1 < 0) {
143 EFX_ERR(efx, "failed to read devices present\n"); 143 EFX_ERR(efx, "failed to read devices present\n");
144 return -EIO; 144 return -EIO;
145 } 145 }
146 devices = devs0 | (devs1 << 16);
146 if ((devices & mmd_mask) != mmd_mask) { 147 if ((devices & mmd_mask) != mmd_mask) {
147 EFX_ERR(efx, "required MMDs not present: got %x, " 148 EFX_ERR(efx, "required MMDs not present: got %x, "
148 "wanted %x\n", devices, mmd_mask); 149 "wanted %x\n", devices, mmd_mask);