๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25010

Re: [PATCH net-next v10 04/12] r8152: fix flow control for RTL8156/RTL8156B/RTL8157/RTL8159

#25010
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 06:46
128 lines
11872 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] Three fixes with different stable targets are packed into one
  patch and one helper, rtl_fc_pause_pkt_en() in drivers/net/usb/r8152.c.

--

r8152: fix flow control for RTL8156/RTL8156B/RTL8157/RTL8159

This patch moves the flow-control setup for RTL8156, RTL8156B, RTL8157
and RTL8159 into a new helper, rtl_fc_pause_pkt_en(). It adds the
missing FC timer and FLOW_CTRL_PATCH_OPT setup for RTL8156A. It also
programs a new PLA_PAUSE_LIMIT register on RTL8157/RTL8159 from
rtl8156_enable(), based on the link speed.

> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 1517753f843ef..e58b010c734ad 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c

[ ... ]

> @@ -5961,6 +5966,105 @@ static void r8152b_enter_oob(struct r8152 *tp)
>  			   RCR_APM | RCR_AM | RCR_AB);
>  }
>  
> +static void rtl_fc_pause_pkt_en(struct r8152 *tp, u16 speed)
> +{
> +	int log2_ratio, ratio;
> +	u16 num_pause_pkts;
> +	u32 ocp_data;
> +
> +	switch (tp->version) {
> +	case RTL_VER_10:
> +	case RTL_VER_11:
> +		ocp_write_word(tp, MCU_TYPE_USB, USB_FC_TIMER,
> +			       CTRL_TIMER_EN | (1000 / 8));
> +
> +		ocp_word_set_bits(tp, MCU_TYPE_USB, USB_FW_CTRL,
> +				  FLOW_CTRL_PATCH_OPT);
> +
> +		ocp_word_set_bits(tp, MCU_TYPE_USB, USB_FW_TASK, FC_PATCH_TASK);
> +		break;
> +	case RTL_VER_12:
> +	case RTL_VER_13:
> +	case RTL_VER_15:
> +		ocp_word_clr_bits(tp, MCU_TYPE_PLA, PLA_RCR, SLOT_EN);

[ ... ]

> +	case RTL_VER_16:
> +	case RTL_VER_17:
> +		ocp_word_clr_bits(tp, MCU_TYPE_PLA, PLA_RCR, SLOT_EN);

[ ... ]

> @@ -6404,6 +6508,10 @@ static int rtl8156_enable(struct r8152 *tp)
>  	r8153_set_rx_early_size(tp);
>  
>  	speed = rtl8152_get_speed(tp);
> +
> +	if (tp->version >= RTL_VER_16)
> +		rtl_fc_pause_pkt_en(tp, speed);
> +
>  	rtl_set_ifg(tp, speed);
>  
>  	if (tp->version >= RTL_VER_16)

[ ... ]

> @@ -8490,22 +8598,12 @@ static void r8156_init(struct r8152 *tp)
>  
>  	usb_enable_lpm(tp->udev);
>  
> -	if (tp->version >= RTL_VER_12 && tp->version <= RTL_VER_15) {

[ ... ]

> +	if (tp->version < RTL_VER_16)
> +		rtl_fc_pause_pkt_en(tp, 0);

[Severity: Low]

This isn't a runtime bug, but would stable have an easier time if this
patch were split up?

rtl_fc_pause_pkt_en() combines three separate changes:

  - the RTL8156A (RTL_VER_10/11) FC timer and FLOW_CTRL_PATCH_OPT setup.
    r8156_init() has lacked it since 195aae321c82 ("r8152: support new
    chips").

  - the new PLA_PAUSE_LIMIT and SLOT_EN setup for RTL8157/RTL8159
    (RTL_VER_16/17). These chips only exist after fd3c7d080df5 and
    ad2a55b63b41.

  - an unchanged move of the RTL8156B (RTL_VER_12/13/15) sequence.

Stable trees picked by Fixes: 195aae321c82 don't have RTL_VER_16/17,
PLA_PAUSE_LIMIT, or the RTL_VER_16 handling in rtl8156_enable() that the
new call sits next to. The patch would not apply there. Someone would
have to split out the RTL8156A part by hand.

The RTL8156A fix is just the VER_10/11 case plus the new
rtl_fc_pause_pkt_en(tp, 0) call in r8156_init(). Could that go in its
own patch with Fixes: 195aae321c82? The VER_16/17 pause limit would then
be a separate patch with Fixes: fd3c7d080df5 / ad2a55b63b41. The
refactor into a common helper could come first, or be dropped.

Later patches in this series, such as "r8152: split r8156_init by
generation and factor out wait_autoload_done", keep the combined helper.
So this doesn't seem to be resolved later in the series.

Also, the subject says:

  r8152: fix flow control for RTL8156/RTL8156B/RTL8157/RTL8159

The commit message says the VER_12/13/15 sequence is "moved here
unchanged", so no RTL8156B behavior seems to change. Should RTL8156B be
removed from the subject?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130063123.2408-1-nic_swsd%40realtek.com
Technical Details
Message-ID: <179610756459.3146.11487341417182303879@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374750-linux-kernel-netdev=dewy.ru
References: <20261130063123.2408-5-nic_swsd@realtek.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374750-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v10 04/12] r8152: fix flow control for RTL8156/RTL8156B/RTL8157/RTL8159
Date: Tue, 01 Dec 2026 06:46:04 +0000
Organization: Usenet Network
Message-ID: <179610756459.3146.11487341417182303879@kernel.org>
References: <20261130063123.2408-5-nic_swsd@realtek.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1639285"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:CwxSTZDRlmV54ivm/jc3+qWzaQU= sha256:uY07EMrnWnrt7ikG38WEaR3UAkc7omBG9ykw9aJvKcU= sha1:DfO7JLg/jDqeBHFjRUZk0sfbY5w= sha256:Y9HW4f5C5FnvFY6RhKuUGmTr9638Kd5MkXcNvMkOASQ=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 1C79C117274; Tue,  1 Dec 2026 09:46:36 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UnlcmWhNNkQk; Tue,  1 Dec 2026 09:46:32 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374750-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id D95C911726F; Tue,  1 Dec 2026 09:46:20 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id B99C427AE9; Tue,  1 Dec 2026 06:46:09 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796107567; b=2nVFYhiIf+02cTcD8WGUkAcfg9r9BftcZ9peQazPgnQDbGMsnzUr0kjp5USpx9CwIexo PzZxO4vfa5yuGvy+0np+DK3xkkAMg2QuKTB3s9XC8TJmQlH6KTSUo7wK/4anyVcEvJUQ6 QTbam0h+m3QeFofl0lozDXieS39qewIOBrL5Ct4norOfAPEIGRslmYLom0DJ6RJi3I87/ /6iNnCOzPV0T/WZpeuCr2f4tnbmvG5E9C7g5MTsdDVvCiHZfJNPu89ZPftWY/asKy7aLs 8pvFwEUkNKW0odTntASxB1PN1h2iJ8i6U4ZvV76KWNAcO4tWseSHcuNgngPzsR2znDQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107567; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=0dAHOq0BbEqcdV9kKOcJqmmnvb6eN6S1VW8mZgS4C+k=; b=fvoqtOY58fbaQ0mNTRp87FRrbudFEd27p7lY5tpJ7hMHjid34KHJjU5/zTqtkaXaGOuw g5fruB55xmLiuKzH9wKIgBP6kCxBjU9j6ZuRqRB/IsN/ha2FVikcKHtTNkg4I47EIQOaw mhIl4XB7JC5SSmKyhzCyWsFWdP40yo4Cudf2ayBHnHEdlDKx6RCphktA9SEfR5iIOJABv w9Dv8/uNzG6KayjSJdIJTDlsQYUprehRIvivNZdVOg0E7tG/oEAqMuoksvJI2Qx/PWSrV k4Q1Y+fSEP0nbenzcWrN+7VTjNcXt3GveiiG+6eeuc2mowR41KlVXrG2OqLYGrg0IJQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=g8KK6EFx; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37949606A698; Tue,  1 Dec 2026 06:46:07 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=g8KK6EFx
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796107566; b=T9YdJBf6diqjb3sBHpRqSSJXHg5bGaPsHb+xP5o7PSFGTSDQH/44RCjMH7C6DuXrllpF 4iGmm7MPYULkO1LN70iqg2hQLSlhQrbJqmj7AW7U1w8XvDWNs6HFNoVR9bGDqthD6NU+O 8JZ31Ux/zFuaEeiVRLBBNiGXjlkRJIaJ+UMh35IAckZQWPJpeMkwgLSDILMRhTUZGu1In P20Xi8jHmKCBBl8KqzmX1PfH4UNtPN4tkdADvB/8mCOviTQit98LL/Rr5/2NObTo6sQ9P CsLSuim3CrUyPsJqhkt5zL6yaeYsCbtiJ+1imwY7Ym6G+yAQ93GM2xSXNMjyWEEvP0g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107566; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=0dAHOq0BbEqcdV9kKOcJqmmnvb6eN6S1VW8mZgS4C+k=; b=JL7Bs08NoQmp7+G1yLfoCWgbgXXmlqHlhCr/z4kJa/YWAES/f1V/Jg7gPQKvkrpLFap8 1ETvdO5+MSjrO1J+dx1OPu7d5GnNYCsX9qZjqKuqsARD+cmCvlfHwl02a3ri6ZcMa6jjv lDFXn77i/hEyxpCjZ7H75sOqcWpIem02RYGt9x4GLreoqkpOqpgJ8bE1R0i19ckEOK8C/ JRdUCvo5dP3KJ5wxY3ChDbxjsLTsqbaa9iDqvbCXFmI/IWZIokeesFZIFA+7RR08YELS5 9xFycrsLXr+uXFr7HksFYVgtzPWiDSfU4uvQLGRzg7CzmRQPAH6ZLQq2knqaoW+PCzA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=g8KK6EFx; arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A0EF606A33B; Tue,  1 Dec 2026 06:46:06 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1413E1F0089C; Tue,  1 Dec 2026 06:46:05 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796107565; bh=0dAHOq0BbEqcdV9kKOcJqmmnvb6eN6S1VW8mZgS4C+k=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=g8KK6EFxgK6M92gxwY9faJa83iG2R4eLMbaRZXZy6VZTwK2VCDM7xfqrn6+N+DIDP kvbfSdMtrlXbR4RCYPZq7fOJjlpuDPR5sS3levETukdClMj1dUHfZ8L9sUC6qrtThI ESIxANFbwaPhrYX3rUAVecentqPANF46DARwLB4hxRnktdJCBc+U67HBALBBxm4mEz SPf+Wi3D9pBwZA2/0KD6NTRChOP/fXHACl0KBs/L9VE35RJevGjo7bnhXZFLOjk1vV WZiXhTTnrqxWzNpSXn9E/6D4Ag60/lhZUfrMKalL8Mq8WrUQCZyDXzvRypcpqT6ewi /6tot4HEtV5QQ==
X-Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, nic_swsd@realtek.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, edumazet@google.com, bjorn@mork.no, pabeni@redhat.com, andrew+netdev@lunn.ch, mail@birger-koblitz.de
X-In-Reply-To: <20261130063123.2408-5-nic_swsd@realtek.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list