mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 01/12] r8152: fix RTL8156/RTL8156B/RTL8157/RTL8159 up and down settings
Date: Tue, 01 Dec 2026 06:45:59 +0000	[thread overview]
Message-ID: <179610755909.3146.3939644612327951020@kernel.org> (raw)
In-Reply-To: <20261130063123.2408-2-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] The commit message of "r8152: fix
  RTL8156/RTL8156B/RTL8157/RTL8159 up and down settings" lists register…
- [Low] One patch bundles independent register fixes for different chip
  generations, tied to three Fixes: commits years apart, plus a cleanup.

--

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

This patch changes the shared rtl8156_up() and rtl8156_down() paths to
apply several register settings from the datasheet to RTL8156, RTL8156B,
RTL8157 and RTL8159. It changes the version gating for PLA_RCR1,
USB_SPEED_OPTION and PLA_MCU_SPDWN_EN, and adds Clear_SDR setup. It also
sets ALDPS_PROXY_MODE and DIS_MCU_CLROOB on OOB entry and uses different
PLA_RMS/PLA_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():
>
> - PLA_RCR1 BIT(3) must be cleared on up for all of them. It was
>   cleared only for RTL_VER_16 and later, so RTL8156/RTL8156B never
>   reached it.

[ ... ]

> - Entering OOB needs PLA_BDC_CR's ALDPS_PROXY_MODE and PLA_OOB_CTRL's
>   DIS_MCU_CLROOB. Only r8152b_enter_oob() and r8153_enter_oob() set
>   them; the RTL8156 family down path set NOW_IS_OOB alone.

[ ... ]

> 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]
This isn't a bug, but could the commit message say what users see when
these settings are missing?

Each bullet names a register bit or value that the datasheet requires.
None of them describes a failure, for example:

  - RX not working
  - WoL or OOB wake failing
  - the wrong link or USB speed after ifdown/ifup or suspend
  - a power-state problem

Because of the Fixes: 195aae321c82 tag, this patch will go to stable trees
back to 2021. It also changes behaviour on RTL8156/RTL8156B, which have
shipped for years:

  rtl8156_up() now clears PLA_RCR1 BIT(3) for RTL_VER_10 through
  RTL_VER_15.

  rtl8156_down() now sets ALDPS_PROXY_MODE and DIS_MCU_CLROOB on close
  and on system suspend, for every chip that uses this path.

Without a description of the symptom, how can maintainers and stable
backporters judge how urgent this is, or check that the fix works?

> 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

[ ... ]

> @@ -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]
Would it make sense to split this into one patch per chip generation?

This switch puts two fixes side by side:

  - the RTL8156B Clear_SDR setting (RTL_VER_13/RTL_VER_15), which goes
    back to 195aae321c82 from 2021
  - the RTL8157/RTL8159 setting (RTL_VER_16/RTL_VER_17), which goes back
    to fd3c7d080df5 and ad2a55b63b41 from 2026

RTL_VER_16 and RTL_VER_17 do not exist at 195aae321c82. The Fixes:
195aae321c82 tag sends this patch to exactly those older stable trees,
where it would not apply or build as is.

rtl8156_down() has the same mix. There, the new PLA_RMS 1526 and PLA_MTPS
10K values apply only to RTL_VER_16/RTL_VER_17.

The PLA_MCU_SPDWN_EN change in rtl8156_up() and rtl8156_down() has only
this justification:

  "PLA_MCU_SPDWN_EN is not used by RTL8157/RTL8159, so stop managing
  it on up/down for them."

No harm is stated, so it reads as a cleanup inside a fix tagged for
stable.

With one RTL8156/RTL8156B fix (Fixes: 195aae321c82) and one
RTL8157/RTL8159 fix (Fixes: fd3c7d080df5 and ad2a55b63b41), each could go
to the right trees and be bisected or reverted on its own.

A split would not remove all backport work. The baseline also uses the
ocp_word_set_bits()/ocp_word_clr_bits() style helpers from d16133f177fea6,
so an RTL8156-only fix would still need some manual backporting. The
conflicts would be smaller, though.

These Fixes-tagged changes also sit in a series with net-next feature work
such as UPS enablement and function splits.

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

  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 [this message]
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
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=179610755909.3146.3939644612327951020@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®