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] [day] [month] [year] [list]
Message-ID: <aRy5j12cdNy6iL2x@ashevche-desk.local>
Date: Tue, 18 Nov 2025 20:23:11 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Charles Keepax <ckeepax@...nsource.cirrus.com>
Cc: Bartosz Golaszewski <brgl@...ev.pl>,
	Linus Walleij <linus.walleij@...aro.org>,
	Daniel Scally <djrscally@...il.com>,
	Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
	Sakari Ailus <sakari.ailus@...ux.intel.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Danilo Krummrich <dakr@...nel.org>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Krzysztof Kozlowski <krzk@...nel.org>, linux-gpio@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
	patches@...nsource.cirrus.com
Subject: Re: [PATCH v4 04/10] gpio: swnode: don't use the swnode's name as
 the key for GPIO lookup

On Tue, Nov 18, 2025 at 06:15:49PM +0000, Charles Keepax wrote:
> On Tue, Nov 18, 2025 at 07:01:24PM +0100, Bartosz Golaszewski wrote:
> > On Tue, Nov 18, 2025 at 5:34 PM Charles Keepax
> > <ckeepax@...nsource.cirrus.com> wrote:
> > > On Mon, Nov 03, 2025 at 10:35:24AM +0100, Bartosz Golaszewski wrote:

...

> > > One small problem is this does break drivers/spi/spi-cs42l43.c.
> > 
> > I'd say it's a big problem. :)
> > 
> > > That driver has to register some swnodes to specify some GPIO
> > > chip selects due to some squiffy ACPI from Windows land. Currently
> > > it relies on the sw node being called cs42l43-pinctrl to match
> > > the driver.
> > 
> > What is the problem exactly? The "cs42l43-pinctrl" swnode is
> > associated with a GPIO device I suppose? Does it not find it? I'd need
> > some more information in order to figure out a way to fix it.
> 
> Yeah doesn't find the GPIO device. Apologies the background is
> fairly lenghty here but to give a high level summary. The cs42l43
> is an audio CODEC but it has a SPI controller on it, in some
> configurations there are a couple of speaker amps connected to
> this SPI controller. For Window reasons this SPI controller isn't
> properly represented in ACPI, so we have to depend on a couple
> magic properties and then use software nodes to register the
> speaker amps. However, as part of this we need to register a
> cs-gpios property for the chip selects used by the amps.
> 
> This chip select gpios property is where the problem happens, we
> need to refer to the gpio/pinctrl driver of the cs42l43, but
> software nodes only seem to allow referring to other software
> nodes.

Interestingly that Bart's series from where this patch came has more patches
targeting exactly this scenario, i.e. to allow to refer any type of fwnode from
swnode. Maybe we need those too and something on top?

> Previously this worked as we gave the node the same name
> as the real driver, which meant it found the real driver.
> However, after switching to look up by fwnode, it is looking for
> a gpio controller attached to the software node.
> 
> static const struct software_node cs42l43_gpiochip_swnode = {
> 	/* Previously matched the driver name for the pinctrl driver */
> 	.name	=  "cs42l43-pinctrl",
> };
> 
> static const struct software_node_ref_args cs42l43_cs_refs[] = {
> 	/* This needs to point to the genuine pinctrl driver? */
> 	SOFTWARE_NODE_REFERENCE(&cs42l43_gpiochip_swnode, 0, GPIO_ACTIVE_LOW),
> 	/* This is a mark that indicates the native chip select is used*/
> 	SOFTWARE_NODE_REFERENCE(&swnode_gpio_undefined),
> };
> 
> The bit that is unclear to me is how we get that software node
> property to point to the real pinctrl driver rather than the
> dummy software node. I think maybe we need to add a SW node as a
> secondary node on the pinctrl driver itself and link to that?
> 
> Also happy from my side to spend some time working on this as I
> am not convinced what the driver is doing now is totally legit.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ