From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796392741; b=dcR7x1Y2E/Yodjq5W4C9wVbBB1a4IHa6lS5JWMxL8Ni4LqsB0s2WoJ+qR5KsNmCIrCIr Xkga6E4GeWHLRSOw0sS5qQ9bhAm8umVfQic/Hp65dcT50FJ2f96POAJwwse3leQBgufZj 0HVSAHFux0RggAigFqkFZyQuRLycXn8ntlQUtpSiqJJLw72usHL30+qNQ+xMf0OIXVFU/ 8QFa6jrHdhfUdBgnq4+tiIJP4SqRNUdO5GZzn/cWzW5Ssd9p+mAV1ICMxQll4rrQOs/rc +CvOSnPnJmn+/A5lrWoINccx/y2D/fUE5CQoW3uIcIBTUvpQV6B5aVlVP96HyGQXYCQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796392741; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=5ppTczCuAobLOh4ArARBeMaIccn4e53poorrK7SuqO8=; b=PhMzmKGS+lgqxMSv27Ey6ua5+aDh9H0WcsgwToz3Egh+hMjcSttFEndYx+wqHVHf0VQK xNmvvfzvn2uegHBkDg9qAQBldZFkCAlSoN/0V6bMKZRDIkH8MJ7CjM4OEp2OO8ZGRNtaJ 1QYSXpQ3kRPRc2/h9cfvFA/lTCm2GkPdDiiQnitvb/DvqodwtU9S79r36ZJC6YEGdeoW0 YndPixPvtrs0MkXCq9nL6wc1zj/zDEBETrfzCA2593xuc/c23wQb3OEurXfkGGG8+MjiG 2leCqeTkJ8PQW++AVCjkFcWxQgqBRAj2rBL49Tc/mHSx+Mlvf0itS4fvdioP+6jzZRw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YPpnOCuu; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AD04606A33C; Fri, 4 Dec 2026 13:59:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YPpnOCuu Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA0821F000CE; Fri, 4 Dec 2026 13:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796392740; bh=5ppTczCuAobLOh4ArARBeMaIccn4e53poorrK7SuqO8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=YPpnOCuuqSMx+3/RTva6iUSxVLAZKsMLNeXY/yGzHVQ1EN9NkfUd4DXLL6XmxGn2O UoSX6ublbUsUfGsfmA4K+HqCQNiF8rfX9gHdYOsZl8uGGd+FcpbMPahoavNrs546gs QtiZPpxUOXQJdq8TjCZl4vdl2gZWxjDjoHGQfz/pbmFpbNYAijNiFhfwE9RElGZvmV pK2qliT1dOhOpTSPWkr2rHSN6klwduM8uMkXiaPoGpvr7KSTpuru3Sb+NX/tIe/qBI YRepdEI1iKFrNfS+QiKGZQOD28CvoxSPqUlzmFBGDB0kJkT/HzCACKUdSckGO9BVrN NqqZgSRdHN3Yg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 19/24] ASoC: qcom: audioreach: add speaker protection calibration state control Reply-To: sashiko-reviews@lists.linux.dev To: "Srinivas Kandagatla" Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261204113101.1141644-20-srinivas.kandagatla@oss.qualcomm.com> References: <20261204113101.1141644-1-srinivas.kandagatla@oss.qualcomm.com> <20261204113101.1141644-20-srinivas.kandagatla@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 13:59:00 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 15 potential issues to consider: - [High] ASoC: qcom: audioreach_speaker_protection() signature mismatch breaks build - [High] ASoC: qcom: audioreach: unreadable T0 silently cached as 0 degC - [High] ASoC: qcom: audioreach: AB-BA deadlock on sp_vi_r0t0_cfg_lock and mode TOCTOU - [High] ASoC: qcom: audioreach: thermal_zone_get_temp() deadlocks/stalls qcom_apr_rx - [Medium] ASoC: qcom: audioreach: audioreach_vi_calibration_abort() clobbers mode - [Medium] ASoC: qcom: audioreach: calibration finish and watchdog races - [Medium] ASoC: qcom: audioreach: unsynchronized sp_operation_mode reads across sleep - [Medium] ASoC: qcom: audioreach: uncancelled sp_cal_watchdog UAF on module unload - [Medium] ASoC: qcom: audioreach: watchdog cancel race and stale armed flag on timeout - [Medium] ASoC: qcom: audioreach: stale calibration state and private enum UAPI - [Medium] ASoC: qcom: audioreach: ALSA control naming, bounds, and metadata bugs - [Medium] ASoC: qcom: audioreach: commit message omits major diff changes - [Medium] ASoC: qcom: wrong finish ordering in audioreach_vi_calibration_abort() - [Low] ASoC: qcom: audioreach: zero-channel calibration event wipes cached R0/T0 - [Low] ASoC: qcom: audioreach: stale last_state persists after patch 21 revert -- commit 19afa322a5aa9b79ab842d41723d8a15d853a182 Author: Srinivas Kandagatla > ASoC: qcom: audioreach: add speaker protection calibration state control > > Add a read-only "Speaker Protection Calibration State" control with > each speaker's last calibration state, so userspace can follow a run. > > Signed-off-by: Srinivas Kandagatla [Severity: Medium] Should this commit be split or its commit message updated to match the diff? The title and description only mention adding the read-only "Speaker Protection Calibration State" control, while the patch also adds the writab= le "Speaker Protection Calibrate" trigger control, adds audioreach_vi_calibration_abort() and its q6apm_graph_close() / q6apm_graph_stop() hooks, reverts the unreadable-T0 -EAGAIN check in audioreach_get_sp_vi_t0() and audioreach_vi_calibration_event(), and changes the signature of audioreach_speaker_protection(). > diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/aud= ioreach.c > index cf6c686f88bdd..166ce59347f8d 100644 > --- a/sound/soc/qcom/qdsp6/audioreach.c > +++ b/sound/soc/qcom/qdsp6/audioreach.c [ ... ] > @@ -1608,16 +1611,10 @@ int audioreach_sp_register_speaker_map(struct the= rmal_zone_device * const *tzs, > } > EXPORT_SYMBOL_GPL(audioreach_sp_register_speaker_map); > =20 > -/* > - * Read each speaker's T0 in Q6 (degC * 64), 0 if its zone cannot be rea= d. > - * Returns the number of slots read, or -EAGAIN if any registered slot c= ame > - * back unreadable (e.g. the PA was on, so TADC was off). A partial read= ing > - * must not be cached as a valid calibration reference. > - */ > +/* Read each speaker's T0 in Q6 (degC * 64), 0 if its zone cannot be rea= d */ > int audioreach_get_sp_vi_t0(long *vals, unsigned int count) > { > unsigned int i, n; > - bool any_failed =3D false; > =20 > guard(mutex)(&sp_speaker_map_lock); > =20 > @@ -1626,23 +1623,33 @@ int audioreach_get_sp_vi_t0(long *vals, unsigned = int count) > int mdeg; > =20 > if (sp_speaker_map.tz[i] && > - !thermal_zone_get_temp(sp_speaker_map.tz[i], &mdeg)) { > + !thermal_zone_get_temp(sp_speaker_map.tz[i], &mdeg)) > vals[i] =3D div_s64((s64)mdeg * 64, 1000); > - } else { > + else > vals[i] =3D 0; > - any_failed =3D true; > - } > } > for (; i < count; i++) > vals[i] =3D 0; > =20 > - if (any_failed) > - return -EAGAIN; > - > return n; > } > EXPORT_SYMBOL_GPL(audioreach_get_sp_vi_t0); [Severity: High] Does removing the -EAGAIN error path here and the t0_rc < 0 check in audioreach_vi_calibration_event() allow unreadable temperatures to be cached as 0 degC? During calibration playback the WSA884x PA is on, so wsa884x_get_temp() returns -EAGAIN when no prior temperature was cached. wsa884x_tz_get_temp() maps that to THERMAL_TEMP_INVALID, which thermal_zone_get_temp() turns into -ENODATA. With the check removed, audioreach_vi_calibration_event() stores t0_cali_q6 =3D 0 alongside the calibrated r0_cali_q24, shifting the DSP's voice-coil temperature estimate downward by 25-40 degC on later Normal-mode playback and undermining speaker thermal protection. [ ... ] > @@ -1724,11 +1731,14 @@ void audioreach_vi_calibration_event(struct devic= e *dev, > sp_vi_r0.state =3D SP_VI_CALI_RUNNING; > sp_vi_r0.num_ch =3D 0; > memset(sp_vi_r0.r0_cali_q24, 0, sizeof(sp_vi_r0.r0_cali_q24)); > + memset(sp_vi_r0.last_state, 0, sizeof(sp_vi_r0.last_state)); > } [Severity: Low] Later in the series, commit "ASoC: qcom: x1e80100: register WSA speaker thermal zones for speaker protection" deletes this memset() of sp_vi_r0.last_state. Because audioreach_get_sp_vi_cal_state() always copies all MAX_SP_VI_SPEAKERS entries, a run with fewer channels after an earlier run leaves stale states in slots >=3D num_ch. > =20 > for (i =3D 0; i < num_ch; i++) { > u32 state =3D cali->cali_param[i].state; > =20 > + sp_vi_r0.last_state[i] =3D state; > + > if (sp_vi_cali_state_is_failure(state)) > success =3D false; > else if (!sp_vi_cali_state_is_terminal(state)) [Severity: Low] Can a zero-channel calibration event wipe the cached R0/T0 configuration? q6apm_vi_calibration_event() still calls audioreach_vi_calibration_event() when num_ch is 0 (for example on a header-only payload or cali->num_ch =3D= =3D 0). This loop then executes zero iterations, leaving decisive and success true, which disarms calibration, zeroes sp_vi_r0.last_state, and overwrites sp_vi_r0t0_cfg.num_ch with 0. [ ... ] > @@ -1772,24 +1782,16 @@ void audioreach_vi_calibration_event(struct devic= e *dev, > /* > * Only a run where every speaker succeeded gives a usable R0/T0 set. > * The DSP reports only R0, so pair it with the speakers' last T0 > - * reading. If any zone was unreadable (e.g. PA still on), skip the > - * cache: a 0 degC Q6 would be stored as a valid calibration ref. > + * reading; a zone that cannot be read gives T0 =3D 0. > */ > if (success) { > - int t0_rc =3D audioreach_get_sp_vi_t0(t0_live, num_ch); > + audioreach_get_sp_vi_t0(t0_live, num_ch); [Severity: High] Can calling audioreach_get_sp_vi_t0() synchronously from audioreach_vi_calibration_event() self-deadlock the single-threaded qcom_apr_rx workqueue? qcom_apr_rx dispatches both q6apm events and q6prm clock responses. When wsa884x->pa_on is false, thermal_zone_get_temp() resumes the WSA884x and SoundWire controller, which prepares the q6prmcc macro clock via a synchronous GPR command waiting on the same blocked workqueue: qcom_apr_rx audioreach_vi_calibration_event() lock(&sp_vi_r0_lock) audioreach_get_sp_vi_t0() ... -> wsa884x_get_temp() pm_runtime_resume_and_get() ... -> clk_prepare_enable(wsa->macro) q6prm_send_cmd_sync() wait_event_timeout(&prm->wait, ...) <-- self-deadlock That stalls all GPR traffic for 5 seconds per clock vote and causes T0 readback to fail (caching T0 =3D 0 degC); even without a clock vote, blocki= ng SoundWire regmap I/O here stalls PCM completion callbacks and sp_vi_r0_lock readers. > + guard(mutex)(&sp_vi_r0t0_cfg_lock); > + sp_vi_r0t0_cfg.num_ch =3D num_ch; > + for (i =3D 0; i < num_ch; i++) { > + sp_vi_r0t0_cfg.r0_cali_q24[i] =3D cali->cali_param[i].r0_cali_q24; > + sp_vi_r0t0_cfg.t0_cali_q6[i] =3D (s16)t0_live[i]; > } > } [Severity: High] Can acquiring sp_vi_r0t0_cfg_lock here ABBA deadlock with audioreach_speaker_protection_vi() across the single-threaded qcom_apr_rx workqueue? audioreach_speaker_protection_vi() holds sp_vi_r0t0_cfg_lock across q6apm_send_cmd_sync(), which waits for apm_callback() on qcom_apr_rx: CPU0 qcom_apr_rx audioreach_speaker_protection_vi() lock(&sp_vi_r0t0_cfg_lock) q6apm_send_cmd_sync() audioreach_vi_calibration_event() lock(&sp_vi_r0t0_cfg_lock) <-- blocks wait_event_timeout(&apm->wait) <-- waits for apm_callback() If qcom_apr_rx dequeues a calibration event before the APM_CMD_SET_CFG response (from a concurrent graph or via the unlocked re-read of sp_operation_mode in audioreach_speaker_protection_vi()), all GPR traffic stalls until the 5-second timeout expires and speaker protection activation fails. [ ... ] > @@ -1799,11 +1801,51 @@ void audioreach_vi_calibration_event(struct devic= e *dev, > audioreach_sp_finish_calibration(); > } > =20 > +/* A run cut short never reports a final state, close it out */ > +void audioreach_vi_calibration_abort(struct device *dev) > +{ > + unsigned int i; > + > + /* Back to Normal before anything else, so a racing trigger is clean */ > + audioreach_sp_finish_calibration(); > + > + guard(mutex)(&sp_vi_r0_lock); > + > + if (!sp_vi_r0.armed) > + return; > + > + sp_vi_r0.armed =3D false; > + > + /* The DSP never reported on this run: keep the previous result */ > + if (!memchr_inv(sp_vi_r0.seen_states, 0, sizeof(sp_vi_r0.seen_states))) > + return; [Severity: Medium] Is audioreach_sp_finish_calibration() called in the right place here? Calling it unconditionally before acquiring sp_vi_r0_lock and checking sp_vi_r0.armed clears a pending calibration trigger whenever a Normal-mode VI graph stops or closes, and opens a window where a newly armed run gets immediately disarmed once sp_vi_r0_lock is acquired. Commit "ASoC: qcom: x1e80100: register WSA speaker thermal zones for speaker protection" later moves audioreach_sp_finish_calibration() to the end of th= is function, after the seen_states early return, which leaves sp_operation_mode stuck in Calibration for 60 seconds whenever prepare fails or the graph sto= ps before the first DSP event. Calling audioreach_sp_finish_calibration() und= er sp_vi_r0_lock right after clearing sp_vi_r0.armed and before the seen_states check avoids both bugs. [ ... ] > static int audioreach_speaker_protection(struct q6apm_graph *graph, > - const struct audioreach_module *module) > + const struct audioreach_module *module, > + u32 mode) > { > - return audioreach_send_u32_param(graph, module, PARAM_ID_SP_OP_MODE, > - READ_ONCE(sp_operation_mode)); > + return audioreach_send_u32_param(graph, module, PARAM_ID_SP_OP_MODE, mo= de); > } [Severity: High] Does adding the third parameter to audioreach_speaker_protection() break the build? Its only caller in audioreach_set_media_format() still passes two arguments: sound/soc/qcom/qdsp6/audioreach.c:audioreach_set_media_format() { ... case MODULE_ID_SPEAKER_PROTECTION: rc =3D audioreach_speaker_protection(graph, module); ... } This fails compilation whenever CONFIG_SND_SOC_QDSP6_APM is enabled and breaks git bisect, even though commit "ASoC: qcom: x1e80100: register WSA speaker thermal zones for speaker protection" later reverts this hunk. > diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c > index c410e2f6e6a3f..35daf763287cc 100644 > --- a/sound/soc/qcom/qdsp6/q6apm.c > +++ b/sound/soc/qcom/qdsp6/q6apm.c > @@ -815,10 +815,19 @@ struct q6apm_graph *q6apm_graph_open(struct device = *dev, q6apm_cb cb, > } > EXPORT_SYMBOL_GPL(q6apm_graph_open); > =20 > +static void q6apm_graph_abort_vi_calibration(struct q6apm_graph *graph) > +{ > + if (q6apm_find_module_by_mid(graph, MODULE_ID_SPEAKER_PROTECTION_VI)) > + audioreach_vi_calibration_abort(graph->dev); > +} > + > int q6apm_graph_close(struct q6apm_graph *graph) > { > struct audioreach_graph *ar_graph =3D graph->ar_graph; > =20 > + /* Covers a graph closed without ever being started, e.g. on prepare fa= ilure */ > + q6apm_graph_abort_vi_calibration(graph); > + > graph->ar_graph =3D NULL; > kref_put(&ar_graph->refcount, q6apm_put_audioreach_graph); > gpr_free_port(graph->port); > @@ -854,6 +863,7 @@ EXPORT_SYMBOL_GPL(q6apm_graph_start); > int q6apm_graph_stop(struct q6apm_graph *graph) > { > struct audioreach_graph *ar_graph =3D graph->ar_graph; > + int ret; > =20 > if (ar_graph->start_count =3D=3D 0) > return 0; > @@ -861,7 +871,10 @@ int q6apm_graph_stop(struct q6apm_graph *graph) > if (--ar_graph->start_count > 0) > return 0; > =20 > - return audioreach_graph_mgmt_cmd(ar_graph, APM_CMD_GRAPH_STOP); > + ret =3D audioreach_graph_mgmt_cmd(ar_graph, APM_CMD_GRAPH_STOP); > + q6apm_graph_abort_vi_calibration(graph); > + > + return ret; > } [Severity: Medium] Can calling q6apm_graph_abort_vi_calibration() unconditionally on every VI graph stop and close clobber an armed calibration run? q6apm_lpass_dai_prepare() calls q6apm_graph_stop() on a running Normal-mode port right before q6apm_graph_media_format_pcm(), so an unconditional abort cancels a newly triggered calibration before the prepare path can consume i= t. In addition, q6apm_graph_close() calls q6apm_graph_abort_vi_calibration() before kref_put(&ar_graph->refcount, ...) without checking whether another open handle still holds or is running the shared ar_graph. > diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topol= ogy.c > index a8fdd73cdecdd..16327961d6c1b 100644 > --- a/sound/soc/qcom/qdsp6/topology.c > +++ b/sound/soc/qcom/qdsp6/topology.c [ ... ] > +static int audioreach_put_sp_calibrate(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_value *ucontrol) > +{ > + if (!ucontrol->value.integer.value[0]) > + return 0; > + > + return audioreach_trigger_sp_calibration() ? : 1; > +} [Severity: Medium] Now that audioreach_trigger_sp_calibration() is exposed to userspace, can concurrent writes race with audioreach_sp_finish_calibration() and audioreach_sp_cal_watchdog_fn()? audioreach_sp_finish_calibration() writes PARAM_ID_SP_VI_OP_MODE_NORMAL before calling non-synchronous cancel_delayed_work(&sp_cal_watchdog): CPU0 CPU1 audioreach_sp_finish_calibration() WRITE_ONCE(sp_operation_mode, NORMAL) audioreach_trigger_sp_calibration() cmpxchg(..., NORMAL, CALIBRATION) schedule_delayed_work(&sp_cal_watchdog) cancel_delayed_work(&sp_cal_watchdog) <-- cancels CPU1's watchdog An already-running audioreach_sp_cal_watchdog_fn() can also clear a newly triggered run back to Normal, and it resets sp_operation_mode without clearing sp_vi_r0.armed so late events from the timed-out graph can still invoke audioreach_sp_finish_calibration(). [Severity: Medium] Does exposing audioreach_trigger_sp_calibration() also make the watchdog cancel inversion and stale sp_vi_r0.armed flag reachable on timeout? If a concurrent trigger re-arms calibration between WRITE_ONCE() and cancel_delayed_work() in audioreach_sp_finish_calibration(), the new run's watchdog is cancelled and sp_operation_mode stays stuck in Calibration if no playback graph starts. Separately, when the 60-second watchdog expires whi= le a graph is armed, audioreach_sp_cal_watchdog_fn() leaves sp_vi_r0.armed set, so late DSP events from the expired run are still accepted and overwrite cached R0/T0 and calibration state. [Severity: Medium] Can unloading snd-q6apm while sp_cal_watchdog is pending cause a use-after-free? audioreach_put_sp_calibrate() is the first caller of audioreach_trigger_sp_calibration(), making schedule_delayed_work() on the module-static sp_cal_watchdog reachable from userspace. apm_remove() never cancels sp_cal_watchdog synchronously (audioreach_sp_shutdown() is declared in audioreach.h but neither defined nor called), so unloading snd-q6apm within 60 seconds of a trigger lets the timer run against freed module memory. Cancelling sp_cal_watchdog synchronously after of_platform_depopulate() and snd_soc_unregister_component() would prevent this. [Severity: Medium] Can concurrent writes to "Speaker Protection Calibrate" leave the DSP VI module configured inconsistently across sleeping GPR calls? audioreach_speaker_protection_vi() snapshots mode =3D READ_ONCE(sp_operation_mode) for event registration and PARAM_ID_SP_VI_OP_MODE_CFG, sleeps in q6apm_send_cmd_sync(), and then re-reads global sp_operation_mode directly instead of checking local mode. That can skip PARAM_ID_SP_TH_VI_R0T0_CFG in Normal mode (leaving speakers unprotected) or send it in Calibration mode. Furthermore, after commit "ASoC: qcom: x1e80100: register WSA speaker therm= al zones for speaker protection" reverts audioreach_speaker_protection(), MODULE_ID_SPEAKER_PROTECTION and MODULE_ID_SPEAKER_PROTECTION_VI in q6apm_graph_media_format_pcm() read sp_operation_mode separately across sleeping IPC calls and can receive different modes. [ ... ] > + { > + .iface =3D SNDRV_CTL_ELEM_IFACE_MIXER, > + .name =3D "Speaker Protection Calibration State", > + .access =3D SNDRV_CTL_ELEM_ACCESS_READ | > + SNDRV_CTL_ELEM_ACCESS_VOLATILE, > + /* Last calibration state per speaker (enum vi_calibration_state) */ > + .info =3D audioreach_info_sp_t0, > + .get =3D audioreach_get_sp_cal_state, > + }, [Severity: Medium] Can userspace polling "Speaker Protection Calibration State" read stale terminal state from a previous run, and should this avoid exposing a private kernel enum as raw integers? Neither audioreach_trigger_sp_calibration() nor audioreach_arm_vi_calibration() clears sp_vi_r0.last_state[], and audioreach_vi_calibration_abort() returns early if no DSP events arrived, so triggering a second run immediately shows the prior run's VI_CALIBRATION_STATE_SUCCESS until the first DSP event arrives. In addition, enum vi_calibration_state is defined only in private header sound/soc/qcom/qdsp6/audioreach.h, where 0 means both an uninitialized slot and VI_CALIBRATION_STATE_INCORRECT_OP_MODE, and abort overwrites non-termin= al slots with VI_CALIBRATION_STATE_INACTIVE (1), making an aborted run indistinguishable from DSP-reported INACTIVE. > + { > + /* > + * Write-only edge trigger. Writing 1 arms a calibration run > + * for the next (or current) WSA playback graph; the mode > + * returns to Normal on its own once the DSP reports terminal > + * state, on graph abort, or on the watchdog timeout. > + */ > + .iface =3D SNDRV_CTL_ELEM_IFACE_MIXER, > + .name =3D "Speaker Protection Calibrate", > + .access =3D SNDRV_CTL_ELEM_ACCESS_READWRITE | > + SNDRV_CTL_ELEM_ACCESS_VOLATILE, > + .info =3D audioreach_info_sp_calibrate, > + .get =3D audioreach_get_sp_calibrate, > + .put =3D audioreach_put_sp_calibrate, > + }, [Severity: Medium] Do these new controls violate ALSA mixer naming, bounds, and metadata conventions? "Speaker Protection Calibrate" is a writable SNDRV_CTL_ELEM_TYPE_BOOLEAN control whose name does not end in "Switch", which fails the naming check in tools/testing/selftests/alsa/mixer-test.c. audioreach_put_sp_calibrate() also only tests !ucontrol->value.integer.valu= e[0] without rejecting out-of-range values such as 2 or -1 with -EINVAL. "Speaker Protection Calibration State" reuses audioreach_info_sp_t0, advertising signed S32_MIN..S32_MAX temperature bounds for non-negative enum vi_calibration_state values (0..8). Finally, the comment above "Speaker Protection Calibrate" describes it as a write-only trigger affecting the next or current graph, whereas its access = is READWRITE and sp_operation_mode is only applied during graph media-format setup. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204113101.1141= 644-1-srinivas.kandagatla@oss.qualcomm.com?part=3D19