Message ID | 20230426122805.23301-402-nic_swsd@realtek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp209987vqo; Wed, 26 Apr 2023 05:41:28 -0700 (PDT) X-Google-Smtp-Source: AKy350bXFDk/ty8/HjEzaO6ES5gdd8h446HyQh7lluBMHESy0p7Dp4eVz1lz8lSOzbdBwO1FGC/0 X-Received: by 2002:a05:6a20:8e1b:b0:d9:77f7:d62e with SMTP id y27-20020a056a208e1b00b000d977f7d62emr27776857pzj.36.1682512888297; Wed, 26 Apr 2023 05:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682512888; cv=none; d=google.com; s=arc-20160816; b=zkERZWyMNN3nehUvfYraFQnojXYj/aAArnGGbCmAefW8i31z1PcehfkWXavT4hoWNI FExy05VplUz3PlB/UolpG9KkkxiLpyT8BLFYExM9xS3nKhrvgl8DNlIkZAMwWJEuGxCK lqQXHDJgGJGd+lmEzqLQuwBjOfCCM3nw0Xgv0tHRyd7cBtHtnXs7kNj5ACwVHowC3zNB qmxjwrsDeYBgEF/uKofXTk+ZIpP7yevllwRw/ac75Dbg8iMZkWKWXnSPzjfHCPbOGOgE +fXaSxKgWpo313SIUM2FuRi8GZkw09ZcfP3QT1I6kSE3LgBJ7NkCWkg/vSHsEXWQEzBR iS+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :authenticated-by; bh=BtOjKS9F2dgQZt6bllxbMA473BeBkqWD9YY/lvE4h3c=; b=tENB+78IBzo45rETxB4f3F3xjasJ1adge8iP3YLaYv1pLKgrVnIYyvZPSk25qEY7oB BhwB/vItCB4mEEB3kyAjexNxFdCmHoezMamoftsIavpRHqr5LwNxmWqo7sVDiwSmMMgT /+Df64lthbTnt7xexFePz3FGfgj5UCAo69kp+zYVefWpcPakopyNpZVbJnPiR57UoQPa cPHdVsNwgYiDmBhXueXwlH5/gyYPcfj6TgBU+EOzPhbdKmlwLytRANMb9QvrFlHoLQSG 7aQEKUNERwW0TPIsFV8Q+uzVDsfn1HZvaqLVxK5ayUKJOGNvSP40N3HnasIqfa2nuhVl wqsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14-20020a63580e000000b005137bf7e2d4si16614778pgb.652.2023.04.26.05.41.16; Wed, 26 Apr 2023 05:41:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240861AbjDZM3I (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Wed, 26 Apr 2023 08:29:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240873AbjDZM3F (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Apr 2023 08:29:05 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A5415FCE; Wed, 26 Apr 2023 05:28:58 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 33QCSlRW2006564, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 33QCSlRW2006564 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Wed, 26 Apr 2023 20:28:47 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Wed, 26 Apr 2023 20:28:49 +0800 Received: from fc34.localdomain (172.22.228.98) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 26 Apr 2023 20:28:48 +0800 From: Hayes Wang <hayeswang@realtek.com> To: <kuba@kernel.org>, <davem@davemloft.net> CC: <netdev@vger.kernel.org>, <nic_swsd@realtek.com>, <linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>, Hayes Wang <hayeswang@realtek.com> Subject: [PATCH net 2/3] r8152: fix the poor throughput for 2.5G devices Date: Wed, 26 Apr 2023 20:28:04 +0800 Message-ID: <20230426122805.23301-402-nic_swsd@realtek.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230426122805.23301-400-nic_swsd@realtek.com> References: <20230426122805.23301-400-nic_swsd@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.22.228.98] X-ClientProxiedBy: RTEXH36505.realtek.com.tw (172.21.6.25) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764242634067561722?= X-GMAIL-MSGID: =?utf-8?q?1764242634067561722?= |
Series |
r8152: fix 2.5G devices
|
|
Commit Message
Hayes Wang
April 26, 2023, 12:28 p.m. UTC
Fix the poor throughput for 2.5G devices, when changing the speed from
auto mode to force mode. This patch is used to notify the MAC when the
mode is changed.
Fixes: 195aae321c82 ("r8152: support new chips")
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/usb/r8152.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Comments
On Wed, Apr 26, 2023 at 08:28:04PM +0800, Hayes Wang wrote: > Fix the poor throughput for 2.5G devices, when changing the speed from > auto mode to force mode. This patch is used to notify the MAC when the > mode is changed. > > Fixes: 195aae321c82 ("r8152: support new chips") > Signed-off-by: Hayes Wang <hayeswang@realtek.com> > --- > drivers/net/usb/r8152.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c > index 08d1786135f2..3ecd4651ae29 100644 > --- a/drivers/net/usb/r8152.c > +++ b/drivers/net/usb/r8152.c > @@ -7554,6 +7554,11 @@ static void r8156_hw_phy_cfg(struct r8152 *tp) > ((swap_a & 0x1f) << 8) | > ((swap_a >> 8) & 0x1f)); > } > + > + /* set intr_en[3] */ > + data = ocp_reg_read(tp, 0xa424); > + data |= BIT(3); > + ocp_reg_write(tp, 0xa424, data); Please add #define for 0xa424. And a #define for BIT(3), just to document what bit 3 is. Once we understand what bit 3 is, we might then understand why this change makes 2.5G perform better. At the moment all i see is magic. Andrew
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 08d1786135f2..3ecd4651ae29 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -7554,6 +7554,11 @@ static void r8156_hw_phy_cfg(struct r8152 *tp) ((swap_a & 0x1f) << 8) | ((swap_a >> 8) & 0x1f)); } + + /* set intr_en[3] */ + data = ocp_reg_read(tp, 0xa424); + data |= BIT(3); + ocp_reg_write(tp, 0xa424, data); break; default: break; @@ -7949,6 +7954,11 @@ static void r8156b_hw_phy_cfg(struct r8152 *tp) break; } + /* set intr_en[3] */ + data = ocp_reg_read(tp, 0xa424); + data |= BIT(3); + ocp_reg_write(tp, 0xa424, data); + if (rtl_phy_patch_request(tp, true, true)) return;