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: <20250721-hairy-aardwolf-of-enterprise-bbc99f@kuoka>
Date: Mon, 21 Jul 2025 10:23:21 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Mohammad Rafi Shaik <mohammad.rafi.shaik@....qualcomm.com>
Cc: Srinivas Kandagatla <srini@...nel.org>, 
	Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, Rob Herring <robh@...nel.org>, 
	Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, 
	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>, 
	Philipp Zabel <p.zabel@...gutronix.de>, Linus Walleij <linus.walleij@...aro.org>, 
	Bartosz Golaszewski <brgl@...ev.pl>, linux-arm-msm@...r.kernel.org, linux-sound@...r.kernel.org, 
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org, 
	quic_pkumpatl@...cinc.com, kernel@....qualcomm.com
Subject: Re: [PATCH v2 2/2] ASoC: codecs: wsa883x: Handle shared reset GPIO
 for WSA883x speakers

On Fri, Jul 18, 2025 at 04:16:28PM +0530, Mohammad Rafi Shaik wrote:
> On some Qualcomm platforms such as QCS6490-RB3Gen2, the multiple
> WSA8830/WSA8835 speakers share a common reset (shutdown) GPIO.
> To handle such cases, use the reset controller framework along
> with the "reset-gpio" driver.
> 
> Register devm action to safely disable the regulator on device removal
> to prevents a potential release warning from _regulator_put().

It is not possible to remove the device - suppress bind attrs. How did
you trigger that?

> 
> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@....qualcomm.com>
> ---
>  sound/soc/codecs/wsa883x.c | 93 +++++++++++++++++++++++++++++---------
>  1 file changed, 71 insertions(+), 22 deletions(-)

...

>  static int wsa883x_probe(struct sdw_slave *pdev,
>  			 const struct sdw_device_id *id)
>  {
> @@ -1566,13 +1615,18 @@ static int wsa883x_probe(struct sdw_slave *pdev,
>  	if (ret)
>  		return dev_err_probe(dev, ret, "Failed to enable vdd regulator\n");
>  
> -	wsa883x->sd_n = devm_gpiod_get_optional(dev, "powerdown",
> -						GPIOD_FLAGS_BIT_NONEXCLUSIVE | GPIOD_OUT_HIGH);
> -	if (IS_ERR(wsa883x->sd_n)) {
> -		ret = dev_err_probe(dev, PTR_ERR(wsa883x->sd_n),
> -				    "Shutdown Control GPIO not found\n");
> -		goto err;
> -	}
> +	ret = wsa883x_get_reset(dev, wsa883x);
> +	if (ret)
> +		return ret;
> +
> +	/*
> +	 * Register devm action to safely disable the regulator on device removal.
> +	 * This prevents a potential release warning from _regulator_put().
> +	 */
> +	ret = devm_add_action_or_reset(dev, wsa883x_regulator_disable,
> +				       wsa883x);

If removal is possible (but then explain in commit msg how), then this
should be separate commit with fixes and cc-stable, because you are
fixing actual bug - lack of regulator release on unbind.

Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ