From: "Wang, Sen" <sen@ti.com>
To: Mark Brown <broonie@kernel.org>
Cc: <shenghao-ding@ti.com>, <kevin-lu@ti.com>, <baojun.xu@ti.com>,
<lgirdwood@gmail.com>, <perex@perex.cz>, <tiwai@suse.com>,
<linux-sound@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] ASoC: codecs: tas675x: use READ_ONCE for params to be used concurrently
Date: Thu, 2 Jul 2026 12:59:03 -0500 [thread overview]
Message-ID: <c52dfaad-ad3c-41a0-bfb4-7a9c33beba13@ti.com> (raw)
In-Reply-To: <53fe396b-12c6-46d0-9cb6-d492e8cc7d96@sirena.org.uk>
On 7/1/2026 1:55 PM, Mark Brown wrote:
> On Tue, Jun 30, 2026 at 01:31:20PM -0500, Sen Wang wrote:
>> active_playback_dais and active_capture_dais are written atomically via
>> set_bit()/clear_bit() and can be read concurrently from the
>> fault_check_work delayed work handler.
>>
>> fault_check_work already uses READ_ONCE; extend the same guard to all other
>> reads in tas675x_hw_params() and tas675x_mute_stream().
>
> I'm not convinced that any of this READ_ONCE stuff is safe, that's a
> very unusual pattern for an I2C device like these, but given that I
> missed it earlier I'll take the patch for now.
You're right mark, READ_ONCE only makes the variable volatile. I had a
false assumption that it also adds memory barrier as well. This patch
should be dropped as it provides no inherent benefit.
Tracing back, the reasons for needing to keeping a separate record of
active DAIs was the unreliable active count when calling
snd_soc_component_active in mute_stream when I first developed the
driver, I should look deeper into that instead...
next prev parent reply other threads:[~2026-07-02 17:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 18:31 [PATCH 0/3] ASoC: codecs: tas675x: misc bugfixes and minor changes Sen Wang
2026-06-30 18:31 ` [PATCH 1/3] ASoC: codecs: tas675x: use READ_ONCE for params to be used concurrently Sen Wang
2026-07-01 18:55 ` Mark Brown
2026-07-02 17:59 ` Wang, Sen [this message]
2026-06-30 18:31 ` [PATCH 2/3] ASoC: codecs: tas675x: Fix CHx temperature range register bit fields Sen Wang
2026-06-30 18:31 ` [PATCH 3/3] Documentation: sound: tas675x: Fix temperature range and impedance documentation Sen Wang
2026-07-01 18:53 ` [PATCH 0/3] ASoC: codecs: tas675x: sound bugfixes and minor changes Mark Brown
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=c52dfaad-ad3c-41a0-bfb4-7a9c33beba13@ti.com \
--to=sen@ti.com \
--cc=baojun.xu@ti.com \
--cc=broonie@kernel.org \
--cc=kevin-lu@ti.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=shenghao-ding@ti.com \
--cc=tiwai@suse.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.