Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713AbcCHXtJ (ORCPT ); Tue, 8 Mar 2016 18:49:09 -0500 Received: from violet.fr.zoreil.com ([92.243.8.30]:57640 "EHLO violet.fr.zoreil.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbcCHXtG (ORCPT ); Tue, 8 Mar 2016 18:49:06 -0500 Date: Wed, 9 Mar 2016 00:48:55 +0100 From: Francois Romieu To: Chunhao Lin Cc: netdev@vger.kernel.org, nic_swsd@realtek.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] r8169:Remove unnecessary phy reset for pcie nic when setting link spped. Message-ID: <20160308234855.GA6182@electric-eye.fr.zoreil.com> References: <1457427065-3699-1-git-send-email-hau@realtek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457427065-3699-1-git-send-email-hau@realtek.com> X-Organisation: Land of Sunshine Inc. User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1604 Lines: 42 Chunhao Lin : > For pcie nic, after setting link speed and thers is no link driver does not need > to do phy reset untill link up. > > For some pcie nics, to do this will also reset phy speed down counter and prevent > phy from auto speed down. > > This patch fix the issue reported in following link. > https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1547151 > > Signed-off-by: Chunhao Lin > --- > drivers/net/ethernet/realtek/r8169.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c > index dd2cf37..94f08f1 100644 > --- a/drivers/net/ethernet/realtek/r8169.c > +++ b/drivers/net/ethernet/realtek/r8169.c > @@ -1999,7 +1999,8 @@ static int rtl8169_set_speed(struct net_device *dev, > goto out; > > if (netif_running(dev) && (autoneg == AUTONEG_ENABLE) && > - (advertising & ADVERTISED_1000baseT_Full)) { > + (advertising & ADVERTISED_1000baseT_Full) && > + !pci_is_pcie(tp->pci_dev)) { > mod_timer(&tp->timer, jiffies + RTL8169_PHY_TIMEOUT); > } > out: Can you clarify: - actually this patch does not care about the link at all. So when there's link no phy reset is needed either, right ? - does "this" in "to do this" means that 1. phy reset prevents phy from auto speed down 2. avoiding phy reset prevents phy from auto speed down I would expect 1. from the rtl_wol_pll_power_down + rtl_speed_down + rtl8169_set_speed combo (i.e. we want the driver to allow auto speed down) but it's a bit ambiguous. -- Ueimor