lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdaJ_sV_Fb8qJXp7PN5mO2A68h7zw1UeFuBk2tLDH7cB1A@mail.gmail.com>
Date:   Sat, 18 Dec 2021 03:50:31 +0100
From:   Linus Walleij <linus.walleij@...aro.org>
To:     luizluca@...il.com
Cc:     netdev@...r.kernel.org, andrew@...n.ch, vivien.didelot@...il.com,
        f.fainelli@...il.com, olteanv@...il.com, ALSI@...g-olufsen.dk,
        arinc.unal@...nc9.com
Subject: Re: [PATCH net-next 05/13] net: dsa: realtek: use phy_read in ds->ops

On Thu, Dec 16, 2021 at 9:14 PM <luizluca@...il.com> wrote:
> From: Luiz Angelo Daros de Luca <luizluca@...il.com>
>
> The ds->ops->phy_read will only be used if the ds->slave_mii_bus
> was not initialized. Calling realtek_smi_setup_mdio will create a
> ds->slave_mii_bus, making ds->ops->phy_read dormant.
>
> Using ds->ops->phy_read will allow switches connected through non-SMI
> interfaces (like mdio) to let ds allocate slave_mii_bus and reuse the
> same code.
>
> Tested-by: Arınç ÜNAL <arinc.unal@...nc9.com>
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@...il.com>
(...)
> -static int rtl8365mb_phy_read(struct realtek_priv *priv, int phy, int regnum)
> +static int rtl8365mb_phy_read(struct dsa_switch *ds, int phy, int regnum)
>  {
>         u32 ocp_addr;
>         u16 val;
>         int ret;
> +       struct realtek_priv *priv = ds->priv;

Needs to be on top (reverse christmas tree, christmas is getting close).

> -static int rtl8365mb_phy_write(struct realtek_priv *priv, int phy, int regnum,
> +static int rtl8365mb_phy_write(struct dsa_switch *ds, int phy, int regnum,
>                                u16 val)
>  {
>         u32 ocp_addr;
>         int ret;
> +       struct realtek_priv *priv = (struct realtek_priv *)ds->priv;

Dito.

> -static int rtl8366rb_phy_read(struct realtek_priv *priv, int phy, int regnum)
> +static int rtl8366rb_phy_read(struct dsa_switch *ds, int phy, int regnum)
>  {
>         u32 val;
>         u32 reg;
>         int ret;
> +       struct realtek_priv *priv = ds->priv;

Dito.

> -static int rtl8366rb_phy_write(struct realtek_priv *priv, int phy, int regnum,
> +static int rtl8366rb_phy_write(struct dsa_switch *ds, int phy, int regnum,
>                                u16 val)
>  {
>         u32 reg;
>         int ret;
> +       struct realtek_priv *priv = ds->priv;

Dito.

Other than that it's a great patch, so with these nitpicky changes
feel free to add:
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ