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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 20 Apr 2021 03:35:48 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     netdev@...r.kernel.org, "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Zoltan HERPAI <wigyori@...0.hu>,
        Raylynn Knight <rayknight@...com>
Subject: Re: [PATCH 2/3] net: ethernet: ixp4xx: Support device tree probing

> +	phy_np = of_parse_phandle(np, "phy-handle", 0);
> +	if (phy_np) {
> +		ret = of_property_read_u32(phy_np, "reg", &val);
> +		if (ret) {
> +			dev_err(dev, "cannot find phy reg\n");
> +			return NULL;
> +		}
> +		of_node_put(phy_np);
> +	} else {
> +		dev_err(dev, "cannot find phy instance\n");
> +		val = 0;
> +	}
> +	plat->phy = val;

phy-handle can point to a PHY on any bus. You should not assume it is
the devices own bus. Once you have phy_np call of_phy_find_device()
which gives you the actual phy device. Please don't let the
limitations of the current platform data limit you from implementing
this correctly.

      Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ