Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp749266imm; Thu, 13 Sep 2018 07:12:20 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb0K2gHXgjntilehfCiKzbhJSxTUDNksfWlg3xKofn3uRuBW49ABx12ncDKMKdlUTsQeN+z X-Received: by 2002:a17:902:3041:: with SMTP id u59-v6mr7377366plb.99.1536847940206; Thu, 13 Sep 2018 07:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847940; cv=none; d=google.com; s=arc-20160816; b=BAdDPch2qKDE/559aoadHlLS1BxvBRscLdFOJI1yca3sci9mkTjBvG46ik3+6DYGC8 3K8336qrjAi855btpwKfLsqfBgT0OlApu5nyyzAc8WYzqZEr7pWX4LBojXvqlOrstgj5 1YSLcw9XlUkSzgRGzyI/WrdKGa9pEBNmF3D9cg1FahsY6FqXFl7kIqs0dFaScigE/WJV /aarS+3kPhcEgeQO/CQ5NeYFPKoyATpAC3Lj4oA6X3ZmGaFIO8PUEAZ+lYeHLJtVbtu4 T8tVc4Ujc9EGozSrxmagpKjA4/pgOPS691OU0IOzEhgx0MHVk2b54ozPHz8eYjcZ7S/y +o/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=lPtM7TffFmuYAQlnjpjcPNhY1RjQoc8nhKy3MqZQkf8=; b=JN5iKfB8lmTF+UjChASR3i7YwTR7Csjv1+KxhUunAROa33KjgFYjvBfi3LkJ86MhCF s5sJIiam/uObLaF2qlSGjd/8ococuMt7ymDoCg15yPzOdXW0w7IBnLR2zyrdmQUcB5qB w2R6t4u8lmm241am9SL+zVwFqLAl/Y5LV3QZREjlGjLMFhmIui8VOemcSrg4nihsT3C8 sHiYmZpi87u8/BJSu2M5ZNQDIc3DtaX6kjcr5PxCOYWFu+lPpWxP+JLP7xcT6pkYxUbq nbOEtuoxwliSulokHRB6wLMH9LLVYEBcbwrUn8OwR7oPIQVxVZNXbsqOuigMlgCwFiqQ DH6A== 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 o66-v6si4221527pfb.125.2018.09.13.07.12.01; Thu, 13 Sep 2018 07:12:20 -0700 (PDT) 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 S1730876AbeIMTBV (ORCPT + 99 others); Thu, 13 Sep 2018 15:01:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33334 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730372AbeIMTBV (ORCPT ); Thu, 13 Sep 2018 15:01:21 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E5EC0D10; Thu, 13 Sep 2018 13:51:45 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , "David S. Miller" , netdev@vger.kernel.org, Realtek linux nic maintainers , Azat Khuzhin Subject: [PATCH 4.18 028/197] r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices Date: Thu, 13 Sep 2018 15:29:37 +0200 Message-Id: <20180913131842.688567279@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Azat Khuzhin [ Upstream commit 05212ba8132b42047ab5d63d759c6f9c28e7eab5 ] I have two Ethernet adapters: r8169 0000:03:01.0 eth0: RTL8169sb/8110sb, 00:14:d1:14:2d:49, XID 10000000, IRQ 18 r8169 0000:01:00.0 eth0: RTL8168e/8111e, 64:66:b3:11:14:5d, XID 2c200000, IRQ 30 And after upgrading from linux 4.15 [1] to linux 4.18+ [2] RTL8169sb failed to receive any packets. tcpdump shows a lot of checksum mismatch. [1]: a0f79386a4968b4925da6db2d1daffd0605a4402 [2]: 0519359784328bfa92bf0931bf0cff3b58c16932 (4.19 merge window opened) I started bisecting and the found that [3] breaks it. According to [4]: "For 8110S, 8110SB, and 8110SC series, the initial value of RxConfig needs to be set after the tx/rx is enabled." So I moved rtl_init_rxcfg() after enabling tx/rs and now my adapter works (RTL8168e works too). [3]: 3559d81e76bfe3803e89f2e04cf6ef7ab4f3aace [4]: e542a2269f232d61270ceddd42b73a4348dee2bb ("r8169: adjust the RxConfig settings.") Also drop "rx" from rtl_set_rx_tx_config_registers(), since it does nothing with it already. Fixes: 3559d81e76bfe3803e89f2e04cf6ef7ab4f3aace ("r8169: simplify rtl_hw_start_8169") Cc: Heiner Kallweit Cc: David S. Miller Cc: netdev@vger.kernel.org Cc: Realtek linux nic maintainers Signed-off-by: Azat Khuzhin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/realtek/r8169.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -5039,7 +5039,7 @@ static void rtl8169_hw_reset(struct rtl8 rtl_hw_reset(tp); } -static void rtl_set_rx_tx_config_registers(struct rtl8169_private *tp) +static void rtl_set_tx_config_registers(struct rtl8169_private *tp) { /* Set DMA burst size and Interframe Gap Time */ RTL_W32(tp, TxConfig, (TX_DMA_BURST << TxDMAShift) | @@ -5150,12 +5150,14 @@ static void rtl_hw_start(struct rtl8169 rtl_set_rx_max_size(tp); rtl_set_rx_tx_desc_registers(tp); - rtl_set_rx_tx_config_registers(tp); + rtl_set_tx_config_registers(tp); RTL_W8(tp, Cfg9346, Cfg9346_Lock); /* Initially a 10 us delay. Turned it into a PCI commit. - FR */ RTL_R8(tp, IntrMask); RTL_W8(tp, ChipCmd, CmdTxEnb | CmdRxEnb); + rtl_init_rxcfg(tp); + rtl_set_rx_mode(tp->dev); /* no early-rx interrupts */ RTL_W16(tp, MultiIntr, RTL_R16(tp, MultiIntr) & 0xf000);