From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.49 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796130747; b=EQYBlA942b64ZRkqU6blcmTqQUYKKTcGvYWepaQNCl9lNNNUbuJK82TyEF5pyfgh5NA4 dPOpo2KxUbXFD7p51WRvpiaPMOGHi4qobo2LgfF+ndOimJ72B11XdxZ9Exxm5hzVzxMac XRYbIchhumJivhh5m62dgtOOLGGrRlRDdRGtsZHVeXtUabrK/qhcRtYYBdKrDrHpQme/M dVu2oCAvyEhS/GnGcVJ06EPydc0feihKLGw1QvlGZSjqJZqPbQGwkxbnxZHIBpOUT2Fja 2ltXd7kPkRuY2QN68wvMP43s/q6Cr+lj62m1cRoCEKY/Kd2pZY1CMqGy68i2PA38kvw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796130747; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Type; bh=wFj7iFgLgK8CU3FL3KyUWwJV+ezD4EmS1gZ8IxRYRs0=; b=lJblr0H8afiqAPywqE+3zrzPUMhi67bNvySZD4GPNupwQcv79VSmtcGYng4O1TiYySci N+q+Qc08Q3HCIyENaAlkMs0ArU4KcssPDLq1Ltkxu56M2C0aNLw55O5UrH8NPJ8OFv5qH rkN31EoeLfyr/5vj034XWCUI9KAwbEMWkN/eGbHfB2YjBPuWccZ4EH0BvSoCV9+v0UDNv uKWgmR7OrP89veUfx+5QKBoxGjRPO7zaYmK2TFG7BGm6HHL4AtE35u9zZHRRw12BaT7/S NeLRGaL9/1PXawFC/glsfe/GkHjTqPeWQWPwyqUHhUcJtOSMGJ39YxugEpCiwz90TYg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arduino.cc; spf=pass smtp.mailfrom=arduino.cc; dkim=pass header.d=arduino.cc header.i=@arduino.cc header.a=rsa-sha256 header.s=google header.b=FqoPgt0Z; arc=none smtp.remote-ip=209.85.221.49 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09ACE606A33A for ; Tue, 1 Dec 2026 13:12:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 09ACE606A33A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=arduino.cc Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arduino.cc Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arduino.cc header.i=@arduino.cc header.a=rsa-sha256 header.s=google header.b=FqoPgt0Z Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-48dfc0421d9so10563230f8f.1 for ; Tue, 01 Dec 2026 05:12:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arduino.cc; s=google; t=1796130745; x=1796735545; darn=vger.kernel.org; h=content-type:mime-version:references:in-reply-to:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wFj7iFgLgK8CU3FL3KyUWwJV+ezD4EmS1gZ8IxRYRs0=; b=FqoPgt0ZTcDKXp3UMNmApu9O9Sv26NCUCOTBGTkO4eNqGds/7jU37vPp858Nxl0OoB mCs682dzhpu1zkJs6uwRFOVAkHBs/Po/5X80L0WzNB+sx3DVYEjo7fR23I8SyiVr4e5P ppfjZuOlH3XZTK8QaUM1o9v/u9GB+6lcijmQA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796130745; x=1796735545; h=content-type:mime-version:references:in-reply-to:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=wFj7iFgLgK8CU3FL3KyUWwJV+ezD4EmS1gZ8IxRYRs0=; b=mV3fgCM/YgIs1bsdps/YIBH/4DDr98bc/ojRC6ix2crtBfwVOVcQkL6osdmnbnpHo/ wzDWPovAHDZme0p2mZg93LGoF/o4J8tyizLKYDFDI7um63b7mi2+iyhtT/ErMAGZ32F9 OB0qYJxrI7Y9+7qj40soiwlYedzCicfnklEFGTYbSfVTlZQQ7LANC7MzLcPHuF1BDV1E 6VGYc+LkL1caEFEjNj2ZTTsdQIeMLbFWc4/YhInUQSRnMc9+Dl5U7vYTs7InbnB8DdH6 rJ32msDHaDJhTJAamvZBLkuWMnipZ6LIfCCHFvM4xZIYip5Ym0zhf5X5rIWEwPZFsYWv qP/w== X-Forwarded-Encrypted: i=1; AL+hErG09YLj5n/slSmRqqgEVCW7IiREtb9DcRK6Y5BcxMMZDBTQPgneMVplCLQi6BY3NCEsZbdJaQ0l8GnFh08=@vger.kernel.org X-Gm-Message-State: APuU4Z83QTAIp2WoYkk7EKeSGS3HJ5xAJY+YpdBpVhjNvHkrTzE87JJD 3GptUlG0d5Zkk+UghYfighWoHwSugMTK91wrEPF1u70yyh7YG7T498ak4Y3DQU8onNU+OZsycsT 5jgmWo4aP+yt+cmiZFYGfDLK9/NkSAj9+AI7qtc8s3cT496jrBS8e1C8SWD0= X-Gm-Gg: AZFdTZe4fHIMj/ulJUM0sZerKTDBvxgkNQWKusruWSrc/kMjmLNyzfEsJyRXJpgJ3hx OFLWpYxrR/05Kr0WcDo9vFZZGycJygNjrpjLa3zaIM94G+XnYOFBE8z7x+tx5L4xEhmCqh/qhnI wzlXv+ZvcIHX4OZxivjZuYuwRnU/y6zN0OljayHV3jNd6GP6H//hGuXqiEbrvj6EyG4UJkq2Z9f KHpdxOPNC/9bkJx2fDV6/+Tl1quPBtfkJmHtCCJMS8X4foCQkOX/w8DIplgNwtF4jbLyV/d4pH7 pLHcurDJjEF7+cDVexDCo0NIal+dsw1Et/wOInY+c75FygJ2kCNxtnc16/paJHHQ9ZaUdTWe0yj 3gaVfo6HChvswt7TlW4IpqRruwUxU9A8PYRbxA+RzEQmH/sBKRqm+IqZD1rOq83YUBAwJqjdpSu nvJiGNogB2S/KH49786ilH1QUe0xC4nUd4HH2cwZoQ4dvEXR0mrWpTU1LNbnhP3jnMvXyo+UZtN z92Ey1MKnLuc0rtcn9AIJRQiohhiXS2ugOzZPzWWmB0WfOUe0PjqVtivNL09mSD1FYiv/CSdpOV xXdAlLiN408Er+KEthjBTvppxZDtJztSm17/cStTUqBZhlszpC3YuDa5WjPTZw== X-Received: by 2002:adf:e014:0:10b0:4a6:b87:d799 with SMTP id ffacd0b85a97d-4abb400bb42mr53075997f8f.17.1796130745367; Tue, 01 Dec 2026 05:12:25 -0800 (PST) Received: from riccardo-work (public.toolboxoffice.it. [213.215.163.27]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6c61e53asm77939587f8f.59.2026.12.01.05.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 05:12:25 -0800 (PST) From: Riccardo Mereu To: Srinivas Kandagatla , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Alexey Klimov 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 , stable@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 2/6] ASoC: codecs: pm4125: add compander channels to the RX channel table Date: Tue, 1 Dec 2026 14:12:05 +0100 Message-ID: <20261201131212.161224-3-r.mereu.kernel@arduino.cc> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261201131212.161224-1-r.mereu.kernel@arduino.cc> References: <20261201131212.161224-1-r.mereu.kernel@arduino.cc> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" From: Riccardo Mereu 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 --- 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.