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: <YLed2G1iDRTbA9eT@lunn.ch>
Date:   Wed, 2 Jun 2021 17:03:52 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Wong Vee Khee <vee.khee.wong@...ux.intel.com>
Cc:     Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC net-next 0/2] Introduce MDIO probe order C45 over C22

> I took a look at how most ethernet drivers implement their "bus->read"
> function. Most of them either return -EIO or -ENODEV.
> 
> I think it safe to drop the return error type when we try with C45 access:
> 
> 
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 1539ea021ac0..282d16fdf6e1 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -870,6 +870,18 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45)
>         if (r)
>                 return ERR_PTR(r);
> 
> +       /* PHY device such as the Marvell Alaska 88E2110 will return a PHY ID
> +        * of 0 when probed using get_phy_c22_id() with no error. Proceed to
> +        * probe with C45 to see if we're able to get a valid PHY ID in the C45
> +        * space, if successful, create the C45 PHY device.
> +        */
> +       if ((!is_c45) && (phy_id == 0)) {
> +               r = get_phy_c45_ids(bus, addr, &c45_ids);
> +               if (!r)
> +                       return phy_device_create(bus, addr, phy_id,
> +                                                true, &c45_ids);
> +       }

This is getting better. But look at for example
drivers/net/mdio/mdio-bcm-unimac.c. What will happen when you ask it
to do get_phy_c45_ids()?

   Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ