Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 96764 Details for
Bug 144662
Problems with the sky2 driver: Hang on upload
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
sky2-tx.patch (text/plain), 7.39 KB, created by
Daniel Drake (RETIRED)
on 2006-09-11 19:20:53 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Daniel Drake (RETIRED)
Created:
2006-09-11 19:20:53 UTC
Size:
7.39 KB
patch
obsolete
>Fix problems with transmit pause frames. The driver was telling the >GMAC to flush (not process) pause frames. Manually disabling pause wasn't >working because of problems in the setup. > >This maybe the cause of the lockup under load. > http://bugzilla.kernel.org/show_bug.cgi?id=6839 > >Patch against netdev-2.6 git tree > >Signed-off-by: Stephen Hemminger <shemminger@osdl.org> > >--- > > drivers/net/sky2.c | 123 ++++++++++++++++++---------------------------------- > drivers/net/sky2.h | 2 - > 2 files changed, 43 insertions(+), 82 deletions(-) > >1419c8ab49f8fd56bad1ac0d3dcbaf830cd5a5d6 >Index: linux-2.6.17-gentoo-r8/drivers/net/sky2.c >=================================================================== >--- linux-2.6.17-gentoo-r8.orig/drivers/net/sky2.c >+++ linux-2.6.17-gentoo-r8/drivers/net/sky2.c >@@ -308,7 +308,7 @@ static void sky2_phy_reset(struct sky2_h > static void sky2_phy_init(struct sky2_hw *hw, unsigned port) > { > struct sky2_port *sky2 = netdev_priv(hw->dev[port]); >- u16 ctrl, ct1000, adv, pg, ledctrl, ledover; >+ u16 ctrl, ct1000, adv, pg, ledctrl, ledover, reg; > > if (sky2->autoneg == AUTONEG_ENABLE && > !(hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U)) { >@@ -389,6 +389,7 @@ static void sky2_phy_init(struct sky2_hw > ctrl = 0; > ct1000 = 0; > adv = PHY_AN_CSMA; >+ reg = 0; > > if (sky2->autoneg == AUTONEG_ENABLE) { > if (sky2_is_copper(hw)) { >@@ -425,21 +426,46 @@ static void sky2_phy_init(struct sky2_hw > /* forced speed/duplex settings */ > ct1000 = PHY_M_1000C_MSE; > >- if (sky2->duplex == DUPLEX_FULL) >- ctrl |= PHY_CT_DUP_MD; >+ /* Disable auto update for duplex flow control and speed */ >+ reg |= GM_GPCR_AU_ALL_DIS; > > switch (sky2->speed) { > case SPEED_1000: > ctrl |= PHY_CT_SP1000; >+ reg |= GM_GPCR_SPEED_1000; > break; > case SPEED_100: > ctrl |= PHY_CT_SP100; >+ reg |= GM_GPCR_SPEED_100; > break; > } > >+ if (sky2->duplex == DUPLEX_FULL) { >+ reg |= GM_GPCR_DUP_FULL; >+ ctrl |= PHY_CT_DUP_MD; >+ } else if (sky2->speed != SPEED_1000 && hw->chip_id != CHIP_ID_YUKON_EC_U) { >+ /* Turn off flow control for 10/100mbps */ >+ sky2->rx_pause = 0; >+ sky2->tx_pause = 0; >+ } >+ >+ if (!sky2->rx_pause) >+ reg |= GM_GPCR_FC_RX_DIS; >+ >+ if (!sky2->tx_pause) >+ reg |= GM_GPCR_FC_TX_DIS; >+ >+ /* Forward pause packets to GMAC? */ >+ if (sky2->tx_pause || sky2->rx_pause) >+ sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_ON); >+ else >+ sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); >+ > ctrl |= PHY_CT_RESET; > } > >+ gma_write16(hw, port, GM_GP_CTRL, reg); >+ > if (hw->chip_id != CHIP_ID_YUKON_FE) > gm_phy_write(hw, port, PHY_MARV_1000T_CTRL, ct1000); > >@@ -543,6 +569,7 @@ static void sky2_phy_init(struct sky2_hw > gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover); > > } >+ > /* Enable phy interrupt on auto-negotiation complete (or link up) */ > if (sky2->autoneg == AUTONEG_ENABLE) > gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL); >@@ -582,49 +609,11 @@ static void sky2_mac_init(struct sky2_hw > gm_phy_read(hw, 1, PHY_MARV_INT_MASK) != 0); > } > >- if (sky2->autoneg == AUTONEG_DISABLE) { >- reg = gma_read16(hw, port, GM_GP_CTRL); >- reg |= GM_GPCR_AU_ALL_DIS; >- gma_write16(hw, port, GM_GP_CTRL, reg); >- gma_read16(hw, port, GM_GP_CTRL); >- >- switch (sky2->speed) { >- case SPEED_1000: >- reg &= ~GM_GPCR_SPEED_100; >- reg |= GM_GPCR_SPEED_1000; >- break; >- case SPEED_100: >- reg &= ~GM_GPCR_SPEED_1000; >- reg |= GM_GPCR_SPEED_100; >- break; >- case SPEED_10: >- reg &= ~(GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100); >- break; >- } >- >- if (sky2->duplex == DUPLEX_FULL) >- reg |= GM_GPCR_DUP_FULL; >- >- /* turn off pause in 10/100mbps half duplex */ >- else if (sky2->speed != SPEED_1000 && >- hw->chip_id != CHIP_ID_YUKON_EC_U) >- sky2->tx_pause = sky2->rx_pause = 0; >- } else >- reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL; >- >- if (!sky2->tx_pause && !sky2->rx_pause) { >- sky2_write32(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); >- reg |= >- GM_GPCR_FC_TX_DIS | GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; >- } else if (sky2->tx_pause && !sky2->rx_pause) { >- /* disable Rx flow-control */ >- reg |= GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; >- } >- >- gma_write16(hw, port, GM_GP_CTRL, reg); >- > sky2_read16(hw, SK_REG(port, GMAC_IRQ_SRC)); > >+ /* Enable Transmit FIFO Underrun */ >+ sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), GMAC_DEF_MSK); >+ > spin_lock_bh(&sky2->phy_lock); > sky2_phy_init(hw, port); > spin_unlock_bh(&sky2->phy_lock); >@@ -1541,40 +1530,10 @@ static void sky2_link_up(struct sky2_por > unsigned port = sky2->port; > u16 reg; > >- /* Enable Transmit FIFO Underrun */ >- sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), GMAC_DEF_MSK); >- >- reg = gma_read16(hw, port, GM_GP_CTRL); >- if (sky2->autoneg == AUTONEG_DISABLE) { >- reg |= GM_GPCR_AU_ALL_DIS; >- >- /* Is write/read necessary? Copied from sky2_mac_init */ >- gma_write16(hw, port, GM_GP_CTRL, reg); >- gma_read16(hw, port, GM_GP_CTRL); >- >- switch (sky2->speed) { >- case SPEED_1000: >- reg &= ~GM_GPCR_SPEED_100; >- reg |= GM_GPCR_SPEED_1000; >- break; >- case SPEED_100: >- reg &= ~GM_GPCR_SPEED_1000; >- reg |= GM_GPCR_SPEED_100; >- break; >- case SPEED_10: >- reg &= ~(GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100); >- break; >- } >- } else >- reg &= ~GM_GPCR_AU_ALL_DIS; >- >- if (sky2->duplex == DUPLEX_FULL || sky2->autoneg == AUTONEG_ENABLE) >- reg |= GM_GPCR_DUP_FULL; >- > /* enable Rx/Tx */ >+ reg = gma_read16(hw, port, GM_GP_CTRL); > reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA; > gma_write16(hw, port, GM_GP_CTRL, reg); >- gma_read16(hw, port, GM_GP_CTRL); > > gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); > >@@ -1628,7 +1587,6 @@ static void sky2_link_down(struct sky2_p > reg = gma_read16(hw, port, GM_GP_CTRL); > reg &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA); > gma_write16(hw, port, GM_GP_CTRL, reg); >- gma_read16(hw, port, GM_GP_CTRL); /* PCI post */ > > if (sky2->rx_pause && !sky2->tx_pause) { > /* restore Asymmetric Pause bit */ >@@ -1645,6 +1603,7 @@ static void sky2_link_down(struct sky2_p > > if (netif_msg_link(sky2)) > printk(KERN_INFO PFX "%s: Link is down.\n", sky2->netdev->name); >+ > sky2_phy_init(hw, port); > } > >@@ -1685,8 +1644,11 @@ static int sky2_autoneg_done(struct sky2 > sky2->rx_pause = (aux & PHY_M_PS_RX_P_EN) != 0; > sky2->tx_pause = (aux & PHY_M_PS_TX_P_EN) != 0; > >- if ((sky2->tx_pause || sky2->rx_pause) >- && !(sky2->speed < SPEED_1000 && sky2->duplex == DUPLEX_HALF)) >+ if (sky2->duplex == DUPLEX_HALF && sky2->speed != SPEED_1000 >+ && hw->chip_id != CHIP_ID_YUKON_EC_U) >+ sky2->rx_pause = sky2->tx_pause = 0; >+ >+ if (sky2->rx_pause || sky2->tx_pause) > sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_ON); > else > sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); >@@ -1712,7 +1674,7 @@ static void sky2_phy_intr(struct sky2_hw > printk(KERN_INFO PFX "%s: phy interrupt status 0x%x 0x%x\n", > sky2->netdev->name, istatus, phystat); > >- if (istatus & PHY_M_IS_AN_COMPL) { >+ if (sky2->autoneg == AUTONEG_ENABLE && (istatus & PHY_M_IS_AN_COMPL)) { > if (sky2_autoneg_done(sky2, phystat) == 0) > sky2_link_up(sky2); > goto out; >@@ -2906,7 +2868,6 @@ static int sky2_set_pauseparam(struct ne > struct ethtool_pauseparam *ecmd) > { > struct sky2_port *sky2 = netdev_priv(dev); >- int err = 0; > > sky2->autoneg = ecmd->autoneg; > sky2->tx_pause = ecmd->tx_pause != 0; >@@ -2914,7 +2875,7 @@ static int sky2_set_pauseparam(struct ne > > sky2_phy_reinit(sky2); > >- return err; >+ return 0; > } > > static int sky2_get_coalesce(struct net_device *dev,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 144662
:
94781
|
94782
|
94783
| 96764