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: <20240725165012.GL97837@kernel.org>
Date: Thu, 25 Jul 2024 17:50:12 +0100
From: Simon Horman <horms@...nel.org>
To: Daniel Golle <daniel@...rotopia.org>
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>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	John Crispin <john@...ozen.org>, Felix Fietkau <nbd@....name>,
	Lorenzo Bianconi <lorenzo@...nel.org>,
	Sean Wang <sean.wang@...iatek.com>,
	Mark Lee <Mark-MC.Lee@...iatek.com>,
	Bc-bocun Chen <bc-bocun.chen@...iatek.com>,
	Sam Shih <Sam.Shih@...iatek.com>,
	Weijie Gao <Weijie.Gao@...iatek.com>,
	Steven Liu <steven.liu@...iatek.com>,
	Matthias Brugger <matthias.bgg@...il.com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH RFC net-next] net: pcs: add helper module for standalone
 drivers

On Thu, Jul 25, 2024 at 01:44:49PM +0100, Daniel Golle wrote:
> Implement helper module for standalone PCS drivers which allows
> standaline PCS drivers to register and users to get instances of
> 'struct phylink_pcs' using device tree nodes.
> 
> At this point only a single instance for each device tree node is
> supported, once we got devices providing more than one PCS we can
> extend it and introduce an xlate function as well as '#pcs-cells',
> similar to how this is done by the PHY framework.
> 
> Signed-off-by: Daniel Golle <daniel@...rotopia.org>
> ---
> This is meant to provide the infrastructure suggested by
> Russell King in an earlier review. It just took me a long while to
> find the time to implement this.
> Users are going to be the standalone PCS drivers for 8/10 LynxI as
> well as 64/66 USXGMII PCS found on MediaTek MT7988 SoC.
> See also https://patchwork.kernel.org/comment/25636726/
> 
> The full tree where this is being used can be found at
> 
> https://github.com/dangowrt/linux/commits/mt7988-for-next/

Hi Daniel,

I realise this is an RFC, but I'm guessing a user will need to be submitted
for this to progress into net-next.

...

> +++ b/drivers/net/pcs/pcs-standalone.c

...

> +static struct pcs_standalone *of_pcs_locate(const struct device_node *_np, u32 index)

nit: This could trivially be line wrapped to 80 columns wide

> +{
> +	struct device_node *np;
> +	struct pcs_standalone *iter, *pcssa = NULL;

nit: Reverse xmas tree

...

> +struct phylink_pcs *devm_of_pcs_get(struct device *dev,
> +				    const struct device_node *np,
> +				    unsigned int index)
> +{
> +	struct pcs_standalone *pcssa;
> +
> +	pcssa = of_pcs_locate(np ?: dev->of_node, index);
> +	if (IS_ERR_OR_NULL(pcssa))
> +		return ERR_PTR(PTR_ERR(pcssa));

nit: Perhaps ERR_CAST() ?

> +
> +	device_link_add(dev, pcssa->dev, DL_FLAG_AUTOREMOVE_CONSUMER);
> +
> +	return pcssa->pcs;
> +}
> +EXPORT_SYMBOL_GPL(devm_of_pcs_get);
> +
> +MODULE_DESCRIPTION("Helper for standalone PCS drivers");
> +MODULE_AUTHOR("Daniel Golle <daniel@...rotopia.org>");
> +MODULE_LICENSE("GPL");
> diff --git a/include/linux/pcs/pcs-standalone.h b/include/linux/pcs/pcs-standalone.h

Please consider adding this file to MAINTAINERS.

...

> +static inline int devm_pcs_register(struct device *dev, struct phylink_pcs *pcs);
> +	return -EOPNOTSUPP;
> +}

The above does not compile.

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ