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: <bfdd9d04-8f74-422e-8b3e-6f3d2c4d0a3a@lunn.ch>
Date: Thu, 19 Dec 2024 17:45:03 +0100
From: Andrew Lunn <andrew@...n.ch>
To: hfdevel@....net
Cc: Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	FUJITA Tomonori <fujita.tomonori@...il.com>,
	Andrew Lunn <andrew+netdev@...n.ch>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v3 5/7] net: tn40xx: create software node for
 mdio and phy and add to mdiobus

On Tue, Dec 17, 2024 at 10:07:36PM +0100, Hans-Frieder Vogt via B4 Relay wrote:
> From: Hans-Frieder Vogt <hfdevel@....net>
> 
> Create a software node for the mdio function, with a child node for the
> Aquantia AQR105 PHY, providing a firmware-name (and a bit more, which may
> be used for future checks) to allow the PHY to load a MAC specific
> firmware from the file system.
> 
> The name of the PHY software node follows the naming convention suggested
> in the patch for the mdiobus_scan function (in the same patch series).
> 
> Signed-off-by: Hans-Frieder Vogt <hfdevel@....net>
> ---
>  drivers/net/ethernet/tehuti/tn40.c      | 10 ++++-
>  drivers/net/ethernet/tehuti/tn40.h      | 30 +++++++++++++++
>  drivers/net/ethernet/tehuti/tn40_mdio.c | 65 ++++++++++++++++++++++++++++++++-
>  3 files changed, 103 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/tehuti/tn40.c b/drivers/net/ethernet/tehuti/tn40.c
> index 259bdac24cf211113b8f80934feb093d61e46f2d..5f73eb1f7d9f74294cd5546c2ef4797ebc24c052 100644
> --- a/drivers/net/ethernet/tehuti/tn40.c
> +++ b/drivers/net/ethernet/tehuti/tn40.c
> @@ -1778,7 +1778,7 @@ static int tn40_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	ret = tn40_phy_register(priv);
>  	if (ret) {
>  		dev_err(&pdev->dev, "failed to set up PHY.\n");
> -		goto err_free_irq;
> +		goto err_unregister_swnodes;
>  	}
>  
>  	ret = tn40_priv_init(priv);
> @@ -1795,6 +1795,10 @@ static int tn40_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	return 0;
>  err_unregister_phydev:
>  	tn40_phy_unregister(priv);
> +err_unregister_swnodes:
> +	fwnode_handle_put(dev_fwnode(&priv->mdio->dev));
> +	device_remove_software_node(&priv->mdio->dev);
> +	software_node_unregister_node_group(priv->nodes.group);
>  err_free_irq:
>  	pci_free_irq_vectors(pdev);
>  err_unset_drvdata:

This looks pretty unsymmetrical. The swnodes are added in
tn40_mdiobus_init(). I would add an tn40_mdiobus_remove() and call
that as the undo function for tn40_mdiobus_init() during cleanup.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ