From: Riccardo Mereu <r.mereu.kernel@arduino.cc>
To: Srinivas Kandagatla <srini@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Alexey Klimov <alexey.klimov@linaro.org>
Cc: linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Riccardo Mereu <r.mereu@arduino.cc>,
stable@vger.kernel.org,
Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Subject: [PATCH 2/6] ASoC: codecs: pm4125: add compander channels to the RX channel table
Date: Tue, 1 Dec 2026 14:12:05 +0100 [thread overview]
Message-ID: <20261201131212.161224-3-r.mereu.kernel@arduino.cc> (raw)
In-Reply-To: <20261201131212.161224-1-r.mereu.kernel@arduino.cc>
From: Riccardo Mereu <r.mereu@arduino.cc>
The HPHL_COMP and HPHR_COMP switches pass PM4125_COMP_L and
PM4125_COMP_R as channel index to pm4125_connect_port(), but
pm4125_sdw_rx_ch_info[] only has entries for PM4125_HPH_L and
PM4125_HPH_R. The lookup reads past the end of the table and the port
number it returns is used, minus one, to index sdw_priv->port_config[].
That writes outside the array, onto the fields around it, including
the sruntime pointer just before it.
On the Arduino UNO Q this crashes in two ways: when alsactl restores
the compander switches at boot,
Unable to handle kernel write to read-only memory at virtual address ffff0000c7e3a0e0
pc : pm4125_connect_port.isra.0+0x2c/0x78 [snd_soc_pm4125]
lr : pm4125_set_compander+0x84/0xa0 [snd_soc_pm4125]
and on the next hw_free after a compander switch changed the stream
pointer:
Unable to handle kernel paging request at virtual address ffffffffffffffe0
pc : sdw_slave_port_free+0x48/0x110 [soundwire_bus]
lr : sdw_stream_remove_slave+0x3c/0x74 [soundwire_bus]
Call trace:
sdw_slave_port_free+0x48/0x110 [soundwire_bus] (P)
sdw_stream_remove_slave+0x3c/0x74 [soundwire_bus]
pm4125_codec_free+0x2c/0x40 [snd_soc_pm4125]
snd_soc_dai_hw_free+0x54/0x68 [snd_soc_core]
The driver already defines PM4125_COMP_PORT. Add the two compander
channels on it to the RX table, as wcd937x does.
Fixes: 8ad529484937 ("ASoC: codecs: add new pm4125 audio codec driver")
Cc: stable@vger.kernel.org
Signed-off-by: Riccardo Mereu <r.mereu@arduino.cc>
---
sound/soc/codecs/pm4125-sdw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/codecs/pm4125-sdw.c b/sound/soc/codecs/pm4125-sdw.c
index c279bf0a88b1..06d51b185e6a 100644
--- a/sound/soc/codecs/pm4125-sdw.c
+++ b/sound/soc/codecs/pm4125-sdw.c
@@ -23,6 +23,8 @@
static struct wcd_sdw_ch_info pm4125_sdw_rx_ch_info[] = {
WCD_SDW_CH(PM4125_HPH_L, PM4125_HPH_PORT, BIT(0)),
WCD_SDW_CH(PM4125_HPH_R, PM4125_HPH_PORT, BIT(1)),
+ WCD_SDW_CH(PM4125_COMP_L, PM4125_COMP_PORT, BIT(0)),
+ WCD_SDW_CH(PM4125_COMP_R, PM4125_COMP_PORT, BIT(1)),
};
static struct wcd_sdw_ch_info pm4125_sdw_tx_ch_info[] = {
--
2.56.1
--
Privacy and Confidentiality Notice: This email and all attachments are
confidential and for the designated recipient(s) only. They may also be
privileged. If you are not the intended recipient or among the intended
recipients, you may not use, read, retransmit, disseminate, store/copy the
information in any medium or take any action in reliance upon it. Please
notify the sender that you have received it in error and immediately delete
the entire communication, including any attachments.
next prev parent reply other threads:[~2026-12-01 13:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 13:12 [PATCH 0/6] arm64: qcom: Arduino UNO Q: DisplayPort audio playback Riccardo Mereu
2026-12-01 13:12 ` [PATCH 1/6] ASoC: qcom: common: setup fe dais before be dais Riccardo Mereu
2026-12-01 13:12 ` Riccardo Mereu [this message]
2026-12-01 13:12 ` [PATCH 3/6] ASoC: qcom: sm8250: support 32-bit MI2S slots Riccardo Mereu
2026-12-01 13:12 ` [PATCH 4/6] dt-bindings: display: bridge: analogix,anx7625: add #sound-dai-cells Riccardo Mereu
2026-12-01 13:12 ` [PATCH 5/6] drm/bridge: anx7625: accept 32-bit I2S sample width Riccardo Mereu
2026-12-01 13:12 ` [PATCH 6/6] arm64: dts: qcom: qrb2210-arduino-imola: add DP audio playback Riccardo Mereu
2026-12-01 14:29 ` Konrad Dybcio
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=20261201131212.161224-3-r.mereu.kernel@arduino.cc \
--to=r.mereu.kernel@arduino.cc \
--cc=alexey.klimov@linaro.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.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=perex@perex.cz \
--cc=r.mereu@arduino.cc \
--cc=srini@kernel.org \
--cc=srinivas.kandagatla@oss.qualcomm.com \
--cc=stable@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®