From: Andrew Lunn <andrew@lunn.ch>
To: Birger Koblitz <mail@birger-koblitz.de>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-usb@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Chih Kai Hsu <hsu.chih.kai@realtek.com>
Subject: Re: [PATCH net-next 2/4] r8152: Add support for the RTL8159 chip
Date: Wed, 29 Apr 2026 03:52:58 +0200 [thread overview]
Message-ID: <3e04d913-693c-44a9-a685-df9d0c9bd95f@lunn.ch> (raw)
In-Reply-To: <20260428-rtl8159_net_next-v1-2-52d03927b46f@birger-koblitz.de>
> @@ -3431,6 +3432,7 @@ static void rtl8152_nic_reset(struct r8152 *tp)
> ocp_word_clr_bits(tp, MCU_TYPE_USB, USB_USB_CTRL, CDC_ECM_EN);
> break;
>
> + case RTL_VER_17:
> case RTL_VER_16:
> ocp_byte_clr_bits(tp, MCU_TYPE_PLA, PLA_CR, CR_RE | CR_TE);
nitpick. The other switch statements seem to be sorted. So 17 should
be after 16.
> + /* Power level tuning */
> + // test mode power level
> + sram_write_w0w1(tp, 0x8415, 0xff00, 0x9300);
> + // normal link power level 10G, 5G, 2.5G
> + sram_write_w0w1(tp, 0x81a3, 0xff00, 0x0f00);
> + sram_write_w0w1(tp, 0x81ae, 0xff00, 0x0f00);
> + sram_write_w0w1(tp, 0x81b9, 0xff00, 0xb900);
> + //nomal link TX filter
normal? Please also add a space after the //. netdev also prefers /*
*/.
> + /* XG INRX parameters */
> + // RC coefficients
> + sram2_write(tp, 0x84ac, 0x0000);
> + sram2_write(tp, 0x84ae, 0x0000);
> + sram2_write(tp, 0x84b0, 0xf818);
> + sram2_write_w0w1(tp, 0x84b2, 0xff00, 0x6000);
> + //Training AAGC PAR (with uc2 patch)
space
> +static int r8159_wait_backup_restore(struct r8152 *tp)
> +{
> + u32 ocp_data;
> +
> + ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0);
> + if (!(ocp_data & PCUT_STATUS))
> + return 0;
> +
> + return poll_timeout_us(ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_GPHY_CTRL),
> + ocp_data & BACKUP_RESTRORE, 200, 2000, false);
> +}
> +
> static void r8156_init(struct r8152 *tp)
> @@ -8221,6 +8421,9 @@ static void r8156_init(struct r8152 *tp)
> return;
> }
>
> + if (tp->version == RTL_VER_17 && r8159_wait_backup_restore(tp))
> + return;
You should probably do something with the return value from
r8159_wait_backup_restore(). At minimum a dev_err().
Andrew
---
pw-bot: cr
next prev parent reply other threads:[~2026-04-29 1:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 3:47 [PATCH net-next 0/4] r8152: Add support for the RTL8159 10Gbit USB Ethernet chip Birger Koblitz
2026-04-28 3:47 ` [PATCH net-next 1/4] r8152: Add support for 10Gbit Link Speeds and EEE Birger Koblitz
2026-04-29 1:53 ` Andrew Lunn
2026-04-28 3:47 ` [PATCH net-next 2/4] r8152: Add support for the RTL8159 chip Birger Koblitz
2026-04-29 1:52 ` Andrew Lunn [this message]
2026-04-29 3:52 ` Birger Koblitz
2026-04-28 3:47 ` [PATCH net-next 3/4] r8152: Add irq mitigation for RTL8157/9 Birger Koblitz
2026-04-29 1:56 ` Andrew Lunn
2026-04-29 4:06 ` Birger Koblitz
2026-04-29 18:02 ` Michal Pecio
2026-04-30 3:36 ` Birger Koblitz
2026-04-30 5:44 ` Michal Pecio
2026-04-30 14:19 ` Andrew Lunn
2026-05-01 5:24 ` Michal Pecio
2026-05-01 7:01 ` Birger Koblitz
2026-05-01 12:21 ` Andrew Lunn
2026-04-28 3:47 ` [PATCH net-next 4/4] r8152: Add firmware upload capability for RTL8157/RTL8159 Birger Koblitz
2026-04-29 1:57 ` Andrew Lunn
2026-04-29 4:21 ` Birger Koblitz
2026-04-29 13:01 ` Andrew Lunn
2026-04-29 15:58 ` Birger Koblitz
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=3e04d913-693c-44a9-a685-df9d0c9bd95f@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew+netdev@lunn.ch \
--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=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