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]
Date: Thu, 21 Mar 2024 15:55:22 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Yanteng Si <siyanteng@...ngson.cn>
Cc: Serge Semin <fancer.lancer@...il.com>, hkallweit1@...il.com,
	peppe.cavallaro@...com, alexandre.torgue@...s.st.com,
	joabreu@...opsys.com, Jose.Abreu@...opsys.com,
	chenhuacai@...ngson.cn, linux@...linux.org.uk,
	guyinggang@...ngson.cn, netdev@...r.kernel.org,
	chris.chenfeiyang@...il.com
Subject: Re: [PATCH net-next v8 06/11] net: stmmac: dwmac-loongson: Add GNET
 support

> Because the default return value of gnet's mdio is 0xffff, when scanning for
> phy,
> 
> if the return value is not 0, it will be assumed that the phy for that
> address exists.

That is not correct. The MDIO bus has a pull up on the data line. If
there is no device at a given address, that pull up results in 0xffff
being read. phylib understands this, it knows that a read with the
value of 0xffff probably means there is no device at that address. So
it will not create a device.

>  Not specifying an address will cause all addresses' phy to be detected, and
> the
> 
> lowest address' phy will be selected by default. so then, the network is
> unavailable.

Do you have multiple PHYs on the bus? If there is only one PHY the
first PHY should be the PHY you want, and phy_find_first() will do
what you need. However, if there are multiple PHYs on the bus, you
really should use a phandle in DT to point to the correct PHY.

       Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ