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]
Message-ID: <20251028182605.06840664@kernel.org>
Date: Tue, 28 Oct 2025 18:26:05 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Buday Csaba <buday.csaba@...lan.hu>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
 Russell King <linux@...linux.org.uk>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
 <pabeni@...hat.com>, Philipp Zabel <p.zabel@...gutronix.de>,
 <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v4 4/4] net: mdio: reset PHY before attempting
 to access registers in fwnode_mdiobus_register_phy

On Wed, 22 Oct 2025 11:08:53 +0200 Buday Csaba wrote:
> +/* Hard-reset a PHY before registration */
> +static int fwnode_reset_phy(struct mii_bus *bus, u32 addr,
> +			    struct fwnode_handle *phy_node)
> +{
> +	struct mdio_device *tmpdev;
> +	int err;
> +
> +	tmpdev = mdio_device_create(bus, addr);
> +	if (IS_ERR(tmpdev))
> +		return PTR_ERR(tmpdev);
> +
> +	fwnode_handle_get(phy_node);
> +	device_set_node(&tmpdev->dev, phy_node);
> +	err = mdio_device_register_reset(tmpdev);
> +	if (err) {
> +		mdio_device_free(tmpdev);
> +		return err;

Should we worry about -EPROBE_DEFER on any of the error paths here?
If not maybe consider making this function void? We can add errors
back if the caller starts to care.

> +	}
> +
> +	if (mdio_device_has_reset(tmpdev)) {
> +		dev_info(&bus->dev,
> +			 "PHY device at address %d not detected, resetting PHY.",
> +			 addr);

IDK if this is still strictly necessary but I guess \n at the end of
the info msg would be idiomatic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ