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: <14b7f2cb-6f40-f8b8-b3de-fe99080e6e40@axentia.se>
Date: Tue, 25 Mar 2025 21:13:05 +0100
From: Peter Rosin <peda@...ntia.se>
To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
 Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
Cc: broonie@...nel.org, andersson@...nel.org, krzk+dt@...nel.org,
 ivprusov@...utedevices.com, luca.ceresoli@...tlin.com,
 zhoubinbin@...ngson.cn, paulha@...nsource.cirrus.com, lgirdwood@...il.com,
 robh@...nel.org, conor+dt@...nel.org, konradybcio@...nel.org,
 perex@...ex.cz, tiwai@...e.com, linux-sound@...r.kernel.org,
 linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org, johan+linaro@...nel.org,
 Christopher Obbard <christopher.obbard@...aro.org>
Subject: Re: [PATCH v5 5/6] ASoC: codecs: wcd938x: add mux control support for
 hp audio mux

Hi!

2025-03-25 at 19:04, Srinivas Kandagatla wrote:
> I wish we could be taken care in mux-core or even in the deselect api

It is not easily done. A mux is a shared resource. How can the mux core
know if it is consumer A or consumer B that deselects the mux if both
ignore failures when calling select? Mux select is backed by a semaphore
and there is no guarantee that a consumer selects/deselects from the
same thread or anything like that. The onus is on the consumer to get
this right and only deselect when select is successful.

I believe the documentation is clear on this topic: "do not call
mux_control_deselect() if mux_control_select() fails".

One thing can be done from the mux core, and that is to provide a new
API where consumers get a mux that is exclusive so that the consumer
can call select/deselect without involving a lock in the core. There
need not even be a requirement to call deselect between selects in that
case. Such an API is what many consumers want, I think, but it is of
course not really compatible with the existing API, which is totally
focused on the need to share a mux among multiple consumers.

And, of course, someone has to do it.

Cheers,
Peter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ