From patchwork Mon May 7 19:11:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 909895 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jwJKedrw"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40fsft736Vz9s2k for ; Tue, 8 May 2018 05:11:34 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752601AbeEGTLc (ORCPT ); Mon, 7 May 2018 15:11:32 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:35170 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752335AbeEGTLb (ORCPT ); Mon, 7 May 2018 15:11:31 -0400 Received: by mail-wr0-f172.google.com with SMTP id i14-v6so26669083wre.2 for ; Mon, 07 May 2018 12:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=TBmwN91FZw6Fpd7YBuqLk5xBUYHzPZOvqPJgJ5RkFVQ=; b=jwJKedrwd62t8zhZm6ugfU+FfMP1AMbjtcIwtdHrw4cF9RsLpMjOGFTtWgQza4AM4H 1C6geRrAMVGZ8JuFxoZ8nlBycCmBYi7YQPjXuY1aQd0ei83IfIpZv4WkDZQW98G/DeFg jgKw7M0ZYWIpZlmuaGtcWfN/C4cniZvx6BX1fGRZ1OswZUS+5TTh4VctqVoJot2cVmxz xlr9d4S9jy46CzCSXxAlr374+ufZH1x9RZ1RqVHODFCOVpCqQ62hcvNOtMvYmrXvvEPw ISWis0D879IrJxwRJf14wLL6W34RsQulnH2I1OeH6FCVURXtyfXj5Ycv3o5FeppCYRUg OMyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=TBmwN91FZw6Fpd7YBuqLk5xBUYHzPZOvqPJgJ5RkFVQ=; b=ieFFBkaq9d8p973TOToeXEqassVF8o6pH6R66pLHmk5pVXVNs5rLIKbvg5yBwyy77C 5ixZ/s+5O0Mmxdiwp0hjo52O+yRjxoGoKbRwIef2ce32l9xL+z9T2xJq1Rcc+iguIB32 +nbBxSyq+6F2AAH5lx71eRULuRBpKOL+FMFxTF680HIH3iHnm80Fwrc41HUuiOjB5Evm BDAm2gsL+JnifQAA/n6QmbiTPH3laGsqnLQkq9l6uwad2uQs0nO+u34K4nH9ztx5Rwtb wVgpgKgL32VgUP8YBk7nPCYB60T87rN1vQIBfyYT4b0TS2rbTOD+lMvXkF/nCtkqg1w+ GENg== X-Gm-Message-State: ALQs6tA8+WIz7SIFHo0xCXBDtfdYvm225RODmqu3eiGhNP+aGO1MGhWR FmKsCs6xKC86GPb/abtbNU79Ow== X-Google-Smtp-Source: AB8JxZqA2nEYGx1XdBt6itimsYLnIrLVcCjtSxsemL1R5/51GF0oa4bXmHjlf5YIaWBHelrB0PGtSA== X-Received: by 2002:adf:b11a:: with SMTP id l26-v6mr18718183wra.258.1525720289813; Mon, 07 May 2018 12:11:29 -0700 (PDT) Received: from ?IPv6:2003:ea:8bd4:3d00:841d:1e6e:301b:87fd? (p200300EA8BD43D00841D1E6E301B87FD.dip0.t-ipconnect.de. [2003:ea:8bd4:3d00:841d:1e6e:301b:87fd]) by smtp.googlemail.com with ESMTPSA id o9-v6sm25252736wrn.74.2018.05.07.12.11.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 May 2018 12:11:29 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH net] r8169: fix powering up RTL8168h To: David Miller , Realtek linux nic maintainers Cc: Slava Kardakov , "netdev@vger.kernel.org" Message-ID: Date: Mon, 7 May 2018 21:11:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Since commit a92a08499b1f "r8169: improve runtime pm in general and suspend unused ports" interfaces w/o link are runtime-suspended after 10s. On systems where drivers take longer to load this can lead to the situation that the interface is runtime-suspended already when it's initially brought up. This shouldn't be a problem because rtl_open() resumes MAC/PHY. However with at least one chip version the interface doesn't properly come up, as reported here: https://bugzilla.kernel.org/show_bug.cgi?id=199549 The vendor driver uses a delay to give certain chip versions some time to resume before starting the PHY configuration. So let's do the same. I don't know which chip versions may be affected, therefore apply this delay always. This patch was reported to fix the issue for RTL8168h. I was able to reproduce the issue on an Asus H310I-Plus which also uses a RTL8168h. Also in my case the patch fixed the issue. Reported-by: Slava Kardakov Tested-by: Slava Kardakov Signed-off-by: Heiner Kallweit --- This patch will not apply to net-next as it conflicts with other changes which have been done in the meantime. So I'll send a separate patch for net-next. --- drivers/net/ethernet/realtek/r8169.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 604ae783..c7aac1fc 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -4981,6 +4981,9 @@ static void rtl_pll_power_down(struct rtl8169_private *tp) static void rtl_pll_power_up(struct rtl8169_private *tp) { rtl_generic_op(tp, tp->pll_power_ops.up); + + /* give MAC/PHY some time to resume */ + msleep(20); } static void rtl_init_pll_power_ops(struct rtl8169_private *tp)