From: netdev-bot+sashiko@kernel.org
To: hsu.chih.kai@realtek.com
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
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 [thread overview]
Message-ID: <179610756459.3146.11487341417182303879@kernel.org> (raw)
In-Reply-To: <20261130063123.2408-5-nic_swsd@realtek.com>
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
next prev parent reply other threads:[~2026-12-01 6:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 6:31 [PATCH net-next v10 00/12] r8152: refactor and extend RTL8157/8159 support Chih Kai Hsu
2026-11-30 6:31 ` [PATCH net-next v10 01/12] r8152: fix RTL8156/RTL8156B/RTL8157/RTL8159 up and down settings Chih Kai Hsu
2026-12-01 6:45 ` netdev-bot+sashiko
2026-11-30 6:31 ` [PATCH net-next v10 02/12] r8152: add rtl8157_unload() for RTL8157 and RTL8159 Chih Kai Hsu
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:31 ` [PATCH net-next v10 03/12] r8152: add rtl8157_change_mtu() " Chih Kai Hsu
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:31 ` [PATCH net-next v10 04/12] r8152: fix flow control for RTL8156/RTL8156B/RTL8157/RTL8159 Chih Kai Hsu
2026-12-01 6:46 ` netdev-bot+sashiko [this message]
2026-11-30 6:31 ` [PATCH net-next v10 05/12] r8152: split r8156_init by generation and factor out wait_autoload_done Chih Kai Hsu
2026-11-30 6:31 ` [PATCH net-next v10 06/12] r8152: add new init writes for RTL8156/8156B/8157/8159 Chih Kai Hsu
2026-11-30 6:31 ` [PATCH net-next v10 07/12] r8152: accept PLA and USB firmware blocks for RTL8157 and RTL8159 Chih Kai Hsu
2026-11-30 6:31 ` [PATCH net-next v10 08/12] r8152: split RTL_VER_17 into QFN68 and QFN100 package variants Chih Kai Hsu
2026-12-01 6:46 ` netdev-bot+sashiko
2026-12-01 12:14 ` Chih Kai Hsu
2026-11-30 6:31 ` [PATCH net-next v10 09/12] r8152: split rtl8156_enable/up/down into per-generation functions Chih Kai Hsu
2026-11-30 6:31 ` [PATCH net-next v10 10/12] r8152: split r8157_hw_phy_cfg into RTL8157 and RTL8159 variants Chih Kai Hsu
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:31 ` [PATCH net-next v10 11/12] r8152: add TGPHY register access for RTL8157 and RTL8159 Chih Kai Hsu
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:31 ` [PATCH net-next v10 12/12] r8152: enable UPS for RTL8157 and RTL8159 QFN68 Chih Kai Hsu
2026-12-01 6:46 ` netdev-bot+sashiko
2026-12-01 12:21 ` Chih Kai Hsu
2026-11-30 6:35 ` [PATCH net-next v10 00/12] r8152: refactor and extend RTL8157/8159 support netdev-bot+sinfo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179610756459.3146.11487341417182303879@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bjorn@mork.no \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hsu.chih.kai@realtek.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mail@birger-koblitz.de \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®