Subject: Re: [RFT] sky2 auto negotiation PHY errata

From: Rob Sims <[email-masked]>
Date: Tue, 20 Feb 2007 11:42:13 -0700

On Fri, Feb 02, 2007 at 11:28:46AM -0800, Stephen Hemminger wrote:
> This patch does the Marvell errata before auto negotiation
> (from drivers/phy/marvell.c).  The Yukon II chips have an internal
> version of the same PHY, so perhaps this errata is necessary for them
> as well.
> 
> For test only, but it may fix some of the hangs. It seems to fix
> the PHY lockups I saw yesterday on Mac Mini.
> 
> ---
>  drivers/net/sky2.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> index 822dd0b..4f04ffa 100644
> --- a/drivers/net/sky2.c
> +++ b/drivers/net/sky2.c
> @@ -387,6 +387,14 @@ static void sky2_phy_init(struct sky2_hw
>  
>  	if (sky2->autoneg == AUTONEG_ENABLE) {
>  		if (sky2_is_copper(hw)) {
> +			/* Errata setup */
> +			gm_phy_write(hw, port, PHY_MARV_PAGE_ADDR, 0x1f);
> +			gm_phy_write(hw, port, PHY_MARV_PAGE_DATA, 0x200c);
> +			gm_phy_write(hw, port, PHY_MARV_PAGE_ADDR, 5);
> +			gm_phy_write(hw, port, PHY_MARV_PAGE_DATA, 0);
> +			gm_phy_write(hw, port, PHY_MARV_PAGE_DATA, 0x100);
> +
> +
>  			if (sky2->advertising & ADVERTISED_1000baseT_Full)
>  				ct1000 |= PHY_M_1000C_AFD;
>  			if (sky2->advertising & ADVERTISED_1000baseT_Half)

With this and the
-       sky2->flow_mode = FC_BOTH;
+       sky2->flow_mode = FC_NONE;
patch applied to the vanilla 2.6.20 kernel, behavior changed from whole
system locks up about once per 4 days to module locks up once per 4 days.
Neither case has any log messages.  Current behavior is "fixed" by a
rmmod/modprobe sequence.  Old behavior requires a hard reset.

Never had an issue with the vendor sk98lin driver.
lspci:
02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8053 PCI-E Gigabit Ethernet Controller (rev 15)
03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8053 PCI-E Gigabit Ethernet Controller (rev 15)

Only 1 controller is in use, and is connected to a Gb switch, though I
also saw issues earlier when hooked to a 100Mb switch.  Motherboard is
an ASUS P5AD2-E-Premium.  I have not tried any of the kernel/module
command line parameters suggested in various sky2 threads.

Just FYI.
-- 
Rob