Received: by 10.223.185.116 with SMTP id b49csp2443075wrg; Thu, 15 Feb 2018 11:37:56 -0800 (PST) X-Google-Smtp-Source: AH8x225y2gOnFeymWHgM+UoYZj8SUOnfohRuyu5kQJfJcpbhpfcRU3naedcRqzH0FrKZXtCnothr X-Received: by 2002:a17:902:a703:: with SMTP id w3-v6mr137469plq.299.1518723476380; Thu, 15 Feb 2018 11:37:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518723476; cv=none; d=google.com; s=arc-20160816; b=0ZMsdP3Fw8cP0hP533E5mkxKVJcxMtEyW0dhCof21eFalF6putlbj+uoeODTAT8cJg R5JDNbwNOX/M64xITD9mS5wI0ofFV7RmK7tf0iEKqSB5YSIK3oT+SRkR6AQWuyheUY9d o1BFpp1FYMBbH9CEVKFoN/c1y8FpayBEIKmxtY8B1IwKhkzFJDNAIkgs6XBpmId1zsft veLQFm9jPXUED4CwkTZfCcV7LFNG8DFcW29f8qjZPYyOx4JNcPP318aOC5xKPggIBPSt +x6QefNxg3MUQrEB6CWjILx+HnVV5fIDPnYYxWUVuikEYVgRUy2zFBmBvGRvSugJu5Tl 9s4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=v8zi7me87yVuRIrp+W0V9bB3mF2h5X1X5airx6IFBUE=; b=j6wLatpave8H7EbAjEUhXq9GkCEtCLWfKIQE4/IWmXwFZDp2cc/S3sUqEqfGTulsiD wcxql4mPP45zL1/oMtd6TRbhGe3U0XmBnH/NVV19BTwYmuCScPuNJsdO7ethtVhgME0Q 0ENpVlL89XETHDyJkIMhRW8p5xkHPgYS8hSSLlHTLwouN3mp6OEMeD49tSg7q/b3AA+g ZITq9cgbQzVwKkLfRfjJ1EXuao2lCfLRTgKj4FuvXyBsgjXEmTc7LMOZSh6p3DkeIZlG IudjbDNbD5eLlwvUBFb0bffCEQVBgAQZnrSOxbKw7TlksixqAGRqPOrnsWwy15d1D1zM tU4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6-v6si3551039plp.562.2018.02.15.11.37.40; Thu, 15 Feb 2018 11:37:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161146AbeBOPSz (ORCPT + 99 others); Thu, 15 Feb 2018 10:18:55 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:47624 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161063AbeBOPSv (ORCPT ); Thu, 15 Feb 2018 10:18:51 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 56EFBFEB; Thu, 15 Feb 2018 15:18:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunhao Lin , "David S. Miller" Subject: [PATCH 3.18 05/45] r8169: fix RTL8168EP take too long to complete driver initialization. Date: Thu, 15 Feb 2018 16:16:56 +0100 Message-Id: <20180215144117.023077476@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215144115.863307741@linuxfoundation.org> References: <20180215144115.863307741@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chunhao Lin [ Upstream commit 086ca23d03c0d2f4088f472386778d293e15c5f6 ] Driver check the wrong register bit in rtl_ocp_tx_cond() that keep driver waiting until timeout. Fix this by waiting for the right register bit. Signed-off-by: Chunhao Lin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/realtek/r8169.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -1375,7 +1375,7 @@ DECLARE_RTL_COND(rtl_ocp_tx_cond) { void __iomem *ioaddr = tp->mmio_addr; - return RTL_R8(IBISR0) & 0x02; + return RTL_R8(IBISR0) & 0x20; } static void rtl8168dp_driver_start(struct rtl8169_private *tp) @@ -1421,7 +1421,7 @@ static void rtl8168ep_driver_stop(struct void __iomem *ioaddr = tp->mmio_addr; RTL_W8(IBCR2, RTL_R8(IBCR2) & ~0x01); - rtl_msleep_loop_wait_low(tp, &rtl_ocp_tx_cond, 50, 2000); + rtl_msleep_loop_wait_high(tp, &rtl_ocp_tx_cond, 50, 2000); RTL_W8(IBISR0, RTL_R8(IBISR0) | 0x20); RTL_W8(IBCR0, RTL_R8(IBCR0) & ~0x01); ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_STOP);