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: <aJw_aMhqa4M9Jy1j@shell.armlinux.org.uk>
Date: Wed, 13 Aug 2025 08:31:52 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Horatiu Vultur <horatiu.vultur@...rochip.com>
Cc: andrew@...n.ch, hkallweit1@...il.com, davem@...emloft.net,
	edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
	richardcochran@...il.com, o.rempel@...gutronix.de,
	alok.a.tiwari@...cle.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v3 1/3] net: phy: micrel: Introduce
 lanphy_modify_page_reg

On Wed, Aug 13, 2025 at 08:30:42AM +0200, Horatiu Vultur wrote:
> +static int lanphy_modify_page_reg(struct phy_device *phydev, int page, u16 addr,
> +				  u16 mask, u16 set)
> +{
> +	int ret;
> +
> +	phy_lock_mdio_bus(phydev);
> +	__phy_write(phydev, LAN_EXT_PAGE_ACCESS_CONTROL, page);
> +	__phy_write(phydev, LAN_EXT_PAGE_ACCESS_ADDRESS_DATA, addr);
> +	__phy_write(phydev, LAN_EXT_PAGE_ACCESS_CONTROL,
> +		    (page | LAN_EXT_PAGE_ACCESS_CTRL_EP_FUNC));
> +	ret = __phy_modify_changed(phydev, LAN_EXT_PAGE_ACCESS_ADDRESS_DATA,
> +				   mask, set);
> +	if (ret < 0)
> +		phydev_err(phydev, "Error: __phy_modify_changed has returned error %d\n",
> +			   ret);

Error: is not necessary, we have log levels.

What would be useful is to print the readable version of the error, and
it probably makes sense to do it outside of the bus lock.

> +
> +	phy_unlock_mdio_bus(phydev);

	if (ret < 0)
		phydev_err(phydev, "__phy_modify_changed() failed: %pe\n",
			   ERR_PTR(ret));

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ