mbox series

[RFC/RFT,net-next,0/4] KSZ DSA driver: xMII speed adjustment and partial reg_fields conversion

Message ID 20230316161250.3286055-1-vladimir.oltean@nxp.com (mailing list archive)
Headers show
Series KSZ DSA driver: xMII speed adjustment and partial reg_fields conversion | expand

Message

Vladimir Oltean March 16, 2023, 4:12 p.m. UTC
Hi,

Yesterday I picked up this patch and resubmitted it:
https://patchwork.kernel.org/project/netdevbpf/patch/20230222031738.189025-1-marex@denx.de/
here:
https://patchwork.kernel.org/project/netdevbpf/patch/20230315231916.2998480-1-vladimir.oltean@nxp.com/

and today I'm trying to address the rest of the points brought up in
that conversation, namely:

- commit c476bede4b0f ("net: dsa: microchip: ksz8795: use common xmii
  function") stopped adjusting the xMII port speed on KSZ8795, does it
  still work? No idea. Patch 3/4 deals with that.

- Mapping P_XMII_CTRL_0 and P_XMII_CTRL_1 to the same value on KSZ8795
  raised some eyebrows, and some reading shows that it is also partially
  incorrect (see patch 2/4). This is also where I propose to convert to
  reg_fields.

As it turns out, patch 2/4 is a dependency for patch 3/4, even if 3/4
may be a fix.

Patch 1/4 is a dependency of 2/4.

Patch 4/4 is something I also noticed during review. I left it at the
end so that it won't conflict with something that could reasonably be
submitted as a bug fix.

ABSOLUTELY NO TESTING WAS DONE. I don't have the hardware.

THIS BREAKS EVERYTHING EXCEPT FOR KSZ8795. Any testers should test on
that if possible (due to both patches 2/4, and 3/4).

Vladimir Oltean (4):
  net: dsa: microchip: add an enum for regmap widths
  net: dsa: microchip: partial conversion to regfields API for KSZ8795
    (WIP)
  net: dsa: microchip: allow setting xMII port speed/duplex on
    KSZ8765/KSZ8794/KSZ8795
  net: dsa: microchip: remove unused dev->dev_ops->phylink_mac_config()

 drivers/net/dsa/microchip/ksz8795.c      |  45 ++--
 drivers/net/dsa/microchip/ksz8863_smi.c  |  11 +-
 drivers/net/dsa/microchip/ksz9477.c      |  24 +--
 drivers/net/dsa/microchip/ksz9477_i2c.c  |  11 +-
 drivers/net/dsa/microchip/ksz_common.c   | 256 +++++++++++++----------
 drivers/net/dsa/microchip/ksz_common.h   | 110 +++++++---
 drivers/net/dsa/microchip/ksz_spi.c      |   6 +-
 drivers/net/dsa/microchip/lan937x_main.c |   8 +-
 8 files changed, 299 insertions(+), 172 deletions(-)

Comments

Arun Ramadoss March 17, 2023, 3:57 a.m. UTC | #1
Hi Vladimir,
On Thu, 2023-03-16 at 18:12 +0200, Vladimir Oltean wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> 
> ABSOLUTELY NO TESTING WAS DONE. I don't have the hardware.
> 
> THIS BREAKS EVERYTHING EXCEPT FOR KSZ8795. Any testers should test on
> that if possible (due to both patches 2/4, and 3/4).

I don't have KSZ87xx and KSZ88xx series of boards. I can able to test
only on KSZ9477 and LAN937x series of boards. I will wait for next
version of patch to do sanity test on this KSZ9477 and LAN937x series
of boards.

> 
> Vladimir Oltean (4):
>   net: dsa: microchip: add an enum for regmap widths
>   net: dsa: microchip: partial conversion to regfields API for
> KSZ8795
>     (WIP)
>   net: dsa: microchip: allow setting xMII port speed/duplex on
>     KSZ8765/KSZ8794/KSZ8795
>   net: dsa: microchip: remove unused dev->dev_ops-
> >phylink_mac_config()
> 
>  drivers/net/dsa/microchip/ksz8795.c      |  45 ++--
>  drivers/net/dsa/microchip/ksz8863_smi.c  |  11 +-
>  drivers/net/dsa/microchip/ksz9477.c      |  24 +--
>  drivers/net/dsa/microchip/ksz9477_i2c.c  |  11 +-
>  drivers/net/dsa/microchip/ksz_common.c   | 256 +++++++++++++------
> ----
>  drivers/net/dsa/microchip/ksz_common.h   | 110 +++++++---
>  drivers/net/dsa/microchip/ksz_spi.c      |   6 +-
>  drivers/net/dsa/microchip/lan937x_main.c |   8 +-
>  8 files changed, 299 insertions(+), 172 deletions(-)
> 
> --
> 2.34.1
>
Oleksij Rempel March 17, 2023, 6:02 a.m. UTC | #2
Hi Vladimir,

On Thu, Mar 16, 2023 at 06:12:46PM +0200, Vladimir Oltean wrote:
> Hi,
> 
> Yesterday I picked up this patch and resubmitted it:
> https://patchwork.kernel.org/project/netdevbpf/patch/20230222031738.189025-1-marex@denx.de/
> here:
> https://patchwork.kernel.org/project/netdevbpf/patch/20230315231916.2998480-1-vladimir.oltean@nxp.com/
> 
> and today I'm trying to address the rest of the points brought up in
> that conversation, namely:
> 
> - commit c476bede4b0f ("net: dsa: microchip: ksz8795: use common xmii
>   function") stopped adjusting the xMII port speed on KSZ8795, does it
>   still work? No idea. Patch 3/4 deals with that.
> 
> - Mapping P_XMII_CTRL_0 and P_XMII_CTRL_1 to the same value on KSZ8795
>   raised some eyebrows, and some reading shows that it is also partially
>   incorrect (see patch 2/4). This is also where I propose to convert to
>   reg_fields.
> 
> As it turns out, patch 2/4 is a dependency for patch 3/4, even if 3/4
> may be a fix.
> 
> Patch 1/4 is a dependency of 2/4.
> 
> Patch 4/4 is something I also noticed during review. I left it at the
> end so that it won't conflict with something that could reasonably be
> submitted as a bug fix.
> 
> ABSOLUTELY NO TESTING WAS DONE. I don't have the hardware.
> 
> THIS BREAKS EVERYTHING EXCEPT FOR KSZ8795. Any testers should test on
> that if possible (due to both patches 2/4, and 3/4).

I can test it on KSZ8873, but currently it is not compiling on top of net-next.

Regards,
Oleksij
Vladimir Oltean March 17, 2023, 9:43 a.m. UTC | #3
On Fri, Mar 17, 2023 at 07:02:20AM +0100, Oleksij Rempel wrote:
> I can test it on KSZ8873, but currently it is not compiling on top of net-next.

That's my fault. I reset my defconfig, and looks like that only kept
CONFIG_NET_DSA_MICROCHIP_KSZ_COMMON=y, disabling all the individual
KSZ drivers. I will leave comments inline where changes are necessary.