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: <Yw0RfRXGZKl+ZwOi@lunn.ch>
Date:   Mon, 29 Aug 2022 21:20:29 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Jerry Ray <jerry.ray@...rochip.com>
Cc:     Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH 2/2] net: dsa: LAN9303: Add basic support for LAN9354

> -	if ((reg >> 16) != LAN9303_CHIP_ID) {
> -		dev_err(chip->dev, "expecting LAN9303 chip, but found: %X\n",
> +	if (((reg >> 16) != LAN9303_CHIP_ID) &&
> +	    ((reg >> 16) != LAN9354_CHIP_ID)) {
> +		dev_err(chip->dev, "unexpected device found: LAN%4.4X\n",
>  			reg >> 16);
>  		return -ENODEV;
>  	}
> @@ -884,7 +889,7 @@ static int lan9303_check_device(struct lan9303 *chip)
>  	if (ret)
>  		dev_warn(chip->dev, "failed to disable switching %d\n", ret);
>  
> -	dev_info(chip->dev, "Found LAN9303 rev. %u\n", reg & 0xffff);
> +	dev_info(chip->dev, "Found LAN%4.4X rev. %u\n", (reg >> 16), reg & 0xffff);
>  
>  	ret = lan9303_detect_phy_setup(chip);
>  	if (ret) {
> diff --git a/drivers/net/dsa/lan9303_mdio.c b/drivers/net/dsa/lan9303_mdio.c
> index bbb7032409ba..d12c55fdc811 100644
> --- a/drivers/net/dsa/lan9303_mdio.c
> +++ b/drivers/net/dsa/lan9303_mdio.c
> @@ -158,6 +158,7 @@ static void lan9303_mdio_shutdown(struct mdio_device *mdiodev)
>  
>  static const struct of_device_id lan9303_mdio_of_match[] = {
>  	{ .compatible = "smsc,lan9303-mdio" },
> +	{ .compatible = "microchip,lan9354-mdio" },

Please validate that what you find on the board actually is what the
compatible says it should be. If you don't validate it, there will be
some DT blobs that have the wrong value, but probe fine. But then you
cannot actually make use of the compatible string in the driver to do
something different between the 9303 and the 9354 because some boards
have the wrong compatible....

     Andrew

Powered by blists - more mailing lists