Re: [PATCH net-next v9 01/12] r8152: fix RTL8156/RTL8156B/RTL8157/RTL8159 up and down settings

From: netdev-bot+sashiko

Date: Thu Nov 26 2026 - 23:27:22 EST


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] The commit message of "r8152: fix
RTL8156/RTL8156B/RTL8157/RTL8159 up and down settings" carries three…
- [Low] Six independent register fixes, attributed to three different
original commits, are squashed into one patch.

--

r8152: fix RTL8156/RTL8156B/RTL8157/RTL8159 up and down settings

This commit adjusts rtl8156_up() and rtl8156_down() so that several
datasheet-required register settings are applied to the right
RTL8156-family chip versions. It changes the version gates for PLA_RCR1,
USB_SPEED_OPTION and PLA_MCU_SPDWN_EN and adds Clear_SDR writes. It also
sets ALDPS_PROXY_MODE and DIS_MCU_CLROOB on OOB entry and uses different
OOB RMS/MTPS values for RTL8157/RTL8159.

> Several settings the datasheet requires for these chips were either
> missing or gated on the wrong version range in the shared
> rtl8156_up()/rtl8156_down():

[ ... ]

> Fixes: 195aae321c82 ("r8152: support new chips")
> Fixes: fd3c7d080df5 ("r8152: Add support for the RTL8157 hardware")
> Fixes: ad2a55b63b41 ("r8152: Add support for the RTL8159 chip")

[Severity: Low]
Could the commit message say what goes wrong on real hardware without
these settings?

Each item is justified only as something the datasheet requires. None of
them names a symptom someone would see, such as WoL/OOB wake failures,
RX stalls after resume, wrong OOB frame size limits, or link loss after
ifdown/ifup. The message also doesn't say whether any of the changes
fixes a reported problem.

Some of the changes affect every RTL8156-family chip:

- ALDPS_PROXY_MODE in PLA_BDC_CR, set in rtl8156_down().
- DIS_MCU_CLROOB in PLA_OOB_CTRL, set in rtl8156_down().
- The PLA_RCR1 BIT(3) clear in rtl8156_up(), which now also runs on
RTL8156/RTL8156B.

195aae321c82 dates back to 2021, so these Fixes: tags will pull the patch
into several stable trees. Backporters need to know which bug this fixes.

> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 4815235e8e730..d00cc911ae135 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -6820,8 +6820,7 @@ static void rtl8156_up(struct r8152 *tp)
>
> ocp_byte_clr_bits(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, NOW_IS_OOB);
>
> - if (tp->version >= RTL_VER_16)
> - ocp_word_clr_bits(tp, MCU_TYPE_PLA, PLA_RCR1, BIT(3));
> + ocp_word_clr_bits(tp, MCU_TYPE_PLA, PLA_RCR1, BIT(3));
>
> ocp_word_clr_bits(tp, MCU_TYPE_PLA, PLA_SFF_STS_7, MCU_BORW_EN);
>

[ ... ]

> @@ -6860,6 +6860,23 @@ static void rtl8156_up(struct r8152 *tp)
> if (tp->version < RTL_VER_16)
> r8153_u2p3en(tp, true);
>
> + switch (tp->version) {
> + case RTL_VER_13:
> + case RTL_VER_15:
> + /* Enable Clear_SDR */
> + ocp_word_set_bits(tp, MCU_TYPE_USB, 0xd3ca, BIT(15));
> + break;
> + case RTL_VER_16:
> + case RTL_VER_17:
> + /* Enable Clear_SDR */
> + ocp_byte_set_bits(tp, MCU_TYPE_USB, 0xd378, BIT(7));
> + /* Clear SDR bit */
> + ocp_word_clr_bits(tp, MCU_TYPE_USB, 0xcd06, BIT(15));
> + break;
> + default:
> + break;
> + }
> +

[Severity: Low]
This isn't a bug, but could this be split into separate patches, one per
Fixes: target?

These parts only affect RTL8156/RTL8156B and fix 195aae321c82:

- The PLA_RCR1 BIT(3) clear.
- The 0xd3ca Clear_SDR write for RTL_VER_13/RTL_VER_15.
- ALDPS_PROXY_MODE and DIS_MCU_CLROOB on OOB entry in rtl8156_down().

The rest, including the PLA_RMS/PLA_MTPS switch in rtl8156_down(), only
matters for code added by fd3c7d080df5 and ad2a55b63b41.

The RCR1 hunk above removes the "if (tp->version >= RTL_VER_16)" gate,
which came from ad2a55b63b41. This switch in rtl8156_up() also puts the
RTL_VER_13/15 and RTL_VER_16/17 cases side by side. As a result, the
patch won't apply to stable trees that have 195aae321c82 but not the
RTL8157/RTL8159 support.

Separate patches would also let a bisect show which of the six register
changes is at fault if one of them causes a regression.

[ ... ]

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126033211.51850-1-nic_swsd%40realtek.com