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] r8159_hw_phy_cfg() (drivers/net/usb/r8152.c,
RTL_VER_17_QFN68/QFN100 case) adds two PHY register writes that have…
--
r8152: split r8157_hw_phy_cfg into RTL8157 and RTL8159 variants
This commit splits r8157_hw_phy_cfg() into r8157_hw_phy_cfg() for
RTL_VER_16 and a new r8159_hw_phy_cfg() for RTL_VER_17_QFN68/QFN100.
Each function gets its own copy of the shared prologue and epilogue. It
also changes the EEE handling for RTL8159, adds new RTL8159 PHY tuning
parameters, and adds sram2_set_bits()/sram2_clr_bits() helpers.
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index a16e7d0257f2a..392b7015f4925 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
[ ... ]
> @@ -8372,22 +8459,35 @@ static void r8157_hw_phy_cfg(struct r8152 *tp)
> sram_write_w0w1(tp, 0x81ae, 0xff00, 0x0f00);
> sram_write_w0w1(tp, 0x81b9, 0xff00, 0xb900);
> /* normal link TX filter */
> - sram2_write_w0w1(tp, 0x83b0, 0x0e00, 0);
> - sram2_write_w0w1(tp, 0x83c5, 0x0e00, 0);
> - sram2_write_w0w1(tp, 0x83da, 0x0e00, 0);
> - sram2_write_w0w1(tp, 0x83ef, 0x0e00, 0);
> + sram2_clr_bits(tp, 0x83b0, 0x0e00);
> + sram2_clr_bits(tp, 0x83c5, 0x0e00);
> + sram2_clr_bits(tp, 0x83da, 0x0e00);
> + sram2_clr_bits(tp, 0x83ef, 0x0e00);
> +
> + ocp_reg_w0w1(tp, 0xbf38, 0x01f0, 0x0160);
> + ocp_reg_w0w1(tp, 0xbf3a, 0x001f, 0x0014);
[Severity: Low]
What are these two writes to 0xbf38 and 0xbf3a in r8159_hw_phy_cfg()
for? They have no comment, and the driver doesn't touch either register
before this patch, so this isn't code moved from somewhere else.
The commit message lists the new RTL8159 parameters as:
Newly added PHY tuning parameters for RTL8159:
- shorten CLKS latency
- CMP_Timer on MP_Timer=333
- spdchg_pga1_lpf_cap
- ENET PLL jitter improvement
Neither write fits any item on that list. Because they follow the
"normal link TX filter" sram2 block with no comment of their own, it is
hard to tell which feature they belong to.
Could a comment be added here, and could the commit message mention
them?
> + /* shorten CLKS latency */
> + ocp_reg_clr_bits(tp, 0xbf28, BIT(14) | BIT(13));
> + ocp_reg_clr_bits(tp, 0xbf2c, BIT(15) | BIT(14));
> + /* CMP_Timer on MP_Timer=333
> + * GPHY OCP 0xbf28 bit[0] = 0x1
> + * GPHY OCP 0xbf28 bit[6:1] = 0x3
> + * GPHY OCP 0xbf28 bit[12:7] = 0x3
> + */
> + ocp_reg_w0w1(tp, 0xbf28, 0x1fff, 0x0187);
> + ocp_reg_w0w1(tp, 0xbf2a, 0x3f, 0x03);
[Severity: Low]
A related question about the 0xbf2a write: the "CMP_Timer on
MP_Timer=333" comment above it only describes the bitfields of 0xbf28.
Is the 0xbf2a write part of the CMP_Timer setting, or something else?
If it is part of it, could the comment also describe 0xbf2a bit[5:0]?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40realtek.com