From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Peter Rosin <peda@axentia.se>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: broonie@kernel.org, andersson@kernel.org, krzk+dt@kernel.org,
ivprusov@salutedevices.com, luca.ceresoli@bootlin.com,
zhoubinbin@loongson.cn, paulha@opensource.cirrus.com,
lgirdwood@gmail.com, robh@kernel.org, conor+dt@kernel.org,
konradybcio@kernel.org, perex@perex.cz, tiwai@suse.com,
linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
johan+linaro@kernel.org,
Christopher Obbard <christopher.obbard@linaro.org>
Subject: Re: [PATCH v5 5/6] ASoC: codecs: wcd938x: add mux control support for hp audio mux
Date: Tue, 25 Mar 2025 21:39:04 +0000 [thread overview]
Message-ID: <b993c7a4-ff3e-4e79-bde8-2b5bdf3f2fff@linaro.org> (raw)
In-Reply-To: <14b7f2cb-6f40-f8b8-b3de-fe99080e6e40@axentia.se>
Thanks Peter,
On 25/03/2025 20:13, Peter Rosin wrote:
> 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.
Should deselect fail if there was no previous mux selected?
>
> I believe the documentation is clear on this topic: "do not call
> mux_control_deselect() if mux_control_select() fails".
True, the documentation is pretty clear about this behavior.
>
> 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.
>
exclusive apis would simplify the consumer side of code for sure.
> And, of course, someone has to do it.
Yes, I can give it a go and see how it will turn out.
--srini
>
> Cheers,
> Peter
next prev parent reply other threads:[~2025-03-25 21:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-25 11:40 [PATCH v5 0/6] ASoC: wcd938x: enable t14s audio headset srinivas.kandagatla
2025-03-25 11:40 ` [PATCH v5 1/6] dt-bindings: mux: add optional regulator binding to gpio mux srinivas.kandagatla
2025-03-25 11:40 ` [PATCH v5 2/6] mux: gpio: add optional regulator support srinivas.kandagatla
2025-03-25 11:40 ` [PATCH v5 3/6] ASoC: codecs: wcd-mbhc: cleanup swap_gnd_mic api srinivas.kandagatla
2025-03-25 11:40 ` [PATCH v5 4/6] ASoC: dt-bindings: wcd93xx: add bindings for audio mux controlling hp srinivas.kandagatla
2025-03-25 11:40 ` [PATCH v5 5/6] ASoC: codecs: wcd938x: add mux control support for hp audio mux srinivas.kandagatla
2025-03-25 13:36 ` Dmitry Baryshkov
2025-03-25 18:04 ` Srinivas Kandagatla
2025-03-25 20:13 ` Peter Rosin
2025-03-25 21:39 ` Srinivas Kandagatla [this message]
2025-03-25 11:40 ` [PATCH v5 6/6] arm64: dts: qcom: x1e78100-t14s: Enable audio headset support srinivas.kandagatla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b993c7a4-ff3e-4e79-bde8-2b5bdf3f2fff@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=andersson@kernel.org \
--cc=broonie@kernel.org \
--cc=christopher.obbard@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=ivprusov@salutedevices.com \
--cc=johan+linaro@kernel.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=paulha@opensource.cirrus.com \
--cc=peda@axentia.se \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=tiwai@suse.com \
--cc=zhoubinbin@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox