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=1796391121; b=kr/BsCVFppnatfyZgQzHRSE2VgDbrYGiQh+ORmLRi+kAVN8aD7Zku4HopMlRT+FQoFTM 0TV11eklKsWB5OjSEFqs5Buaw0s5WKYbZGGL6sKE50f/KsuigLOn3bWT0t2FKj2b10WLr dSasjMBEY2tj1TUcPuq/KdZXVvXhOAffAzijb7AbXsezFEExrJgKkbTuK9zyCjoNX9YoP KPg/pfUs/ZBBnsqXExPMLdJY2dpljr8G9cBT26MDtqeLElPweBEUaPGXudTVn5B46Olkv GzcRPA7YMgJtxovIxc9Zy6woAAfBmMS4+vBCt3hbcqZ50Yl5jW5UWlrBMrzgr5v7GJQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796391121; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=EwYGezQLXjBwq9jE5uKEDRQvXTr6W7s/xSa3a6Fa+Xs=; b=Bib09ApcmRjlzmzaRh2t8jmVIaMEF6gJUwN0uqo3aO0xt9T8E1ZkEQv04HNZm0Ha5bu8 V+6o7KNRgOVrLx0tsEhE5XiahWBsjqF3etEDUQW3OmU8eIQR6tFI+BqI222fPKaaSg6K1 sa0XtSY1ktxqPi+d8yyMbbl8QtAWw9ymTKXqyx//mDRtvoB+GmdQDn20mlscUd807T/yQ 2TF5zdhg8Ekz2enGdn4LU2Er+Zcvz8bk01zrhG+q3Mp+KgrWNeIJIzh/nwLT7YOY++doJ o5xr80c2rHkZDhIsZ8AXisL+FlIX1igPM6oGukee9ZJLadrJdp4qD4pqPnIPI+3gAVw== 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=PVgtXRp8; 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 8B94D606A69C; Fri, 4 Dec 2026 13:32: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=PVgtXRp8 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB1131F00A20; Fri, 4 Dec 2026 13:32:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796391121; bh=EwYGezQLXjBwq9jE5uKEDRQvXTr6W7s/xSa3a6Fa+Xs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=PVgtXRp8GDC0pXOaPlll+Z50kPD2Uya2TBeoRSfMxm0SxURDR3NtRt16OB/w4Ccob K8nPOwhoSbpouH3p2z34jAWgM70sobxkJmUxiv7Woxyx9j8dm+FjHRLj87NYpVlw6C X0cnb/kFs9E8T+CZvpjKsB5qDtvW2bXGdopCo+rm2wX/yv1XXSoScJlKAj0rLfv25G /bsXz0vq+10mMRFI0icJXDgDCI6sg/ULgTQIW+Wzq5mNPkB/AWwCIP5TgwJvePfFV7 W/X+pCfguaEdLe52pEBQ8QEqnBSidZMKi11FCAtyRXuSgHvLRHQ6fFQr2ZYi9snJOx srZjcLktS9nWw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 12/24] ASoC: qcom: audioreach: cache VI calibration results per speaker 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-13-srinivas.kandagatla@oss.qualcomm.com> References: <20261204113101.1141644-1-srinivas.kandagatla@oss.qualcomm.com> <20261204113101.1141644-13-srinivas.kandagatla@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 13:32: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 2 potential issues to consider: - [Medium] ASoC: qcom: audioreach: audioreach_speaker_protection_vi() fails to disarm - [Low] ASoC: qcom: audioreach: misformatted negative Q24 in sp_vi_q24_to_int_frac() -- commit 526a49a4a17fcef52a050edcbb06e65ae2642deb Author: Ravi Hothi ASoC: qcom: audioreach: cache VI calibration results per speaker This commit adds a per-speaker cache for VI calibration state and R0 resistance values, logging each state once per speaker and arming the cache when configuring the VI module. > diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/aud= ioreach.c > index c7444f8598c86..a187e0b136330 100644 > --- a/sound/soc/qcom/qdsp6/audioreach.c > +++ b/sound/soc/qcom/qdsp6/audioreach.c [ ... ] > +static int sp_vi_q24_to_int_frac(s32 val, int *frac) > +{ > + *frac =3D (int)(((s64)(val & 0xffffff) * 1000) >> 24); > + > + return val >> 24; > +} [Severity: Low] Does sp_vi_q24_to_int_frac() format negative Q24 values accurately? For a negative value like -0.5 ohms (-0x00800000), val >> 24 floors to -1 while val & 0xffffff gives the positive remainder (500), so the %d.%03d log in audioreach_vi_calibration_event() prints -1.500 ohms instead of -0.500 ohms. Values in (-1.0, 0.0) also have integer magnitude 0, so %d drops the minus sign unless the sign is formatted separately from the unsigned magnitude. This corrupts the logged resistance when the DSP reports a negative out-of-range r0_cali_q24 value. [ ... ] > @@ -1516,6 +1640,8 @@ static int audioreach_speaker_protection_vi(struct = q6apm_graph *graph, > return -EINVAL; > } > =20 > + audioreach_arm_vi_calibration(); > + > rc =3D audioreach_register_events(graph, module); > if (rc) > return rc; [Severity: Medium] Can this leave sp_vi_r0.armed set if VI configuration fails? audioreach_arm_vi_calibration() sets sp_vi_r0.armed and clears sp_vi_r0.seen_states before audioreach_register_events(), audioreach_alloc_apm_cmd_pkt(), q6apm_send_cmd_sync(), and audioreach_module_enable() in audioreach_set_media_format(). If audioreach_register_events() succeeds and one of those later steps fails on a capture back-end stream (q6apm_lpass_dai_prepare() skips q6apm_graph_close() for capture) or a front-end stream, the graph stays open with the event registered and sp_vi_r0.armed set. Any event arriving from that graph then clears the cached sp_vi_r0 result. Disarming sp_vi_r0.armed on error, or arming only after configuration and module enablement succeed, would avoid leaving the cache armed. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204113101.1141= 644-1-srinivas.kandagatla@oss.qualcomm.com?part=3D12