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: <20240301171005.43188d02@kmaincent-XPS-13-7390>
Date: Fri, 1 Mar 2024 17:10:05 +0100
From: Köry Maincent <kory.maincent@...tlin.com>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
 <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
 <pabeni@...hat.com>, Jonathan Corbet <corbet@....net>, Luis Chamberlain
 <mcgrof@...nel.org>, Russ Weight <russ.weight@...ux.dev>, Greg
 Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki"
 <rafael@...nel.org>, Rob Herring <robh+dt@...nel.org>, Krzysztof Kozlowski
 <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley <conor+dt@...nel.org>,
 Mark Brown <broonie@...nel.org>, Frank Rowand <frowand.list@...il.com>,
 Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
 Russell King <linux@...linux.org.uk>, Thomas Petazzoni
 <thomas.petazzoni@...tlin.com>, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
 devicetree@...r.kernel.org, Dent Project <dentproject@...uxfoundation.org>
Subject: Re: [PATCH net-next v5 10/17] net: pse-pd: Add support for PSE PIs

Hello Oleskij,

Thanks you for the review.

On Fri, 1 Mar 2024 15:24:07 +0100
Oleksij Rempel <o.rempel@...gutronix.de> wrote:

> > -static int of_pse_simple_xlate(struct pse_controller_dev *pcdev,
> > -			       const struct of_phandle_args *pse_spec)
> > +static int of_load_pse_pis(struct pse_controller_dev *pcdev)
> >  {
> > -	if (pse_spec->args[0] >= pcdev->nr_lines)
> > -		return -EINVAL;
> > +	struct device_node *np = pcdev->dev->of_node;
> > +	struct device_node *node, *pis;
> > +	int ret, i;
> >  
> > -	return pse_spec->args[0];
> > +	if (!np)
> > +		return -ENODEV;
> > +
> > +	pcdev->pi = kcalloc(pcdev->nr_lines, sizeof(*pcdev->pi),
> > GFP_KERNEL);
> > +	if (!pcdev->pi)
> > +		return -ENOMEM;
> > +
> > +	pis = of_get_child_by_name(np, "pse-pis");
> > +	if (!pis) {  
> 
> Do we need to allocate pcdev->pi if there are no pse-pis?

In fact it is not needed in this patch but in the patch 13 which use regulator
framework, as the regulator is described on each pi structure.

I will update them accordingly.

> > +		/* Legacy OF description of PSE PIs */
> > +		pcdev->of_legacy = true;  
> 
> It is not "legacy" :) PoDL do not providing definition of PSE PI since there
> is only one pair. May be: single_pair, no_pse_pi or any other idea.

You right it is not needed for PoDL. Maybe no_pse_pi is better according to the
following thoughts.

Just wondering, how a pse controller that support PoE and PoDL simultaneously
would be exposed in the binding. In that case I suppose all the PIs (PoE and
PoDL) need to use the pse-pi subnode. Then the "alternative pinout" and
"polarity" parameter would not be requested for PoDL PIs.

> > +			dev_err(pcdev->dev, "wrong id of pse pi: %u\n",
> > +				id);
> > +			ret = -EINVAL;
> > +			goto out;
> > +		}
> > +
> > +		ret = of_property_count_strings(node, "pairset-names");
> > +		if (ret <= 0)  
> 
> if (ret < 0)
>    error: can't get "pairset-names" property: %pe
> if (ret < 1 || ret > 2)
>    error: wrong number of pairset-names. Should be 1 or 2, got %i

Need to modify this to be able to have PoDL PIs without pairset description.

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ