* [PATCH 0/3] ASoC: codecs: tas675x: misc bugfixes and minor changes
@ 2026-06-30 18:31 Sen Wang
2026-06-30 18:31 ` [PATCH 1/3] ASoC: codecs: tas675x: use READ_ONCE for params to be used concurrently Sen Wang
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Sen Wang @ 2026-06-30 18:31 UTC (permalink / raw)
To: broonie, shenghao-ding, kevin-lu, baojun.xu
Cc: lgirdwood, perex, tiwai, linux-sound, linux-kernel, Sen Wang
Few miscellaneous bug fixes after the initial merge of TAS675x driver, of
which includes:
- Adding READ_ONCE for all concurrent read params
- Corrected kcontrol bits for temperature range
- Corrected conversion notes in the driver documentation
Sen Wang (3):
ASoC: codecs: tas675x: use READ_ONCE for params to be used
concurrently
ASoC: codecs: tas675x: Fix CHx temperature range register bit fields
Documentation: sound: tas675x: Fix temperature range and impedance
documentation
Documentation/sound/codecs/tas675x.rst | 12 ++++++++----
sound/soc/codecs/tas675x.c | 8 ++++----
2 files changed, 12 insertions(+), 8 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] ASoC: codecs: tas675x: use READ_ONCE for params to be used concurrently
2026-06-30 18:31 [PATCH 0/3] ASoC: codecs: tas675x: misc bugfixes and minor changes Sen Wang
@ 2026-06-30 18:31 ` Sen Wang
2026-07-01 18:55 ` Mark Brown
2026-06-30 18:31 ` [PATCH 2/3] ASoC: codecs: tas675x: Fix CHx temperature range register bit fields Sen Wang
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Sen Wang @ 2026-06-30 18:31 UTC (permalink / raw)
To: broonie, shenghao-ding, kevin-lu, baojun.xu
Cc: lgirdwood, perex, tiwai, linux-sound, linux-kernel, Sen Wang
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().
Fixes: 133c81f84471 ("ASoC: codecs: Add TAS67524 quad-channel audio amplifier driver")
Signed-off-by: Sen Wang <sen@ti.com>
---
sound/soc/codecs/tas675x.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/tas675x.c b/sound/soc/codecs/tas675x.c
index e3b18451abecc7..a3e0dd75e8ba0c 100644
--- a/sound/soc/codecs/tas675x.c
+++ b/sound/soc/codecs/tas675x.c
@@ -1133,7 +1133,7 @@ static int tas675x_hw_params(struct snd_pcm_substream *substream,
* Single clock domain: SDIN and SDOUT share one SCLK/FSYNC pair,
* so all active DAIs must use the same sample rate.
*/
- if ((tas->active_playback_dais || tas->active_capture_dais) &&
+ if ((READ_ONCE(tas->active_playback_dais) || READ_ONCE(tas->active_capture_dais)) &&
tas->rate && tas->rate != rate) {
dev_err(component->dev,
"Rate %u conflicts with active rate %u\n",
@@ -1397,14 +1397,14 @@ static int tas675x_mute_stream(struct snd_soc_dai *dai, int mute, int direction)
set_bit(dai->id, &tas->active_playback_dais);
/* Last playback stream */
- if (mute && !tas->active_playback_dais) {
+ if (mute && !READ_ONCE(tas->active_playback_dais)) {
ret = tas675x_set_state_all(tas, TAS675X_STATE_SLEEP_BOTH);
regmap_read(tas->regmap, TAS675X_CLK_FAULT_LATCHED_REG, &discard);
return ret;
}
return tas675x_set_state_all(tas,
- tas->active_playback_dais ?
+ READ_ONCE(tas->active_playback_dais) ?
TAS675X_STATE_PLAY_BOTH :
TAS675X_STATE_SLEEP_BOTH);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] ASoC: codecs: tas675x: Fix CHx temperature range register bit fields
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-06-30 18:31 ` 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
3 siblings, 0 replies; 7+ messages in thread
From: Sen Wang @ 2026-06-30 18:31 UTC (permalink / raw)
To: broonie, shenghao-ding, kevin-lu, baojun.xu
Cc: lgirdwood, perex, tiwai, linux-sound, linux-kernel, Sen Wang
The initial merged patch mixed up the bits for temp reg with LDG report,
now fixing to the right bits according to TRM (SLOU589A).
Fixes: 133c81f84471 ("ASoC: codecs: Add TAS67524 quad-channel audio amplifier driver")
Signed-off-by: Sen Wang <sen@ti.com>
---
sound/soc/codecs/tas675x.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/tas675x.c b/sound/soc/codecs/tas675x.c
index 6f89a422f3c6..844cb603d721 100644
--- a/sound/soc/codecs/tas675x.c
+++ b/sound/soc/codecs/tas675x.c
@@ -954,10 +954,10 @@ static const struct snd_kcontrol_new tas675x_snd_controls[] = {
/* Temperature and Voltage Monitoring */
SOC_SINGLE_RO("PVDD Sense", TAS675X_PVDD_SENSE_REG, 0, 0xFF),
SOC_SINGLE_RO("Global Temperature", TAS675X_TEMP_GLOBAL_REG, 0, 0xFF),
- SOC_SINGLE_RO("CH1 Temperature Range", TAS675X_TEMP_CH1_CH2_REG, 6, 3),
- SOC_SINGLE_RO("CH2 Temperature Range", TAS675X_TEMP_CH1_CH2_REG, 4, 3),
- SOC_SINGLE_RO("CH3 Temperature Range", TAS675X_TEMP_CH3_CH4_REG, 2, 3),
- SOC_SINGLE_RO("CH4 Temperature Range", TAS675X_TEMP_CH3_CH4_REG, 0, 3),
+ SOC_SINGLE_RO("CH1 Temperature Range", TAS675X_TEMP_CH1_CH2_REG, 0, 7),
+ SOC_SINGLE_RO("CH2 Temperature Range", TAS675X_TEMP_CH1_CH2_REG, 3, 7),
+ SOC_SINGLE_RO("CH3 Temperature Range", TAS675X_TEMP_CH3_CH4_REG, 0, 7),
+ SOC_SINGLE_RO("CH4 Temperature Range", TAS675X_TEMP_CH3_CH4_REG, 3, 7),
/* Speaker Protection & Detection */
SOC_SINGLE("Tweeter Detection Switch", TAS675X_TWEETER_DETECT_CTRL_REG, 0, 1, 1),
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] Documentation: sound: tas675x: Fix temperature range and impedance documentation
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-06-30 18:31 ` [PATCH 2/3] ASoC: codecs: tas675x: Fix CHx temperature range register bit fields Sen Wang
@ 2026-06-30 18:31 ` Sen Wang
2026-07-01 18:53 ` [PATCH 0/3] ASoC: codecs: tas675x: sound bugfixes and minor changes Mark Brown
3 siblings, 0 replies; 7+ messages in thread
From: Sen Wang @ 2026-06-30 18:31 UTC (permalink / raw)
To: broonie, shenghao-ding, kevin-lu, baojun.xu
Cc: lgirdwood, perex, tiwai, linux-sound, linux-kernel, Sen Wang
Two corrections against the TRM (SLOU589A):
- Corrected channel temperature range
- Corrected conversion formula for global temperature
Fixes: ba46edca354e ("Documentation: sound: Add TAS675x codec mixer controls documentation")
Signed-off-by: Sen Wang <sen@ti.com>
---
Documentation/sound/codecs/tas675x.rst | 14 ++++++++------
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/Documentation/sound/codecs/tas675x.rst b/Documentation/sound/codecs/tas675x.rst
index 3b99c31593cf..e006eb8a03ee 100644
--- a/Documentation/sound/codecs/tas675x.rst
+++ b/Documentation/sound/codecs/tas675x.rst
@@ -281,7 +281,7 @@ Global Temperature
:Description: Global die temperature sense register.
:Type: Integer (read-only)
:Range: 0 to 255
-:Conversion: (value × 0.5 °C) − 50 °C
+:Conversion: value × 2.19 K; subtract 273.15 for °C
:Register: 0x75
CHx Temperature Range
@@ -289,10 +289,11 @@ CHx Temperature Range
:Description: Per-channel coarse temperature range indicator (x = 1, 2, 3, 4).
:Type: Integer (read-only)
-:Range: 0 to 3
-:Mapping: 0 = <80 °C, 1 = 80–100 °C, 2 = 100–120 °C, 3 = >120 °C
-:Register: 0xBB bits [7:6] (CH1), bits [5:4] (CH2),
- 0xBC bits [3:2] (CH3), bits [1:0] (CH4)
+:Range: 0 to 7
+:Mapping: 0 = <95 °C, 1 = 95–110 °C, 2 = 110–125 °C, 3 = 125–135 °C,
+ 4 = 135–145 °C, 5 = 145–155 °C, 6 = 155–165 °C, 7 = >165 °C
+:Register: 0xBB bits [2:0] (CH1), bits [5:3] (CH2),
+ 0xBC bits [2:0] (CH3), bits [5:3] (CH4)
Load Diagnostics
================
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] ASoC: codecs: tas675x: sound bugfixes and minor changes
2026-06-30 18:31 [PATCH 0/3] ASoC: codecs: tas675x: misc bugfixes and minor changes Sen Wang
` (2 preceding siblings ...)
2026-06-30 18:31 ` [PATCH 3/3] Documentation: sound: tas675x: Fix temperature range and impedance documentation Sen Wang
@ 2026-07-01 18:53 ` Mark Brown
3 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2026-07-01 18:53 UTC (permalink / raw)
To: shenghao-ding, kevin-lu, baojun.xu, Sen Wang
Cc: lgirdwood, perex, tiwai, linux-sound, linux-kernel
On Tue, 30 Jun 2026 13:31:19 -0500, Sen Wang wrote:
> ASoC: codecs: tas675x: sound bugfixes and minor changes
>
> Few soundellaneous bug fixes after the initial merge of TAS675x driver, of
> which includes:
>
> - Adding READ_ONCE for all concurrent read params
> - Corrected kcontrol bits for temperature range
> - Corrected conversion notes in the driver documentation
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.2
Thanks!
[1/3] ASoC: codecs: tas675x: use READ_ONCE for params to be used concurrently
https://git.kernel.org/broonie/sound/c/12272cb1b23e
[2/3] ASoC: codecs: tas675x: Fix CHx temperature range register bit fields
https://git.kernel.org/broonie/sound/c/a044f99d000d
[3/3] Documentation: sound: tas675x: Fix temperature range and impedance documentation
https://git.kernel.org/broonie/sound/c/c34a4be8b846
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] ASoC: codecs: tas675x: use READ_ONCE for params to be used concurrently
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
0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2026-07-01 18:55 UTC (permalink / raw)
To: Sen Wang
Cc: shenghao-ding, kevin-lu, baojun.xu, lgirdwood, perex, tiwai,
linux-sound, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 570 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] ASoC: codecs: tas675x: use READ_ONCE for params to be used concurrently
2026-07-01 18:55 ` Mark Brown
@ 2026-07-02 17:59 ` Wang, Sen
0 siblings, 0 replies; 7+ messages in thread
From: Wang, Sen @ 2026-07-02 17:59 UTC (permalink / raw)
To: Mark Brown
Cc: shenghao-ding, kevin-lu, baojun.xu, lgirdwood, perex, tiwai,
linux-sound, linux-kernel
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...
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-07-03 11:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox