Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3931587imm; Mon, 8 Oct 2018 11:53:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV61fPMc2WH58hIgALUQEQQW0o8gLzp/okQeuNGf7Je1uu8bSXcoBjFkcKFuvD593rXIBY1d+ X-Received: by 2002:a62:7604:: with SMTP id r4-v6mr26665259pfc.230.1539024835820; Mon, 08 Oct 2018 11:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024835; cv=none; d=google.com; s=arc-20160816; b=bie9dDhUUIq+dikrICsts1M6451mtqEtM+FCbZcBAoPUps7bvJ+ggPIUYmzGdA7J5p llJha6fGp7lB5DBeFqf8YCbaFfZ+jRWee8wQAmH8N7AMMJ19A+X4wHwa2S8a11jDTAmf k7Oty4wC1B8eGaC85OXiCkJ8c2zFYjAT4kiYA87JIGm4XY9gZimxVwxwBDLmuEjgz28P Nuyv1dZkhOTuETZEYb46ujlXTqtqHpd8SxVpAmRZSciwJKsHOmXM4a0Fdf3X0X1kLZJe Mqvjm+pEAc8+Z6sA5zNqEB+6nHhgKV+MmppCVlWrkp/VGbBe86Fzc43CYA3i0fAAXqdd s8nQ== 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:dkim-signature; bh=fzYryEnzL0H6c58PmpQ6Siec8fosows//igwp3IPRGA=; b=bjhLjNMsel1jVWPD7LFkINgABW+6kwPRAQzSv+LMirqNGobZxPwYt17KoMdvl3C5ZV xZzcGKRc7BLjnUUa8cF4D0nRMO1//yvQ1cugPY9yM7ujB9k+D+HG8ndhVj6/lW18vrw3 htIfFIqOsWHIXAD0Ue49/rC12gtJrsHvopQ1NPnw2SQavYON7TJLjeVqCe6OLbO+dZwY 6WmmwC5oZawafynq9MwZaMWg8A+gJq0J6f+ENRjeFQakYZt45UCXxaR+1YIElABVhBw1 cxLNcwcgZOyofbf8oJAe8yTbPebSrhJAj5Jw/NoCn1rCKeFVxr8MoHpUROa+v1os3nZ6 O0MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="UFYn/18p"; 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 d4-v6si17947909pgj.341.2018.10.08.11.53.40; Mon, 08 Oct 2018 11:53:55 -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; dkim=pass header.i=@kernel.org header.s=default header.b="UFYn/18p"; 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 S1732531AbeJICFe (ORCPT + 99 others); Mon, 8 Oct 2018 22:05:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:55650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727260AbeJICFd (ORCPT ); Mon, 8 Oct 2018 22:05:33 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D5378204FD; Mon, 8 Oct 2018 18:52:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024745; bh=9xffiSMTodUJjcO54gQ3DOSR8zQkHAkqUFO+j4bCyXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UFYn/18pIKo6tgoEUx7frfrXng3pT8gqAV1y7Xe8QYQuuORNdio8TR9uXvF/ueyz/ P1pPgfjXAgElnBqAEpadQrM8WEGMJPWUymaAFi2206vw9k7i6KAqtx7IXxEvKKQoHJ 6uWB9q5113aOTl3LjT/y6ctGKVRLgYQCeXBHlEps= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Maciej S. Szmigiero" , "David S. Miller" , Sasha Levin Subject: [PATCH 4.18 116/168] r8169: set TxConfig register after TX / RX is enabled, just like RxConfig Date: Mon, 8 Oct 2018 20:31:36 +0200 Message-Id: <20181008175624.455342059@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@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: "Maciej S. Szmigiero" [ Upstream commit f74dd480cf4e31e12971c58a1d832044db945670 ] Commit 3559d81e76bf ("r8169: simplify rtl_hw_start_8169") changed order of two register writes: 1) Caused RxConfig to be written before TX / RX is enabled, 2) Caused TxConfig to be written before TX / RX is enabled. At least on XIDs 10000000 ("RTL8169sb/8110sb") and 18000000 ("RTL8169sc/8110sc") such writes are ignored by the chip, leaving values in these registers intact. Change 1) was reverted by commit 05212ba8132b42 ("r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices"), however change 2) wasn't. In practice, this caused TxConfig's "InterFrameGap time" and "Max DMA Burst Size per Tx DMA Burst" bits to be zero dramatically reducing TX performance (in my tests it dropped from around 500Mbps to around 50Mbps). This patch fixes the issue by moving TxConfig register write a bit later in the code so it happens after TX / RX is already enabled. Fixes: 05212ba8132b42 ("r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices") Signed-off-by: Maciej S. Szmigiero Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/realtek/r8169.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -5150,13 +5150,13 @@ static void rtl_hw_start(struct rtl8169 rtl_set_rx_max_size(tp); rtl_set_rx_tx_desc_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_tx_config_registers(tp); rtl_set_rx_mode(tp->dev); /* no early-rx interrupts */