Skip to content

Commit a4f090f

Browse files
committed
Merge branch 'amd-xgbe-next'
Tom Lendacky says: ==================== amd-xgbe: AMD XGBE driver update 2014-08-01 The following series of patches includes minor fixes/updates to the driver. - Remove some uses of spinlock around ethtool/phylib areas - Update Rx/Tx ready check logic ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents ae29223 + 1fa1f2e commit a4f090f

File tree

3 files changed

+8
-23
lines changed

3 files changed

+8
-23
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,9 @@ static int xgbe_get_settings(struct net_device *netdev,
290290
if (!pdata->phydev)
291291
return -ENODEV;
292292

293-
spin_lock_irq(&pdata->lock);
294-
295293
ret = phy_ethtool_gset(pdata->phydev, cmd);
296294
cmd->transceiver = XCVR_EXTERNAL;
297295

298-
spin_unlock_irq(&pdata->lock);
299-
300296
DBGPR("<--xgbe_get_settings\n");
301297

302298
return ret;
@@ -315,17 +311,14 @@ static int xgbe_set_settings(struct net_device *netdev,
315311
if (!pdata->phydev)
316312
return -ENODEV;
317313

318-
spin_lock_irq(&pdata->lock);
319-
320314
speed = ethtool_cmd_speed(cmd);
321315

322-
ret = -EINVAL;
323316
if (cmd->phy_address != phydev->addr)
324-
goto unlock;
317+
return -EINVAL;
325318

326319
if ((cmd->autoneg != AUTONEG_ENABLE) &&
327320
(cmd->autoneg != AUTONEG_DISABLE))
328-
goto unlock;
321+
return -EINVAL;
329322

330323
if (cmd->autoneg == AUTONEG_DISABLE) {
331324
switch (speed) {
@@ -334,16 +327,16 @@ static int xgbe_set_settings(struct net_device *netdev,
334327
case SPEED_1000:
335328
break;
336329
default:
337-
goto unlock;
330+
return -EINVAL;
338331
}
339332

340333
if (cmd->duplex != DUPLEX_FULL)
341-
goto unlock;
334+
return -EINVAL;
342335
}
343336

344337
cmd->advertising &= phydev->supported;
345338
if ((cmd->autoneg == AUTONEG_ENABLE) && !cmd->advertising)
346-
goto unlock;
339+
return -EINVAL;
347340

348341
ret = 0;
349342
phydev->autoneg = cmd->autoneg;
@@ -359,9 +352,6 @@ static int xgbe_set_settings(struct net_device *netdev,
359352
if (netif_running(netdev))
360353
ret = phy_start_aneg(phydev);
361354

362-
unlock:
363-
spin_unlock_irq(&pdata->lock);
364-
365355
DBGPR("<--xgbe_set_settings\n");
366356

367357
return ret;

drivers/net/ethernet/amd/xgbe/xgbe-mdio.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ static void xgbe_adjust_link(struct net_device *netdev)
163163
struct xgbe_prv_data *pdata = netdev_priv(netdev);
164164
struct xgbe_hw_if *hw_if = &pdata->hw_if;
165165
struct phy_device *phydev = pdata->phydev;
166-
unsigned long flags;
167166
int new_state = 0;
168167

169168
if (phydev == NULL)
@@ -172,8 +171,6 @@ static void xgbe_adjust_link(struct net_device *netdev)
172171
DBGPR_MDIO("-->xgbe_adjust_link: address=%d, newlink=%d, curlink=%d\n",
173172
phydev->addr, phydev->link, pdata->phy_link);
174173

175-
spin_lock_irqsave(&pdata->lock, flags);
176-
177174
if (phydev->link) {
178175
/* Flow control support */
179176
if (pdata->pause_autoneg) {
@@ -229,8 +226,6 @@ static void xgbe_adjust_link(struct net_device *netdev)
229226
if (new_state)
230227
phy_print_status(phydev);
231228

232-
spin_unlock_irqrestore(&pdata->lock, flags);
233-
234229
DBGPR_MDIO("<--xgbe_adjust_link\n");
235230
}
236231

drivers/net/phy/amd-xgbe-phy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ MODULE_DESCRIPTION("AMD 10GbE (amd-xgbe) PHY driver");
9595
#define XNP_MP_FORMATTED (1 << 13)
9696
#define XNP_NP_EXCHANGE (1 << 15)
9797

98-
#define XGBE_PHY_RATECHANGE_COUNT 100
98+
#define XGBE_PHY_RATECHANGE_COUNT 500
9999

100100
#ifndef MDIO_PMA_10GBR_PMD_CTRL
101101
#define MDIO_PMA_10GBR_PMD_CTRL 0x0096
@@ -411,15 +411,15 @@ static void amd_xgbe_phy_serdes_complete_ratechange(struct phy_device *phydev)
411411
/* Wait for Rx and Tx ready */
412412
wait = XGBE_PHY_RATECHANGE_COUNT;
413413
while (wait--) {
414-
usleep_range(10, 20);
414+
usleep_range(50, 75);
415415

416416
status = XSIR0_IOREAD(priv, SIR0_STATUS);
417417
if (XSIR_GET_BITS(status, SIR0_STATUS, RX_READY) &&
418418
XSIR_GET_BITS(status, SIR0_STATUS, TX_READY))
419419
return;
420420
}
421421

422-
netdev_err(phydev->attached_dev, "SerDes rx/tx not ready (%#hx)\n",
422+
netdev_dbg(phydev->attached_dev, "SerDes rx/tx not ready (%#hx)\n",
423423
status);
424424
}
425425

0 commit comments

Comments
 (0)