Received: by 10.223.176.5 with SMTP id f5csp694486wra; Fri, 9 Feb 2018 05:49:56 -0800 (PST) X-Google-Smtp-Source: AH8x2255HXBEUnB+86hIHaEe8Hy5dT8O05ySmnfkDoEvIMPQByO3/hc9NWEG0ThcNqHQkA1aB1YC X-Received: by 10.98.186.18 with SMTP id k18mr2951409pff.115.1518184196591; Fri, 09 Feb 2018 05:49:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518184196; cv=none; d=google.com; s=arc-20160816; b=pVZC+3hY10klSvVRKA9Vc4p20qMNpWbDKjv0A6a3efBOd64OtPgioL6Zeeh7qce07u Ic2YfVguzkiMceNhdgdTn/37U+O7lVftf2Y2iEKPEHLPY7uAr42K0Oi0392BqkIqH+GK ZThj8WFK101CnAOufe+XUlO0CpglldxjuFjHQ2DMGfejJtleONXdfiNN5YxQdM4U4u6a 3zGpsfOKRKSRMKvJH5jhFIShfea1UZGXg2gqK0VTXxbn0S0DLDvIziugV7WnNnw14zqS eQa0/si3M8k5myfJwZGDNUgRSjgUmRdAaOvY6myeSPYxZs3jEN5j2/ZuL/n9tLeUqcHW ai8w== 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=Wn1KvWeC1+HEiHHcvEksPqi6dzYQwjW10rmyVJO32Gw=; b=xwLR8j8t1HsGaDZ3xSwio8OB+55z4wreJqfvsEY63zoutpMZakSBd/zdzJFY30rXKN VzpG+DuOcOvF6dIuMsAsR+BUOApfXF1FwAKzWSCr1zsjLj3SyEj5SuhlvosSFos1PODq KqCqKGT+16HOtNkFk09qiCYnz2Yd42++H+zJWaKttVqnHlT3TByCzwxlLg5FZTJFNTKX tr47Ng+pXtcRA3RBacKfugi+3mIS1Y//ccVnHZoYvYlAH+08PWaQP4Y6EKDqP50yDpw9 htEefijk3Duq3BaEUTmbOikGOI/cRM/omdv0jb1XqCU1gviSy35YmuDBAU2o5j7HOEMu lFDA== 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 61-v6si1608734plz.417.2018.02.09.05.49.42; Fri, 09 Feb 2018 05:49: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 S1753923AbeBINrE (ORCPT + 99 others); Fri, 9 Feb 2018 08:47:04 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:53552 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752387AbeBINrB (ORCPT ); Fri, 9 Feb 2018 08:47:01 -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 C0D93E72; Fri, 9 Feb 2018 13:47:00 +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 4.15 05/23] r8169: fix RTL8168EP take too long to complete driver initialization. Date: Fri, 9 Feb 2018 14:40:03 +0100 Message-Id: <20180209133938.643166383@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133938.366024920@linuxfoundation.org> References: <20180209133938.366024920@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 4.15-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 @@ -1395,7 +1395,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 rtl8168ep_stop_cmac(struct rtl8169_private *tp) @@ -1403,7 +1403,7 @@ static void rtl8168ep_stop_cmac(struct r 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); }