Re: [PATCH v2] r8169: fix auto speed down issue

From: Francois Romieu
Date: Tue Apr 02 2013 - 17:37:50 EST


Hayes Wang <hayeswang@xxxxxxxxxxx> :
> It would cause no link after suspending or shutdowning when the
> nic changes the speed to 10M and connects to a link partner which
> forces the speed to 100M.
>
> Check the link partner ability to determine which speed to set.
>
> Signed-off-by: Hayes Wang <hayeswang@xxxxxxxxxxx>

Acked-by: Francois Romieu <romieu@xxxxxxxxxxxxx>

I have given it a short sanity testing with suspend or shutdown (no rpm)
on 8168evl or 8168e and it did not seem to regress (8168e and 8168evl).

The driver does not do what it is requested to when the r81xx - not the
link partner - forces the link. Not that it ever did but autonegotiation
will now always end up enabled and nothing will prevent a higher than
expected link speed after that.

It could be worth to check MII_BMCR for BMCR_ANENABLE before anything else
in rtl_speed_down.

[...]
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 28fb50a..bdc03a9 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -3818,6 +3818,30 @@ static void rtl_init_mdio_ops(struct rtl8169_private *tp)
> }
> }
>
> +static void rtl_speed_down(struct rtl8169_private *tp)
> +{
> + u32 adv;
> + int lpa;
^^^^^
Please use a single, true space (no tabs) next time.

--
Ueimor
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/