From nobody Sun Feb 8 19:24:41 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8BF943CED4 for ; Thu, 5 Feb 2026 17:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311659; cv=none; b=c79h8X0p0SnRBaIo3Gd5I9tIWS0YmxTS0W2WSUAWV/i279BxbWA9Xu70Vrckza9i90XbNrqk0Hgv1txjvLMWPf+dGRQUGVyFvDyiNu+HDjHC8a+YTmGF+DQWx79p1hjejhpujGP+Irf2MUuU71ziEs+cto51m/01wfewegZgRhU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311659; c=relaxed/simple; bh=hpmfNzSCIC5ApGBDTE0elE5AkmLDZ9OmsstHpD/oKEk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uDd3Ba3asBpyxconZitdhm5WSyTcJW7BGJuLA67kHZSgKc83bnxb2qeO/YHXqwZQVg5YiUeW8KIP3oy+RdiJ0pvY45jFDD+MBAXyrMrcFmx0kqttebZULnqPz4If9urQ3j1DSuk79HXEVqDcalBj9BIRIxTxrgO1zeDgEhSF1eM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=FnAFNpA7; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Y6uINJCv; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="FnAFNpA7"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Y6uINJCv" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 615AjhCr2157615 for ; Thu, 5 Feb 2026 17:14:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=K6uxAlpDaZ6 EBOUxGU3VxAdAbWdRRiS7if5bxpU1zcw=; b=FnAFNpA7+DcHitGvUXjDDHYr6NA aF9O7SilomV2gGQE7liag2QkVCRDQv++knj0DWjAdS0uNKDlLHt+qsdb4NiSR4WS nDZZRtVlBHvTeg/ri4gFz3W9JKqwXF8UJrZ59PJ+ovlnSL/OR+locMQ+qLwhm+lm Yu3voBdLWpAxQK+MvoYIETH9fAezKLrPkwatdWeFomzYIqAr95GxyvDrzD2Z8BsQ EvXDsJaVDcC38dLwemuU0aHmtCejwxJVEDp90tpcaX5W6MLDMxjYNpwodRlC/04W oJrQB9dgzWMs+EeO4d/nIbKXXHBNXSw/Gz1XcNUu7NpHgl9/7AWuB2gQl2A== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4gynttra-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 17:14:17 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8c6cfd52556so380980085a.0 for ; Thu, 05 Feb 2026 09:14:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770311657; x=1770916457; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K6uxAlpDaZ6EBOUxGU3VxAdAbWdRRiS7if5bxpU1zcw=; b=Y6uINJCvEvTft0AI0ovJr0uRGmK8rh1NuAKI6hHfCmRhB2YodN7qzrIvm53N9UrrDP n2XTWU5K+ZI902LlI1l1TdEq92EqLlx1x13jsxDu3jFhOoEI/zJs11ECA8TALGV0nwWq zEFTgXItP5IXzyodbqRUt7hiQE3ZxZmmDc7oBS0cZaWSrmKM3qSPEELf6R/NjDXBCezG GuZXbOUUsUom0ZZrxagcOF5/mP4je0ATsDKcRRiZc6jzDLWn4Jua1klMmuRGwheHBPxp 6AwENNRsPmQUAoULQh90npkgFSahNEvWuk+rtrMFkmoYX3gacXur+88fY74Srs9rcGjz DmNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770311657; x=1770916457; h=content-transfer-encoding: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; bh=K6uxAlpDaZ6EBOUxGU3VxAdAbWdRRiS7if5bxpU1zcw=; b=cjpa1E+fRGPBgO+43Ei0XpH0DafcroBGC7GV35wNTib68sBpAXFmLdeyDyDMrLypXf CCahGNgwimVInDZcY+jhgfwlPNoO396mo3Q3qkTKU58DZH1dHSBoF0s20+XcC6MvpAo+ rDw9gYSXBlYbY/KDD1MUsjRajpLGipLMw0IBVeoOc7+oJojC0eYw1gRQhzMZfjpWRBqr XP980ySnPw/wVIZ9wvY6W9fA9yLkb3jEt3kQ4a7fjnz642JbWPnKfI1LN6uclWGj5jK9 awMvgwNiLEhMYHa6/n6BDdG1QVOWdQFst6v2Z8T1E+QlmN6VfHTplz9rZMFvBj1LKpgU wBgA== X-Forwarded-Encrypted: i=1; AJvYcCUE2Lz5Pq9LhWFeKSdEoL13kFjY1WPs5CmOKGGkjUog97wDFVZJKp5vR2apsXsVw1cUj5+1MLyCKNBHZvo=@vger.kernel.org X-Gm-Message-State: AOJu0YxhEJGJzbyPiuhpU+ZAzTO7mHXPR0cHCUx4nE1LNcVPRBjP71bk 7U+KPa/oxqt7hYSH6Ev75AsPf4mwWKRYDWtDbOwi+H1/VGYj9ohgKVJlFZxJHgVVQg+BlNOq9SC ApaQFjnF+oJVWtYUOjaKceLG1Q0Gumd5RrKDaT56xs/0X+/JRftcc5PPKpuRxp4E15P8= X-Gm-Gg: AZuq6aImnzEZgBlPRbcuxeko6xEZ0JhXxtyxf1vAfvJkdPB7dnvdrXGW9dwrcFlr4py WKEKM3uW4ZOWC1FTybL8O8Pe/DGB4Gn56u02HzJDbp0oEAVkFanGzIxJuV2uMObiKMtboQK4Uqd ZnbzqxFb2XU2vLnNasSHsgy3QZhr5yUg2iW6MrF29cgw+Nu34EfAVJokZdjVsOIY9RjI5BeI3aj /kGgUi7E7//JNqIWB8TqPqe42rB3ev6RyTYCJhLraHSjaG6vFgJXus5+TOFphIA+XC77m2hyo6c 9Kg9/12CMxT1a0URGZY8pzpUMIQXN8u27KEiARdY/TMh8asTvgjLw51BlERIEro5Z4Hvsautl34 j3xoqDR31dqIxJlVSepn8bsQiKg5XnFTwq9Vv8Hd3JFk= X-Received: by 2002:a05:620a:440a:b0:8c6:b16c:a56 with SMTP id af79cd13be357-8ca40c5c033mr475106585a.38.1770311656772; Thu, 05 Feb 2026 09:14:16 -0800 (PST) X-Received: by 2002:a05:620a:440a:b0:8c6:b16c:a56 with SMTP id af79cd13be357-8ca40c5c033mr475100885a.38.1770311656230; Thu, 05 Feb 2026 09:14:16 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm14802849f8f.21.2026.02.05.09.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 09:14:15 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, cnor+dt@kernel.org, srini@kernel.org, perex@perex.cz, tiwai@suse.com, alexey.klimov@linaro.org, mohammad.rafi.shaik@oss.qualcomm.com, quic_wcheng@quicinc.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla , Stable@vger.kernel.org Subject: [PATCH 01/10] ASoC: qcom: q6apm: fix array out of bounds on lpass ports Date: Thu, 5 Feb 2026 12:14:02 -0500 Message-ID: <20260205171411.34908-2-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDEzMCBTYWx0ZWRfXzbsnCeZyQPum IfLfhYtdI0einr1KBF7PAfp+K2Il2bZm+2VOQbZaZUMYD7HUNvFkUAhzvzcegUiAEtBNEWLOXeL 9f/qvtraY6hNg4e3GmTSTiuzJmitl4o2pb01+w2/XFHigb00rF1vWHc+PAnck+1i3SmDnfXHlFU tvR6Px2r6hON6jWQ7RyPGeeooId8llkrAEbMzyz7hF8fZewAeAZkSus8Z/8kSKghX0GP9zsnEMZ NQYhie4ja1QmGfQtvRyZPZauOfO+Mq0fAjFViP+KOyMu2h1L/7w9nHrp9Qx1pe8hl+h/lYF7IGq vo73no6fCt6r2acGCIynUJ5ZUpXJ7i6m39OV3El1ERhCO/97SQd/SVLLiUMtA382LCNUL14Uxt0 3eHVKiD51vHpZ0sIoFr+yKt0F5T6NG8QirsZpos2CdfoBqyMwEEO/rte9O1yoO7UJbJtt9WywBq lapBVe/RHmGu+Fzfxyw== X-Authority-Analysis: v=2.4 cv=GdcaXAXL c=1 sm=1 tr=0 ts=6984cfe9 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=MyalSr31lt99Fa30PzAA:9 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-ORIG-GUID: uxIuyHCaIK3LXGhP2k7gE3XlT1-AIQOu X-Proofpoint-GUID: uxIuyHCaIK3LXGhP2k7gE3XlT1-AIQOu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_04,2026-02-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 bulkscore=0 phishscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050130 Content-Type: text/plain; charset="utf-8" lpass ports numbers have been added but the apm driver never got updated with new max port value that it uses to store dai specific data. This will result in array out of bounds and weird driver behaviour. Fix this by adding a new LPASS_MAX_PORT which is can be used by driver instead of using number and any new port additional can only be done in one place, which should avoid these type of mistakes in future. Also update the driver to use this LPASS_MAX_PORT. Fixes: 55b5fb369c02 ("ASoC: dt-bindings: qcom,q6dsp-lpass-ports: Add USB_RX= port") Cc: Stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla --- include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h | 1 + sound/soc/qcom/lpass.h | 2 +- sound/soc/qcom/qdsp6/q6afe.h | 3 ++- sound/soc/qcom/qdsp6/q6apm.h | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h b/include/d= t-bindings/sound/qcom,q6dsp-lpass-ports.h index 6d1ce7f5da51..609bc278f726 100644 --- a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h +++ b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h @@ -140,6 +140,7 @@ #define DISPLAY_PORT_RX_6 134 #define DISPLAY_PORT_RX_7 135 #define USB_RX 136 +#define LPASS_MAX_PORT (USB_RX + 1) =20 #define LPASS_CLK_ID_PRI_MI2S_IBIT 1 #define LPASS_CLK_ID_PRI_MI2S_EBIT 2 diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h index de3ec6f594c1..99b0b6651fad 100644 --- a/sound/soc/qcom/lpass.h +++ b/sound/soc/qcom/lpass.h @@ -17,7 +17,7 @@ #include "lpass-hdmi.h" =20 #define LPASS_AHBIX_CLOCK_FREQUENCY 131072000 -#define LPASS_MAX_PORTS (DISPLAY_PORT_RX_7 + 1) +#define LPASS_MAX_PORTS (LPASS_MAX_PORT) #define LPASS_MAX_MI2S_PORTS (8) #define LPASS_MAX_DMA_CHANNELS (8) #define LPASS_MAX_HDMI_DMA_CHANNELS (4) diff --git a/sound/soc/qcom/qdsp6/q6afe.h b/sound/soc/qcom/qdsp6/q6afe.h index a29abe4ce436..ce4b04da1730 100644 --- a/sound/soc/qcom/qdsp6/q6afe.h +++ b/sound/soc/qcom/qdsp6/q6afe.h @@ -2,8 +2,9 @@ =20 #ifndef __Q6AFE_H__ #define __Q6AFE_H__ +#include =20 -#define AFE_PORT_MAX 137 +#define AFE_PORT_MAX LPASS_MAX_PORT =20 #define MSM_AFE_PORT_TYPE_RX 0 #define MSM_AFE_PORT_TYPE_TX 1 diff --git a/sound/soc/qcom/qdsp6/q6apm.h b/sound/soc/qcom/qdsp6/q6apm.h index 7ce08b401e31..189ed8a1a60d 100644 --- a/sound/soc/qcom/qdsp6/q6apm.h +++ b/sound/soc/qcom/qdsp6/q6apm.h @@ -16,7 +16,7 @@ #include #include "audioreach.h" =20 -#define APM_PORT_MAX 127 +#define APM_PORT_MAX LPASS_MAX_PORT #define APM_PORT_MAX_AUDIO_CHAN_CNT 8 #define PCM_CHANNEL_NULL 0 #define PCM_CHANNEL_FL 1 /* Front left channel. */ --=20 2.47.3 From nobody Sun Feb 8 19:24:41 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C691143CEC3 for ; Thu, 5 Feb 2026 17:14:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311660; cv=none; b=l8BXktRsqv/I/byV3BAyB9W+g0qotQ3eLJGtTgrnHLlGkXK67H+IjvU8YUezEI4kUODYVsgNaE0SUJxHTvmNbZ9lgaLNKXJUjMUMFEw5Q4cQG743Ue2Met/1Z+44rkwJ3tld9SSZEiwoSiQRmp4QO5wQv1EJkoBxFzsWMNKNP2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311660; c=relaxed/simple; bh=MELEMTjec5vaBpCEJT88+rEEETlPjpeLlEwa5LTMeTE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cq63vfMNr6dbK3Ctj6jPwYN1tU83eH03qEP19uEoMdv7xd506V+rT3faBU0kjxkkLRawW3tKOlAHbJ4PYXHn493gvjR2vMIapslajbaSX2IBuEO2tufoWIgKDdD+PWdyALIix4lbbSyywmel68j4FpDvFiTxybXswiFrlkouFPM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=GgfHFTl7; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=HolfHozf; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="GgfHFTl7"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="HolfHozf" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 615EOEuv4126192 for ; Thu, 5 Feb 2026 17:14:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=yYDv/MOnY4V DCdh1TrAl/JagxkvVShJkBH2OQjhFFyA=; b=GgfHFTl7zi5gWc1C0A55QfPlP6w SupVD9o1H7ev0947LZHADmeqINMslo0cGdmTAnKCYfdXVcPAw+S3PC0yqyYG6bqJ ZUtMCCvlEqV7TZphlOkgBw4E3NTSAjNTQQl2d7wIN3140/IkqK25Pri36f81mvnV HUM/a+uVLZUuzLJ062oHZMAlGhvbKOwsegARMOxWeZyowcwJROPJ2hKZnHwZWhXx VvtCv94DQUkp7OsD2C64bLHVASYA/DA4y3/sBpV+3PyBzVOfJFmY+ChAlfWYP7co c0smO6J285PJcDdeDkG6u247SL7F0RBCIpTTttceTlrKkGsQ92g0dJaaSlA== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4vxhrk0t-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 17:14:18 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c6a5bc8c43so377189885a.2 for ; Thu, 05 Feb 2026 09:14:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770311658; x=1770916458; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yYDv/MOnY4VDCdh1TrAl/JagxkvVShJkBH2OQjhFFyA=; b=HolfHozfr+CdIoc1luGmwv+SLkltIJ6e23b0PaRTw9gRCc6Igpjn7PfXrdLeGpt6RW ICTo/uKu9fMGErYCeuzWUVuk8QnOxonqyRU86b13CGK5UxnWG7K376eYZYBgJt6oZBjI NDsO3tDEkqG2PtQJ3ps1wH0HeKQzYqjDIDiaPG3lXrxBQQ24ZFxzCiTx+FxxQer+VI/p H8bebAo9BfvWIaFRbJmNxjBq61qT63g03GTdvPyXf4phmsxw0pzgPwHgwV4Hk1FU2g4u nBcCuy4AHcQGt88CiHBx5QOvPdZy6LOUlkfnKg1dAheAeISTuLDtEQsc5IDb/bTn6PY+ 9oAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770311658; x=1770916458; h=content-transfer-encoding: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; bh=yYDv/MOnY4VDCdh1TrAl/JagxkvVShJkBH2OQjhFFyA=; b=RbMVuH3SFaoehMn/JkuU2vX6qh1pETlcvNM3QPCDU9GjZLAZPt3lq9bzLw/+6HyiHt fafhNWfLMbMNLsu3pQTjnwDsZLCdnitJOUNVV1HLSfFH0KrLkSncyU5w4U9fDgc9CFBZ bc04dt5uuOxUwoZzereOtkV6sMCeKoqW1NYTxFTVsvMwn6LwCB6/ST/27M4pE4bhZs/B s/EqpBduhIFqxDBeTeE6LhfaVmYRp+8s8K8xkR22mhosW/76CCIJ2vVjIHHY6sOB0MqW ESY5kRwRwxNZ56tvdVip3pZkqbimGTNziOBnaKK0LgVkurGCD7M3mrUSt9POOcWz7nIV Yrbg== X-Forwarded-Encrypted: i=1; AJvYcCVeuR6NT9N/MzvMvjqBDHPgAZN8xcWKmMtMf/v4LX/iwAuTKDvBkZ88/5uCKc9KaJSNdd4XlYbi4GB4u9w=@vger.kernel.org X-Gm-Message-State: AOJu0Ywmpa6ngN1RX7bpguxT6VmRn5jczR4DRNjgf95U2z5BWqOWxD69 VEATiZ39lNBV8C+2oMC/blemHLIhCH7yXv7l1YAzxeqYwxTCSxEKwP1Q52GRqSF5kpMAJLsfWBK pdwzvxxzogl8vZG9ZgsRi+FT1CXswq70dYLrZcWBOoULsQ0HBCixOVuX9E89uoVfkkqU= X-Gm-Gg: AZuq6aK6HkEQDxkg0PyhpGgSX0BWu/nw4U6cS8XwEqrEBhJ3Hj3etiWV1aQORt+CUpJ jnE2DDRjCveiu+INuOnkwf8dB1Rxwjm/KJr6kPyP32iP8dBRjWSVlXRXQxdcgFRZpmdGs6lT2JU 5JFzkj1hJuPcH+ukjGodHz0H9MIXyFHdCAQRrOPNPLGYgUzTpI1AhGh70DdLgR4LMhS6h+3F3Vy UNV+JPm+HwaE0xnMQnMGze03YFKuWXzQZ+IBbIaV6HfOVFNK9Dc0/u6bKWmXREhV3YHlJmjrpVb 1lCrSsFgtuT+Iyw3CuoDw4gPMrxEyoLdTLPlKV5Y+d9qSpbNgFxIHNQp0OIV+rcJ642xMGNBzaa yVWKc1GrEoJGCKZs3d5yPJvHdbMZB5OLNFU9qNpGDUh0= X-Received: by 2002:a05:620a:2550:b0:8c9:fa97:75ae with SMTP id af79cd13be357-8ca2f9fdd07mr921337885a.75.1770311658084; Thu, 05 Feb 2026 09:14:18 -0800 (PST) X-Received: by 2002:a05:620a:2550:b0:8c9:fa97:75ae with SMTP id af79cd13be357-8ca2f9fdd07mr921332285a.75.1770311657542; Thu, 05 Feb 2026 09:14:17 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm14802849f8f.21.2026.02.05.09.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 09:14:17 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, cnor+dt@kernel.org, srini@kernel.org, perex@perex.cz, tiwai@suse.com, alexey.klimov@linaro.org, mohammad.rafi.shaik@oss.qualcomm.com, quic_wcheng@quicinc.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla , Stable@vger.kernel.org Subject: [PATCH 02/10] ASoC: qcom: q6apm-lpass-dai: Fix multiple graph opens Date: Thu, 5 Feb 2026 12:14:03 -0500 Message-ID: <20260205171411.34908-3-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=GLoF0+NK c=1 sm=1 tr=0 ts=6984cfea cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=G9hKNilMzbK2xivVM74A:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-GUID: SOrBv0dlZfVMCHze1eHeEEYqwNNMczZm X-Proofpoint-ORIG-GUID: SOrBv0dlZfVMCHze1eHeEEYqwNNMczZm X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDEzMCBTYWx0ZWRfX9gQSkBlKOY+O Og2fDE8o+z0inniM8z8GVWV0qddnECDMt/yFV7IBCO5aAYo+3/2Kd4FbnZs6r9YqWZRnLu27vAb XTh6PyfgkD/1bwQGnPs/LSfDtpiYPglr5MslWXGL2pdxrBYgZj1Rf46STPIIJ7QCu4py2XO8iO1 UI/cvEI+EboqaqZpK4VHCHY78O5FuiA3oGEMSUpvGaH5+sNvdvOvv+s07CdV1GyApxufnV8mqw7 Tsqt5/4M9fubnWEY7eP6ioZFeLpON5mlk1i8HeGuo+qUKa0XnhLp0kKlSj74ex3U1T5Mc5wRSGZ oCEAEsRxaHlf/lywl+3EXmADjszgVf0ACT+Tuh+WceCoJ9qMsF5RXJ7/mbE2SqNhu7B5NSKjNjd I7LGZ3qoE91S56k19kmzit/oOmXx3S4ZX5zvf0QGfWNIVJFLn2GqMC8lTayYg/WeXRspJcG7no1 EIEaaCzPKdMqIHJMRYw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_04,2026-02-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 malwarescore=0 clxscore=1015 impostorscore=0 adultscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050130 Content-Type: text/plain; charset="utf-8" As prepare can be called mulitple times, this can result in multiple graph opens for playback path, fix this by checking if there is already a graph instance. This will result in a memory leaks, fix this by adding a check before opening. Fixes: be1fae62cf25 ("ASoC: q6apm-lpass-dai: close graph on prepare errors") Cc: Stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6= /q6apm-lpass-dais.c index 528756f1332b..f68d4b4974f3 100644 --- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c @@ -181,7 +181,7 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_subst= ream *substream, struct s * It is recommend to load DSP with source graph first and then sink * graph, so sequence for playback and capture will be different */ - if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK) { + if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK && dai_data->graph= [dai->id] =3D=3D NULL) { graph =3D q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id); if (IS_ERR(graph)) { dev_err(dai->dev, "Failed to open graph (%d)\n", graph_id); --=20 2.47.3 From nobody Sun Feb 8 19:24:41 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DD9043C078 for ; Thu, 5 Feb 2026 17:14:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311661; cv=none; b=PzGfLKDMJc6YV3zTXURTp2S4guMV6x9h61HGNhZPn8kliOVlpVACL7PkrVatIEIvSnXWvtv53G6q5cPPCBodYojR7f/HJpyeZMEPso2kjRTd9XtdvJftVuW/3Em/pcHr4vW04rLkjcAPqSLvaWc+s2gORocuyD3tMpHO0/IJ1cM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311661; c=relaxed/simple; bh=XaUu0VWsXIOKq9aElMOeuD+T1g8fF6us2kR3AzJirng=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a5tYxyfyq9aIZ5NbEaVegPveIL86iYevL+CuTleFK+SaYJnF6Gvjq1xInvZ3WU9EHkT/IWwI7HYaXqKwdb7T9oQr0elzvY7UO/jw/fCdYHh5UO7QZ7cOXtFPV52H/gAA77Bl1zYzJlz3+9bi/WpKcp9db+XeZKozQIKAT1dKvnI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=jtTyeQhk; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Q4fseVDl; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="jtTyeQhk"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Q4fseVDl" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 615ClmQd4166730 for ; Thu, 5 Feb 2026 17:14:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=ZoB2N4YhuCT U3IhDeytsYqmgYo6gsKL6Ikjrrs1blzw=; b=jtTyeQhkMU0n33LtUdb/sfVLWLC x9dhbYT9AefdJAD6dbEWxYEKT9zObdeGkGFOfdMoDj8/oJOwnzq99QVoU3U0Ujhn B2zwNI5o+jiPT0LjxrTuBNrD9aOQvks8z31Mg/MlFZjGwlA2ah794ADQGMguoWpi /LJC1WLotDpVeMTV1WAYv3KXtjLVVLnYHLj7YRH45fqVIbbebfqLh3qJ8DLguBqj AuWw3A0lnmE84c/Db10PkzJlqJkh3K+h0N0UQTLrQN0VyAXFHjkYMh9XhlgQj0PT ooH/Wv9dmtv1MErRxcUnbPWvQlMdaeh3QEM7XMdsNsGRWodEUva7ExDPZyg== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4nega452-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 17:14:20 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-8c5296c7e57so498007685a.1 for ; Thu, 05 Feb 2026 09:14:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770311659; x=1770916459; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZoB2N4YhuCTU3IhDeytsYqmgYo6gsKL6Ikjrrs1blzw=; b=Q4fseVDlDkyLG1yRzXcHBaLVBSWsl5Qqoo11heCQFC8oq+N3ALqbD2MU/86swVFnJ3 9hTXhzvO9mjLl8jy40KLf+6K5bRdeofOEGpnChBfdEmbMTq9s7NJSIKgj97VLVOp76Z6 ZrbLQnRuN/GSFJZj7/00aNQuj3nbk3diijfxlKT6zUHZcheZ9hsr6RnPZ3yfcVvbQ9Am +eUBeqL45wJhrEhtIrSHuGavxapYpZjaT8Wl3SWOHPfc9IGnP2UJolh08kbnYCJHjRHs 38QiPgnjIOe5tbjTQXGjSgF1NRHakU3YddRre5gBm88jlWUXjWK2LuNk5X8rDQsa+xX/ VSMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770311659; x=1770916459; h=content-transfer-encoding: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; bh=ZoB2N4YhuCTU3IhDeytsYqmgYo6gsKL6Ikjrrs1blzw=; b=nGT3aDBNhCTXxv1Qc2Q4nxYiDMgMGV2ndIQ40q0hRCpBJTzxN9FTYX6uDUdTYDoL1R Lde6y1XWw5cFJqJAOJ2WmtCrBf3+phXzLIC/IPrGQm03xLzd0z6vZAZBpunBcIdiELEa DzRMrPdNeR3uJVCy+EZ1JjYg23XP33WPaD5tfhDctPYAkH5LCFeSMbXOahJ7LxVXai/L GIv0X76JtwqT1tK+M9or5HaOtNfqJRFFnhCnj/TJOkFKG6ncN6k2JMPIs3Sig3mIyLqz RzkrH3NFOUFc0b5JbI2frIOgYOAfBMkoVQOyBc8XzrSCxx3FoxjKK1SC3Fp7qAWsNa41 S71Q== X-Forwarded-Encrypted: i=1; AJvYcCV8XSzW6ZRGr1oGe8FKiyurOYqWAscrC3PdWF8kzJgszeqYIB7T67GGJHLHMZW9jvU8DYKfZP+3r9B3jFM=@vger.kernel.org X-Gm-Message-State: AOJu0Yy9gsgXaV0wqs79QsB7KGX6zASUzi+C0/hFadtic45Nd2YW0qQZ MzfLpfYV9AohC3MRrcMBz8XnJx8knUquf7z/2nF09/Y1a6vxaMwB11+VVr/xGCOegFG6FYF052t nTFdsjrhe1FbFODUKxB6yzxK0vvX+oYs7x9KfaE2doLy8u4EyeHMwkeQTlO9SnE3aSQw= X-Gm-Gg: AZuq6aKufvJ2q5A3lV2QvZp9TxkpmsNtAoM2FlYWKQxR+WM0K+UtHv4/Atx+VNYLoQI 22a1RsiS7DF9d2uBhqTgBPo3LjDQqsYKNSPa/z5z3pUZGBmHxuHQpJV/bAnVcxgGYL0vltDrAmQ n4dba2uBy5vP7wJuXVR1tT4etfUy+U7EmvucOzOtR2wCokCz6NNS1DQUzXgG7rmM9RF6jvRjV4s 4hJC5rSamSk4qQRRrDGTfJ1CPzEYhuPW0q0JmBfy4jPv5G5u5F8b8DjBsCROkl0TW643JmgEB+h LH2TjuAGuC/ki9vvdZL32wW7Vc5YBLODzJVj3nCuOw+fEMZAIyeYYAQc72C+tFa6CkP4Gs5+YxG ztNvfOQagm+IdpXkX2AxNSzNZ8DS1fMJStIRBSLjnumw= X-Received: by 2002:a05:620a:2681:b0:8c9:eac6:4168 with SMTP id af79cd13be357-8ca2f80e2f2mr795714285a.9.1770311659534; Thu, 05 Feb 2026 09:14:19 -0800 (PST) X-Received: by 2002:a05:620a:2681:b0:8c9:eac6:4168 with SMTP id af79cd13be357-8ca2f80e2f2mr795709685a.9.1770311659078; Thu, 05 Feb 2026 09:14:19 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm14802849f8f.21.2026.02.05.09.14.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 09:14:18 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, cnor+dt@kernel.org, srini@kernel.org, perex@perex.cz, tiwai@suse.com, alexey.klimov@linaro.org, mohammad.rafi.shaik@oss.qualcomm.com, quic_wcheng@quicinc.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla , Stable@vger.kernel.org Subject: [PATCH 03/10] ASoC: qcom: q6apm-dai: reset queue ptr on trigger stop Date: Thu, 5 Feb 2026 12:14:04 -0500 Message-ID: <20260205171411.34908-4-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDEzMCBTYWx0ZWRfXxRITc1tb3JjT LgUPDwVlhT/z8A9Oz1iCC7lo5nhjOUNrPinogy4JV+yDKh68+0G/wosjc3AzXIHSpt7f9/HsKyX JJmy7rUAs1Lnh5tuWTj1/L4Q6sJ4APScShJcQlnSjFUkQ1lt0XMLh1OX4yUz7MuZQacN4SgvZ1S e8KhmCJvPrKhfleUcwKKHD3gwamqWimID1GcOARRfu8+OtYvKCJgXlHNU8Dz1SxVgqLj5dTepqK 2QFXDoSAwvO+lKSbRVZqSrdYvUDYM6oqCcwwm4CnFl0eckbmZfzFtOJxJSAO6OmsfWgbm8M+DVq uP3Bbh7mG5G7cHyKtLT+OvjQBZhbFVhIDDpfDS4rb/j/MB+VW5t+G+io/tp/3wZbhckqrl9Lg3M cGVHdcK70CrmV/lbEevXE/bRVCNcFP4vHsad/boGu1wkuStSD0Tge+YVyI3qPx05CgjSu+nrL8Z +Zwo1avetvWkcfuGi2A== X-Authority-Analysis: v=2.4 cv=ZITaWH7b c=1 sm=1 tr=0 ts=6984cfec cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=w9bA4Yi6UXS1dLCTJJEA:9 a=bTQJ7kPSJx9SKPbeHEYW:22 X-Proofpoint-ORIG-GUID: BqGCM4dr9PpQrq2E7ax-joiqX0IsNM_G X-Proofpoint-GUID: BqGCM4dr9PpQrq2E7ax-joiqX0IsNM_G X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_04,2026-02-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 malwarescore=0 phishscore=0 bulkscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050130 Content-Type: text/plain; charset="utf-8" Reset queue pointer on SNDRV_PCM_TRIGGER_STOP event to be inline with resetting appl_ptr. Without this we will end up with a queue_ptr out of sync and driver could try to send data that is not ready yet. Fix this by resetting the queue_ptr. Fixes: 3d4a4411aa8bb ("ASoC: q6apm-dai: schedule all available frames to av= oid dsp under-runs") Cc: Stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6apm-dai.c | 1 + sound/soc/qcom/qdsp6/q6apm.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-= dai.c index aaeeadded7aa..87e4474d680a 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -317,6 +317,7 @@ static int q6apm_dai_trigger(struct snd_soc_component *= component, case SNDRV_PCM_TRIGGER_STOP: /* TODO support be handled via SoftPause Module */ prtd->state =3D Q6APM_STREAM_STOPPED; + prtd->queue_ptr =3D 0; break; case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 1d5edf285793..2cfebd622be2 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -215,6 +215,8 @@ int q6apm_map_memory_regions(struct q6apm_graph *graph,= unsigned int dir, phys_a =20 mutex_lock(&graph->lock); =20 + data->dsp_buf =3D 0; + if (data->buf) { mutex_unlock(&graph->lock); return 0; --=20 2.47.3 From nobody Sun Feb 8 19:24:41 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B98D343D4EC for ; Thu, 5 Feb 2026 17:14:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311663; cv=none; b=okr32tkynpkyA/NVIFrgLFXXhlbg9W9dUBMt/FROpsWcND8UXPhseJcVp/Tiww5I8D5kU8GLMsgs/jZTCYRvASD/+TSm+P8Qm+F5mtLBgoyWFfy4b4jabJX3IGdW1cbLIkOx32we1jwW++U/YCCYqHzSJMFwdsfbGWEH3z8mlMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311663; c=relaxed/simple; bh=sSGa26gpWdI3zubzr4vR8voY2ZZ9uOTTFQpEZo9CUFk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NZBw+lKgSKr6qissEqaZFKYHcyrMa2+JLHRdRGoAuSvVcASLbRZNnRiFQtifRud3ihJvLIJJ05VEjF/DN6F65R0Q8eNWid09D6BQpb51TKaLZgFp64V6A6ItUqEbQbB7Xw2isMI+SIAlxox67NlIOSKGLHxKCXDRGfeqXugFO7c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=WstSw2k3; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=RCYDeT0w; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="WstSw2k3"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="RCYDeT0w" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 615BHHuJ2157766 for ; Thu, 5 Feb 2026 17:14:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=WhVePPPT+SN r/7D2LWKoUshhH2y0lkEE57VXfglAsco=; b=WstSw2k3qVqbsDmyfc3XQMJE30O eKRUT6op5W/aIvPFhuFYlWL2PIvq3tNcpdA4JiEpt7+luT+fkgn+8oR3bEwh7xDN CSdUXJNZW4uXIWDIafcbYxmDnq522IrYw0347s1G7abEReZJJoXuRfWcmBNLtmU7 nn4kjyRnG9EVAUOFP3fNpB2I1cYfw6050R8xHkCltUh4056EiU6nrugwakHUgX+b YAZRP0mmcc+FEM+fizga5fVdgjq9lPbhNdDrDxtKiyZf0v9LItsxNL1UNAaq2OI9 SRkSPNm/yv0PD/Hk7zdXGV6Df7lr3reKhh7v6AlHsQ1iN2r6djlY9+19Aqg== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4gynttrt-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 17:14:21 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-8bb9f029f31so425714185a.2 for ; Thu, 05 Feb 2026 09:14:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770311661; x=1770916461; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WhVePPPT+SNr/7D2LWKoUshhH2y0lkEE57VXfglAsco=; b=RCYDeT0wrbtsulB0fS/dNVMkcxSqmB40SsNIJf2t/Mo5p78gQqCznS93e15ty12um/ 8Pg8TXxoy/kHCPAFt1uXnrth1iEi6gts/U15n9jasqkayEnNigKQVS0Edc0BmgdfU6tv Gk3QGNx9JsEc25kgh0ULiGy8eUJ05aX4bEYgwt//L2vTS8t+S48te1RFYzxNCox4ujAn g2R8765Zaibzqo0mFrkD5kXKWD8I5u8xgVaJR8AvJUVM4HF6sOk83xTkrby9ZdOcL29I KYgQVDETtOv/pD72F1ggC7XTt+7baZZ5Xcxk2Zkd99z3yBvHQ3Liwvfa9PsGN4WUGWlf JvRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770311661; x=1770916461; h=content-transfer-encoding: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; bh=WhVePPPT+SNr/7D2LWKoUshhH2y0lkEE57VXfglAsco=; b=YaDK24g6NV5iHTHT0fMumaPLCoLsGMmLK9y2VVncO+DU3+DM0cPGRxh54vRNyQAzan vGNV9LUyvZa9MasagYqLPczC+E51TxoVwLy2V/4PRTLQGILPLjtV0ILsUSaPVL0skw4J CWN3ec1Dz3QDqBwuqtY3yXzMLYHi7dpFDZ7ae/OzHvtoyVNFrCHdCIrJm/x/QQT+HNh/ DtiireRjcYsdB+DNn1QQ3d4YyVJtEMnwx6TL4ygVcVxtpflTamFH4hvuMGV/lM34B+QX wQKjONcqOd1bW9ZFLPXEwQlsF/8QzgFt3+VPiA/f4QUW8uc4G7fWiLBGQflkEWD9OICP yCLw== X-Forwarded-Encrypted: i=1; AJvYcCUCe9TNJVG7QfURW+ep2iYqg8S8rPK9qGhhtd8j0V3e82uPIX4i3FfPG7SCmZXo6VjcI8cvNZgmvir3aSs=@vger.kernel.org X-Gm-Message-State: AOJu0Yypvz9XzfLte9Ld0Wu/2x0Ra678Aht9Q8vRN0+0KxXFXGmywB21 s3RqcfRMEHtr4NplBo+uR8HEsDOtvuTpp/J2OSmxYb/POt6JGSddt9oQcdbnYCCYQcCxbyDJgKJ /Kut+DNc9irT+rt0PxF7K+Mcw7PhGAb3gMckPANektD7Zi9NBlb4GpOn5WHuZOGlLkZw= X-Gm-Gg: AZuq6aIjcRYSfYpUy5dLKlVXXwW67t0d0RVW75IS50S2zjQ2h0/HmdHcskbLlblwv9o EkCYHoBSwNho92+LbtCO1HYZUr4k2nr1A+2mjrwZ7opXF8AdrAr2pu/0J0nfLjuDJDVjgd5oD+E /kt3lzbl9gNBGMf1/rXGlhVmhz2osUuOC5x0ZNkv4kNOASBRSgA3rlfuwh6JalP2qEAawdvE8a9 WnQ5szs3TOqOk8M8ws6WdKIS8eLqONNJDqmCssu+L9/L5KuSQ5JBJgLpPGkgw7E9ug2aXDJOr1G BGv1lE4kV0160tD4H4LFXU1wkO+9vSVHaVxk2X5ca4Cj8YVdN+BHTYMZvpeYmJte32ONCNAhLz7 aad6JEGuog8iGiZ+7fUaYgPqelT2KvbXhIlCVKUJgdsk= X-Received: by 2002:a05:620a:691a:b0:8ca:450f:c389 with SMTP id af79cd13be357-8ca450fc3bamr291870385a.62.1770311660869; Thu, 05 Feb 2026 09:14:20 -0800 (PST) X-Received: by 2002:a05:620a:691a:b0:8ca:450f:c389 with SMTP id af79cd13be357-8ca450fc3bamr291865085a.62.1770311660385; Thu, 05 Feb 2026 09:14:20 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm14802849f8f.21.2026.02.05.09.14.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 09:14:19 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, cnor+dt@kernel.org, srini@kernel.org, perex@perex.cz, tiwai@suse.com, alexey.klimov@linaro.org, mohammad.rafi.shaik@oss.qualcomm.com, quic_wcheng@quicinc.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 04/10] ASoC: qcom: qdapm-lpass-dai: correct the error message Date: Thu, 5 Feb 2026 12:14:05 -0500 Message-ID: <20260205171411.34908-5-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDEzMCBTYWx0ZWRfXzftVu8spusg5 2ropxLRPymkeyOoELb5HSvb34rLSrzNWy6rRxe3PguPFrX46IyuqT8EKXfrTM6/3qC/6UnD8ENM 4x4W1YXdRCWhQjH6oZHf6VbppxVUSgNzgZ+xForVC1UfOeOfmyoq7ahzM2tRzjhbpbkR5WwJYw6 hZi+gI/Q9ArcH8TarhTzsRlOatFgNmGN8trtru/3maqex34EwXDCygRw9c5C/KoFVRewsn7KCEq Bbh4sFEJvT5xcYuOMOuvAH9UGfr+JmyuXVIg5RPsOexQd4cplrr09cpxdNbyYVf1AbdC62e+fZU tfjgsXsXZwbx11gdqG+3GZ7DPtgDVp7qPJ3lR8jA9uCXBVyMEWEmwirU1ZwYo8s3VOw/Zw3hsF1 ONwBdkHmiqmdt3iA6m3SnpVNqv+4xqsoeY+vi+4f4S77aOELpb0JFyuXk4puEYl+m/lxs/hJAIE TUIG8MSk49xVqT2YVKw== X-Authority-Analysis: v=2.4 cv=GdcaXAXL c=1 sm=1 tr=0 ts=6984cfed cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=QkacBUY9L2qTTJrEq-kA:9 a=bTQJ7kPSJx9SKPbeHEYW:22 X-Proofpoint-ORIG-GUID: BamS1_2YtNY1liFcVbw1U7Nt9zbTAG51 X-Proofpoint-GUID: BamS1_2YtNY1liFcVbw1U7Nt9zbTAG51 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_04,2026-02-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 bulkscore=0 phishscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050130 Content-Type: text/plain; charset="utf-8" Fix the error message to reflect the actual graph stop error instead of graph close error. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6= /q6apm-lpass-dais.c index f68d4b4974f3..fc246485e326 100644 --- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c @@ -150,7 +150,7 @@ static void q6apm_lpass_dai_shutdown(struct snd_pcm_sub= stream *substream, struct rc =3D q6apm_graph_stop(dai_data->graph[dai->id]); dai_data->is_port_started[dai->id] =3D false; if (rc < 0) - dev_err(dai->dev, "fail to close APM port (%d)\n", rc); + dev_err(dai->dev, "fail to stop APM port (%d)\n", rc); } =20 if (dai_data->graph[dai->id]) { --=20 2.47.3 From nobody Sun Feb 8 19:24:41 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6780143D4F4 for ; Thu, 5 Feb 2026 17:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311664; cv=none; b=OYpaQJrpnA0WbFbsp33IX1bA8vgpyPgfAs4zZwK7tOmB0yZdoJdq5k5+mPF5CPn7q04wNnjvsMWuSSZLtX88qu/D7jz0ml5txMw6/R6xO33ZjT3Eex7aLLN1JALoYNbRcwYlINepJG/Drhov+nkAjBUUEqJvaoJCHhFws98Qs10= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311664; c=relaxed/simple; bh=r5N8Z8hPz59oN0RNuGapAQnXLzTPhHdzsNfJMM8N9DQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sZ8c00pQFKyO/d2QMjOvfJHRWinEe1y3oktJ+PvaPWvjdOWtJf2LwnmfD7m8H90MS69mtB+QI8+lF6babiiwNBRA60f5cmb4yJO4SmUcqhPGAm2RdpiDiARpILeVmW0vQt29yeTs/bN9Pty3nA8+x8fvYTazqY5Hh/sCya6hlkA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Zsm+aa+l; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=AnVMsGyX; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Zsm+aa+l"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="AnVMsGyX" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 615B8Kpk2160335 for ; Thu, 5 Feb 2026 17:14:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=wuA8VwYWX47 mki1E5cO8ixPzJqRo9fgaXlZKqhxVW2w=; b=Zsm+aa+lqpY14jxn+95qMxfd2uk FeLzesTaQhhGrD3cOPU0I1WtzuJz2R5SDap2mpV558ESToe8jTe0KIKSWj0Z9QVn oAZgxRFkyGluZLAu62IO49naW+3sXSqu47HKp0a5ZTlRS7ksKdRkVz9tt+pFLNUP 3tIUX9tk6KzBixQp3zf6BB8k9zLivc1EtQWwZm/XZvw6CrTB1aKirJhlRODO0EED ONMAIccduZyxnAvcyMzDBccP5kBYfcRKnmMbFcGP8/7NJwJ1+b/dQ9HDXy2KpOny TsuJ+fBcyWq3s5EGMlsV8WWFIvoXAbNDT4WyV7DAYJUTCLCSPLXTGOzGpeA== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4gynttrw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 17:14:23 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-8c52c921886so128627485a.2 for ; Thu, 05 Feb 2026 09:14:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770311663; x=1770916463; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wuA8VwYWX47mki1E5cO8ixPzJqRo9fgaXlZKqhxVW2w=; b=AnVMsGyXJKdeVvygcGyrLjYudnYhpbAkQucQ16Sni6pVMPpMfs0Uxb47cyzqRuulpO aGiwL9dNNem/8SwrRPk/oWJ5FraJaf6wEoxuh3uw2sdphebhp62d09aMBcZPQxyy3zfP GgTWVN6uGZkgcv8d7dI8dGxj0hcZOjkrNrKYX8WhmILyuNyBdqdBJfzGKWixcWiAXaHG r0uLSKS/rG/pe5zm3i8/N+g58Zy/ZQ4AihzWz3Su771c7OHe6qNj1enTLJ2DtIG6QGfD QLTTN3SuGHrDZuOhpL0Gnz5gfBC2TsMIF3J7PNqdgucnEvlsrIvg8VssoVSuAJLN/PX/ uAYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770311663; x=1770916463; h=content-transfer-encoding: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; bh=wuA8VwYWX47mki1E5cO8ixPzJqRo9fgaXlZKqhxVW2w=; b=GpchnPEjLop8gtV/TG76+rgtuv3WdHuHJTPqGWf4U9PD4619UAMN8KV8yleHv6bFQn xdzTFpe0bGN4kVjJ3xCQRDLqjq/EuFodOZNeBXGiaPS2/yoUvy0fY8WJgFaMXubtIt5M tOpuMO+WKk+gzZaWNiNs1xm0NQbKgr/TlJcuif/xyikUIAV5hQFkW/XUiz8zG4y2cO+a 8W3vtpB5qKGmwKn0whAOLCHonFTqCSgwZWzqEfbpaecWt8wLkiwIN3DmNR/8c1y5giIG So0cQbJkSCWs9hEjw8KfroaD1FTebFYiV8BbZe0dicsO7IatwNhzG+lKpK9btAThZxyJ LxpQ== X-Forwarded-Encrypted: i=1; AJvYcCXkF3xYKHlfz3B2A9cbZXxS2Gcz8SjnsutH2+T9M4vKBhq+QNeM03iBHfspdtVElGnwoT6La4TAiq6Ir0k=@vger.kernel.org X-Gm-Message-State: AOJu0YynJ80L/bd08otQ/TBmYLsJvWNXr9e1ptgyL613mL1J9WWcbFdR xMmrnUHQBDjE+9c3+T8q0D2NP5QmEFcD/gWZxG9j+rgVzokeS9jdPbr19fnFybgMkZML10TfOrX 0hhPP5GyjzfsEWixY02ijqqMTktjl01hYYHM0cbVKWdWFxb106Jbx/IS/VSPttUX7bCc= X-Gm-Gg: AZuq6aIpojsM7dvggPP/QqvNW/O6oOYDlXMk1N0TumKYaGcdSlStRH4z7cDCQpiGvCM H0NqWdeWz7HoH5kTfcT/M9UTT729YJVlBUp8NPZUQ//3Ok5LEp1660FGGtz2gzvouhnZeZ3g7HK wedbI7DQvPNkxCg5xF7z+tsrUS4bH2xWgmSLV6t5TmquSzSEbMyJBzna1U7TKKdiFjhcW3uNkdD +plxWrdRLYunY/x+FlR15Et0gQ/aov/GjKUucd5/R3LxuGnCBAb+1KBa9jorwY2DT6X8nxMi526 9yWE+YT786pm/6FyYDq65DYcT5qdqprjOmDgOXuJS5Y0KI17bGzqYxx8p2EOF8VgJ6Cl5XDGWy3 Fs2geBu8MuEcXjKF1MT7Nq1NZBKiN2v/PdrYTwEcGgdo= X-Received: by 2002:a05:620a:4892:b0:8ca:105a:298e with SMTP id af79cd13be357-8ca2f9d98cfmr913457085a.63.1770311662485; Thu, 05 Feb 2026 09:14:22 -0800 (PST) X-Received: by 2002:a05:620a:4892:b0:8ca:105a:298e with SMTP id af79cd13be357-8ca2f9d98cfmr913451285a.63.1770311661978; Thu, 05 Feb 2026 09:14:21 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm14802849f8f.21.2026.02.05.09.14.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 09:14:21 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, cnor+dt@kernel.org, srini@kernel.org, perex@perex.cz, tiwai@suse.com, alexey.klimov@linaro.org, mohammad.rafi.shaik@oss.qualcomm.com, quic_wcheng@quicinc.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 05/10] ASoC: qcom: q6dsp: add support for LPASS LPI MI2S dais Date: Thu, 5 Feb 2026 12:14:06 -0500 Message-ID: <20260205171411.34908-6-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDEzMCBTYWx0ZWRfX19DRgFIc/EfF ZCdx6zOgY47uiYNXnPzxFTh5deu5U5RVUb49MJMeXuv7f/jHO6t8IPuP7eBEss8i7lyIoW4ojdM kjX8k0As0hKJi+g5IE4IZaUras13yR8zsjpznUm+Sc45KE9bcTWNeuXFg/cLx8LdUMUvpYhIEgq 5GhGGQ7Z2O8qDVrftj/1OJhQ1c+HVi89QMoeA/J8cqXtpYrvrZKIbZ6yrA52EGo4Fkcpld4w50e /Zu3g97uHpQcVkFrHoiji64Xc0nOMZ4UmRFAvIkXghaVQAftjXYdMs7D9pXO2xilKXHXGVgnXKm LAcmBSLjXYb/DBNBykg2Kmn+XC4UApYTLLiDbA0EqFbJaai8M+0fnPhHP4sSKJryWdCJddG4AB2 BYZg9KN4JGxUqIW48fWc4GKF272zLXnlemUzSbnnOKGc6Czw7OQOV2Rnz/+pyhNGcZDG0VgFfxs ys8CJoE9GPNyIsUbPdA== X-Authority-Analysis: v=2.4 cv=GdcaXAXL c=1 sm=1 tr=0 ts=6984cfef cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=NNISMICuKrt3OvTWregA:9 a=bTQJ7kPSJx9SKPbeHEYW:22 X-Proofpoint-ORIG-GUID: 5P7SS8GSbuTJRXFjoJJ_-6rG1NuoJOtX X-Proofpoint-GUID: 5P7SS8GSbuTJRXFjoJJ_-6rG1NuoJOtX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_04,2026-02-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 bulkscore=0 phishscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050130 Content-Type: text/plain; charset="utf-8" Add new dai ids and dai driver entries ior LPASS LPI MI2S lines Signed-off-by: Srinivas Kandagatla --- .../sound/qcom,q6dsp-lpass-ports.h | 12 ++++- sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c | 47 +++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h b/include/d= t-bindings/sound/qcom,q6dsp-lpass-ports.h index 609bc278f726..0febc641f351 100644 --- a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h +++ b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h @@ -140,7 +140,17 @@ #define DISPLAY_PORT_RX_6 134 #define DISPLAY_PORT_RX_7 135 #define USB_RX 136 -#define LPASS_MAX_PORT (USB_RX + 1) +#define LPI_MI2S_RX_0 137 +#define LPI_MI2S_TX_0 138 +#define LPI_MI2S_RX_1 139 +#define LPI_MI2S_TX_1 140 +#define LPI_MI2S_RX_2 141 +#define LPI_MI2S_TX_2 142 +#define LPI_MI2S_RX_3 143 +#define LPI_MI2S_TX_3 144 +#define LPI_MI2S_RX_4 145 +#define LPI_MI2S_TX_4 146 +#define LPASS_MAX_PORT (LPI_MI2S_TX_4 + 1) =20 #define LPASS_CLK_ID_PRI_MI2S_IBIT 1 #define LPASS_CLK_ID_PRI_MI2S_EBIT 2 diff --git a/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c b/sound/soc/qcom/qdsp= 6/q6dsp-lpass-ports.c index 4eed54b071a5..d31388ed3ccf 100644 --- a/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c +++ b/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c @@ -96,6 +96,42 @@ .id =3D did, \ } =20 +#define Q6AFE_MI2S_RX_DAI(pre, did) { \ + .playback =3D { \ + .stream_name =3D pre" MI2S Playback", \ + .rates =3D SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ + SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\ + SNDRV_PCM_RATE_176400, \ + .formats =3D SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S24_LE | \ + SNDRV_PCM_FMTBIT_S32_LE, \ + .channels_min =3D 1, \ + .channels_max =3D 8, \ + .rate_min =3D 8000, \ + .rate_max =3D 176400, \ + }, \ + .name =3D #did, \ + .id =3D did, \ + } + +#define Q6AFE_MI2S_TX_DAI(pre, did) { \ + .capture =3D { \ + .stream_name =3D pre" MI2S Capture", \ + .rates =3D SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ + SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\ + SNDRV_PCM_RATE_176400, \ + .formats =3D SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S24_LE | \ + SNDRV_PCM_FMTBIT_S32_LE, \ + .channels_min =3D 1, \ + .channels_max =3D 8, \ + .rate_min =3D 8000, \ + .rate_max =3D 176400, \ + }, \ + .name =3D #did, \ + .id =3D did, \ + } + static struct snd_soc_dai_driver q6dsp_audio_fe_dais[] =3D { { .playback =3D { @@ -484,6 +520,16 @@ static struct snd_soc_dai_driver q6dsp_audio_fe_dais[]= =3D { .id =3D QUINARY_MI2S_TX, .name =3D "QUIN_MI2S_TX", }, + Q6AFE_MI2S_RX_DAI("LPI RX0", LPI_MI2S_RX_0), + Q6AFE_MI2S_RX_DAI("LPI RX1", LPI_MI2S_RX_1), + Q6AFE_MI2S_RX_DAI("LPI RX2", LPI_MI2S_RX_2), + Q6AFE_MI2S_RX_DAI("LPI RX3", LPI_MI2S_RX_3), + Q6AFE_MI2S_RX_DAI("LPI RX4", LPI_MI2S_RX_4), + Q6AFE_MI2S_TX_DAI("LPI TX0", LPI_MI2S_TX_0), + Q6AFE_MI2S_TX_DAI("LPI TX1", LPI_MI2S_TX_1), + Q6AFE_MI2S_TX_DAI("LPI TX2", LPI_MI2S_TX_2), + Q6AFE_MI2S_TX_DAI("LPI TX3", LPI_MI2S_TX_3), + Q6AFE_MI2S_TX_DAI("LPI TX4", LPI_MI2S_TX_4), Q6AFE_TDM_PB_DAI("Primary", 0, PRIMARY_TDM_RX_0), Q6AFE_TDM_PB_DAI("Primary", 1, PRIMARY_TDM_RX_1), Q6AFE_TDM_PB_DAI("Primary", 2, PRIMARY_TDM_RX_2), @@ -636,6 +682,7 @@ struct snd_soc_dai_driver *q6dsp_audio_ports_set_config= (struct device *dev, break; case QUINARY_MI2S_RX ... QUINARY_MI2S_TX: case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX: + case LPI_MI2S_RX_0 ... LPI_MI2S_TX_4: q6dsp_audio_fe_dais[i].ops =3D cfg->q6i2s_ops; break; case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7: --=20 2.47.3 From nobody Sun Feb 8 19:24:41 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89B3943CEF9 for ; Thu, 5 Feb 2026 17:14:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311667; cv=none; b=L+TcVISlLbyZTZunfvNjvdnPQBM6fPKA5fCUo9RosY0O3w9tPUkpqRr2gmoFjmcj7aswVVCoeAJEceim3PS6AF+463INMAtiKPP4QG6ccBZuWTPpkRKFwXob4ejmBRxI+766EQTU/H0jVWc8GHJWlqbYA6wYZBUhbXpNynDaoBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311667; c=relaxed/simple; bh=OpBfp5jqslbORQSzmdK3zOW77Ndk5UkWCXVD4HYaUd8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B5dUvPi984p1dJm00xOyjprcpdwW0aCE47aAAibU4B2vNENu8syiyPqJOrv5V5FfZA3cGtlpo8tuNqViKsRl87QTigf/LQTo9VfWohx7diHWCI79sxvQPGrAqlL4tSrGqx5py1MipZwK6BU2aLmKQcnvSF18NzdE7zIY8y7SB6o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=dO7xpI1J; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=PcRw5R1M; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="dO7xpI1J"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PcRw5R1M" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 615BjgoK4125648 for ; Thu, 5 Feb 2026 17:14:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=I8kPziSHEPC 7tP4o1IoV56rLMTkjFafRmWxkdzxubVY=; b=dO7xpI1J+lqX593XNrV0Diur7xT L7ZUseOm+AOjfsgDQP9Qdz+SYhrFZAm0JTXq/x/nqZxoxWrWOYZ2EE1Ck29mYQzl HmJ+GkCzcQSqQH45/SdHgmSXzqfIUr8nHBWB/D7tZa+zq2C3DGxzswBguLO/7rqZ K7qR59S7DBTyjTXXaEVa7z+SLH/HvAhKMGKWQHbprvSMEhULF5O4OntTWbDRk3MF baJrULQP/epFDFPtfWF+dOJ6WkWgg1Jx7DIFHyMTjWmxWtlk5lbWXI2H3N4gIyRZ e9pX/8A8imOqlw8pn4iUmO1MC7a0n+o6CZaS2qHMnM9QXdpbh2S3kbdf58Q== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4tm8s22q-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 17:14:25 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c881d0c617so324066585a.1 for ; Thu, 05 Feb 2026 09:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770311664; x=1770916464; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I8kPziSHEPC7tP4o1IoV56rLMTkjFafRmWxkdzxubVY=; b=PcRw5R1M69RP4MIOJTeYQzOVuOA3H3hhQMPUjotTCu4ZdyCnyU6m5pG/4LSS/QCdVt /QvCgDxYlaPsJn6MgJiaOUmvxBW1qQxWFdlyRJQN+WLz70lM26ytp8YR7iyZ1uz3apGE K8liwiMREtrtc7Stl5xg3hd74JqsJoSbf4HsYueVRD00fyDsM731b8xKj4v4KpqOiDg+ rQDxu8GONW4sHqe1uqKPiz6BE+w58DnXDgtQvSqYyaiRSWu2aba2YdqdhfVaVYCvzIAd Ukk5t5KPwcBp98AX8UYFNkg2u7BCF43Q7lOTH65HS84iMj5+xqEN9bbsgBpXIaBW32Ia QhIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770311664; x=1770916464; h=content-transfer-encoding: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; bh=I8kPziSHEPC7tP4o1IoV56rLMTkjFafRmWxkdzxubVY=; b=bU5Ki1E6hxcJgnFrMM3pS+dNogvGRjpele90+orQqcFoNAcDLu58DtcoOMEXJEJnFq 7lz975/1hey9HaLMxfBspKxRx8GuQmE7bDFEVYdJ+XcWznSYqJyRWIsYLyLpmM9DU+P6 x9S4mOQ7HhoCi6ScIv/zMym4G1DjEm1Md46IpOOigGrFhq8hvfqd82mKf+XsQ5O0otn2 naj8L+evu5xFDo0HnptlaQM72sL+Uy3+TopYl3tZB+LRN9RBnNylNxMI5Jq3OacWG8wQ KyFdYRy+rnD/2n7ADmwdCoNvpygDipKMsKOAbu2ZwFmK6UPOLtPIomWtQj/gs67vHhr5 99TQ== X-Forwarded-Encrypted: i=1; AJvYcCWQH7aCb6EBZJoPMFPBfjWS9Jl4GzJzpGNWP3KHa1CfpzjpD1IRlRPB1jAo46zt+LUcCpLQSHafOj9skgY=@vger.kernel.org X-Gm-Message-State: AOJu0YyvAO+qqAxMABUznjt8qEhhNUJzklJrvKSY7ZEYzD6su9nOJvpf bl5laAB4CANjIcgTcTjYqAmEoUHWRpIGtOgS57KmvLTw+CFwUN+IVUUQ4f2nUgyAAZJfsf1aVOQ n8+PVXBGOPyHfbVK5Xb0QZ5iPpNtd7r5kBzya54O6vYb82VQKGR3yDe3pXk/XXYlNE1o= X-Gm-Gg: AZuq6aIqzOlM6HLFXbjDCAZR79LOpnb3/nCAvTKZxu+HQaVfSYlbHf1DXQy0ru5Aw2X 83Ym+Ak1UIqjpvKF/z/RKoF9J2oufclKjs0boKswhMyF+ekxZTLB3Ehw3iSfk9kgQRJd56md8vl xJ+HCT1nB//T78tuAruph4oLMzQXpmCXg09jHsoNRpoO///agBsNq44617jiqElavga5dDhfm1a YMZhzT+FG7JQM8z+Mvji77gNhZGongLlbmhME0jPpmm4wuYmqw1n8JxCz2y7J/sVczGT22gMEK7 qeKm5XOIFJTr8ZMs5BnK/gBceCS7RbndnP+XFfLpRw3BbZhig90Ym1PJgk7NC2HKgNdP6t+DF/H H+02OTACE+daTuyur3Fy/t2YPJ1B25gVDOBqksV8jC+M= X-Received: by 2002:a05:620a:2a15:b0:8c6:253d:5187 with SMTP id af79cd13be357-8ca2f83bc03mr899696485a.11.1770311664127; Thu, 05 Feb 2026 09:14:24 -0800 (PST) X-Received: by 2002:a05:620a:2a15:b0:8c6:253d:5187 with SMTP id af79cd13be357-8ca2f83bc03mr899690885a.11.1770311663650; Thu, 05 Feb 2026 09:14:23 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm14802849f8f.21.2026.02.05.09.14.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 09:14:22 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, cnor+dt@kernel.org, srini@kernel.org, perex@perex.cz, tiwai@suse.com, alexey.klimov@linaro.org, mohammad.rafi.shaik@oss.qualcomm.com, quic_wcheng@quicinc.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 06/10] ASoC: dt-bindings: qcom,q6dsp-lpass-ports: Add Senary MI2S port Date: Thu, 5 Feb 2026 12:14:07 -0500 Message-ID: <20260205171411.34908-7-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=Vd76/Vp9 c=1 sm=1 tr=0 ts=6984cff1 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=S1r85Wze4wKqmHhc2Z8A:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDEzMCBTYWx0ZWRfX0s36d8RlMjad CZIfhZ/gc4aEkVjN11Plf6DFQxbTI237ZGeGONC2iaN0XUMtlTgSrzZCKPoFotH9cSaZN0i3xh5 12Oxzs9/dbLBbnsU7/tVNyt238mqZwunMz/XnfzptLh1c11jSnmrmINW+R6mYKTgNFL11gs7Eeu H6GDx0Xf9IqEbQ7APClCHVwWPnSsfBD01x/wEJAihceF8RUW1RLAWY8hdLyx7/lOZ+p1sdxT4jz EoaSsrOKF9IQRb8IXL/5lrlsZc5Q23BUNPCzMEYCZ+elmbSo8K7PdWVpOGK/4/rQj7a8sAe391u 1x1Z+5cjSyECqZnsLc9VBfQlXko1qv4vT6V5ChQRUg9OOQ2dYmAwl+y/gQ177H+RIZkAk1i/eQb TWsn7qSSfNWdquBbQeInV11zpS3jscYkpw2FUIHu5/3cWZK2HvJwoNSn2PjjSfEi+Pau8Uvez5M 0y9iH+KoCU0YhctJbiA== X-Proofpoint-ORIG-GUID: NbeMLCeygSMSQz2xikpVI-xcuTTJ_65v X-Proofpoint-GUID: NbeMLCeygSMSQz2xikpVI-xcuTTJ_65v X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_04,2026-02-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 bulkscore=0 phishscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050130 Content-Type: text/plain; charset="utf-8" From: Mohammad Rafi Shaik Qualcomm platforms support the Senary MI2S interface for audio playback and capture. Add a new definitions for the Senary MI2S RX and TX ports, which are required for boards that utilize the Senary MI2S interface for audio routing. Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla --- include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h b/include/d= t-bindings/sound/qcom,q6dsp-lpass-ports.h index 0febc641f351..715bcf1bccdd 100644 --- a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h +++ b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h @@ -150,7 +150,9 @@ #define LPI_MI2S_TX_3 144 #define LPI_MI2S_RX_4 145 #define LPI_MI2S_TX_4 146 -#define LPASS_MAX_PORT (LPI_MI2S_TX_4 + 1) +#define SENARY_MI2S_RX 147 +#define SENARY_MI2S_TX 148 +#define LPASS_MAX_PORT (SENARY_MI2S_TX + 1) =20 #define LPASS_CLK_ID_PRI_MI2S_IBIT 1 #define LPASS_CLK_ID_PRI_MI2S_EBIT 2 --=20 2.47.3 From nobody Sun Feb 8 19:24:41 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63E7F43CECB for ; Thu, 5 Feb 2026 17:14:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311667; cv=none; b=aaxPYDBVRpRIQ5iRqB3jVYv3ru7I/9Lta9CN0fgySJG0S6PIjpM8nopJoLeLb1vMLlUE/RJO/DvBh+lUOoxEmnJ18Zp+i2sv5U5mgdrf2f1IgfrlJNHWoxeYHYAV+ObLltZdP3RuikZujB1stKJQTZ72qsw9D6GBKeHlgOPtjf8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311667; c=relaxed/simple; bh=mDW997OLPhj9/cZiWF71LObptofAy2aHxMQZYNVrW5o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GuAAxeptQ2eCnaNRWeWiax9edJ0eQHXuSZYqtpBXrssV4cxXvxmOxQ25GwnyhBEQHnYhW3sba+TupjvvxFCGCNca8Ad1HP3XZ8yPekZajZTzHpCn6wXzxygujSUhs9YhIoLvSDgTkV6d3Ks0Z53qRvoHZiYMfPFddDv82ixloU0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=mCK+jooc; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Gg31f2LI; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="mCK+jooc"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Gg31f2LI" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 615BlfbA4135872 for ; Thu, 5 Feb 2026 17:14:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=TSmNTbeOuD+ fL/CAookHlWTYOHGnEPMNf+RyYw4NXHs=; b=mCK+joocnmJqKQFky4wSZx/JxCw B52ySztCcFnGZmn0Cnsv6rs89Ro0Aj6CBXHiwf+olV/p/gucC/ip6Ochq7FhymEX JxCSCUHrJ93RBmhl4G+1TNm2dFjc/hkTXGDS6dG1zOZ0LMa72qLM47E0iGlGA38K PU0BJBoNdf7pybnpv3eAlnAfLxT8lucz6UbDIQhVvSnfjGNSYpL8Jl3m2viGHR1y jQlfQjG6Co+AxKjddiAymhHiAFUZwBq3aCZbBhGyvIwEiWm4Pu+S2Hkp1NE3+UQy 4GBgFw+flhwRG3GvIu402rC73gEQ5kzel1BvBxDtv4OXU8MtLFP9UWLfTTw== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4tn41340-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 17:14:26 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c70fadd9a3so399385585a.0 for ; Thu, 05 Feb 2026 09:14:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770311666; x=1770916466; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TSmNTbeOuD+fL/CAookHlWTYOHGnEPMNf+RyYw4NXHs=; b=Gg31f2LIz+5t44EEy0+GS6bimr+GQ06adHLUGj8ij1W7YB5XTUu9mHV5Is2ZDQ3zsV Bg/kySDmZ0Y8NB4PnfmA3WMmivd7acU0qUtCWsNAMwG7aMvqvkDq+KrZBkPmAg5f4F3o fvAeqp3spk34etypEKE0Fg42CqYnP4QZAXzJn9Cy9EDfwiWG6qtut+wflRwqYaoiWp0B 5c/8B8ermbjXpHtEGQzZlYX1fNN9hV1Rnxd3j80leHdAGcqfBWovnKFkY41kUaYgoXFt dNWBsB0KYZ2iji/Ks8qx19jHJwWQxzSuXU5aPNgx53xnT6NoSiQku0Vy6F2T3IpHKHqS ymtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770311666; x=1770916466; h=content-transfer-encoding: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; bh=TSmNTbeOuD+fL/CAookHlWTYOHGnEPMNf+RyYw4NXHs=; b=ZKY6GbItArAlZ8JAUyn3AbDiYgn65sEswG1XhF12dT0kJyQATH8JavUg23W7qzw47t OFJxbT/D6pKxbuSHj6x0lnVShMB7m9avnKpgjQ1RS4fAJ4Fw+kSUo7EcZypSLQAvu97D hYlrxbJyKc/IQcZg/l6+uoqaYymzD0/7GJ9nfJ3Z9kHM0jVDq1QKCtrl+KJmMCOpWwJV iVEgu1fckupA47pHtSyH9IASPL+ACXj8sWsQJF4rG80dRMax23aO0wc+s03Gk/COohBJ Adc6HLqy+lJenwpZe9kE5bODn3W6/AJAl2pG0Paj5dsgn9fuhGULbZ1mUKtpEKn/kJpI hQbw== X-Forwarded-Encrypted: i=1; AJvYcCWtxu3tA8lD0gVqRA5uK8b3jA0JZLkGM/B4MKPsbPbs7XXf2j3G9LbXCWfY3TAJpCFWR4MtOf+OvtoLc9s=@vger.kernel.org X-Gm-Message-State: AOJu0YxTu6Fo+QiKmDnZ5i0Lv1AqHiAIq7a6kjjPqf8YRn+VDxLN5/1j giaG0aVey7k0Yn6wRu2FohUkCcZssM4zc43rcbKmpP84ZtITsboCbEQ0EZj159TYLXJvqEu0ga1 O2HMiqbXCpAK0cX5VgByTlIDk5aTnxYxhGVOaKRxEPFiU+RGadDdIWKsRDQhWAHiDREw= X-Gm-Gg: AZuq6aJMtbPb8P5J+FSOhV+e//wkxxue8a54sZEmao5R2wrBdwzwvpjh/jYDl3trCiV 3Ps8xOc7zFo5XYOOp1O1hyX4P0qS81VZHIvUJhVDLQZwfpNNxLUzuf0F10uNElQXnENNKJXbmEf IhCfB0ELC2O96u6WCQ0Y1znfjl7ie1x0PhTiFHK2eIjYd0yKKKJ+dSUmmKpPW7wS2caF6UMZX7k 2u2aNXWs8Sxq6Ezu/eBcg1ea0dIcMi24N1iIVcY4pjTQXF+0bF+hwoWPcdZ5Nk+eJFGDsC+flmG gYlWFSHUYsaWhFVmRo8FelSX6LzO8gIbvWizqEhzo9QbQmcPQKXPKUA2CJnhP7w2EMjaUT/2dt0 pFXx1lLN4/hslbaPR2tQIBPOdKvVqpwNDxCWMVnAqDyc= X-Received: by 2002:a05:620a:3953:b0:8bb:7e56:f204 with SMTP id af79cd13be357-8ca2f82c96amr937667185a.20.1770311665752; Thu, 05 Feb 2026 09:14:25 -0800 (PST) X-Received: by 2002:a05:620a:3953:b0:8bb:7e56:f204 with SMTP id af79cd13be357-8ca2f82c96amr937660185a.20.1770311665100; Thu, 05 Feb 2026 09:14:25 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm14802849f8f.21.2026.02.05.09.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 09:14:24 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, cnor+dt@kernel.org, srini@kernel.org, perex@perex.cz, tiwai@suse.com, alexey.klimov@linaro.org, mohammad.rafi.shaik@oss.qualcomm.com, quic_wcheng@quicinc.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 07/10] ASoC: qcom: q6dsp: Add Senary MI2S audio interface support Date: Thu, 5 Feb 2026 12:14:08 -0500 Message-ID: <20260205171411.34908-8-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: rB3EWLVImYetm0DYgmk9HR4lAMB7x3r8 X-Proofpoint-ORIG-GUID: rB3EWLVImYetm0DYgmk9HR4lAMB7x3r8 X-Authority-Analysis: v=2.4 cv=Dfgaa/tW c=1 sm=1 tr=0 ts=6984cff2 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=aBFzMgE2VLA-TvnT3JMA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDEzMCBTYWx0ZWRfX5GcTUPO8XD2Q SJhdzSvF8GbyGVn/7G2FromyXFedXo4UG1QWnCKj+2O3Ama2Ocnpr+jXF06Af23llzUmFwHRCRe qUanvsrXocWtBL3KSzgvCITAnbBkD4fAiO/4CUaNe9pn+H3HFNg2P6RpAbQQ1LQN9s1S4PVJudS KIaQnlfcgKnzAIFgEk3bkwrQJHuP82pWnABhgYHYmzm7mQv4C8SppB1U/DPZIGKEOy2Gbvs8XGr /aK9Qq2WywsaZcGiwYCuwQM5PUWl+/i5ubfv5/N8/BvKtkJU8njSoT6X4qBgEm16oROGUPF74VB 8bK+8sL11bMmjSgUh/7ABiyoR37nUbeblRR3SL3Wmo+hSs4XhHlF0H1ourBVaWZxSXVasoHeatT dTU1hTJa4IiaOmIUoc42PCGDlKd4+yWpyodWHXwAP9qrSTyGh2Lpd2reh1dU8GjoRyZHmd6n0WX x5D8XWFwxwe+TlZHI6Q== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_04,2026-02-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 bulkscore=0 malwarescore=0 phishscore=0 priorityscore=1501 spamscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050130 Content-Type: text/plain; charset="utf-8" From: Mohammad Rafi Shaik Introduces support for the Senary MI2S audio interface in the Qualcomm q6dsp. Add new AFE port IDs for Senary MI2S RX and TX and include the necessary mappings in the port configuration to allow audio routing over the Senary MI2S interface. Signed-off-by: Mohammad Rafi Shaik Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6afe-dai.c | 6 +++++ sound/soc/qcom/qdsp6/q6afe.c | 6 +++++ sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c | 29 ++++++++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-= dai.c index 0f47aadaabe1..a0d21034a626 100644 --- a/sound/soc/qcom/qdsp6/q6afe-dai.c +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c @@ -409,6 +409,7 @@ static int q6afe_dai_prepare(struct snd_pcm_substream *= substream, q6afe_slim_port_prepare(dai_data->port[dai->id], &dai_data->port_config[dai->id].slim); break; + case SENARY_MI2S_RX ... SENARY_MI2S_TX: case QUINARY_MI2S_RX ... QUINARY_MI2S_TX: case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX: rc =3D q6afe_i2s_port_prepare(dai_data->port[dai->id], @@ -540,6 +541,7 @@ static const struct snd_soc_dapm_route q6afe_dapm_route= s[] =3D { {"Tertiary MI2S Playback", NULL, "TERT_MI2S_RX"}, {"Quaternary MI2S Playback", NULL, "QUAT_MI2S_RX"}, {"Quinary MI2S Playback", NULL, "QUIN_MI2S_RX"}, + {"Senary MI2S Playback", NULL, "SEN_MI2S_RX"}, =20 {"Primary TDM0 Playback", NULL, "PRIMARY_TDM_RX_0"}, {"Primary TDM1 Playback", NULL, "PRIMARY_TDM_RX_1"}, @@ -636,6 +638,7 @@ static const struct snd_soc_dapm_route q6afe_dapm_route= s[] =3D { {"SEC_MI2S_TX", NULL, "Secondary MI2S Capture"}, {"QUAT_MI2S_TX", NULL, "Quaternary MI2S Capture"}, {"QUIN_MI2S_TX", NULL, "Quinary MI2S Capture"}, + {"SEN_MI2S_TX", NULL, "Senary MI2S Capture"}, =20 {"WSA_CODEC_DMA_RX_0 Playback", NULL, "WSA_CODEC_DMA_RX_0"}, {"WSA_CODEC_DMA_TX_0", NULL, "WSA_CODEC_DMA_TX_0 Capture"}, @@ -770,6 +773,8 @@ static const struct snd_soc_dapm_widget q6afe_dai_widge= ts[] =3D { SND_SOC_DAPM_AIF_OUT("SLIMBUS_4_TX", NULL, 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_AIF_OUT("SLIMBUS_5_TX", NULL, 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_AIF_OUT("SLIMBUS_6_TX", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("SEN_MI2S_RX", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("SEN_MI2S_TX", NULL, 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_AIF_IN("QUIN_MI2S_RX", NULL, 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_AIF_OUT("QUIN_MI2S_TX", NULL, @@ -1037,6 +1042,7 @@ static void of_q6afe_parse_dai_data(struct device *de= v, =20 switch (id) { /* MI2S specific properties */ + case SENARY_MI2S_RX ... SENARY_MI2S_TX: case QUINARY_MI2S_RX ... QUINARY_MI2S_TX: case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX: priv =3D &data->priv[id]; diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c index 76e14fc1b2b5..037a281d6f61 100644 --- a/sound/soc/qcom/qdsp6/q6afe.c +++ b/sound/soc/qcom/qdsp6/q6afe.c @@ -130,6 +130,8 @@ #define AFE_PORT_ID_QUATERNARY_MI2S_TX 0x1007 #define AFE_PORT_ID_QUINARY_MI2S_RX 0x1016 #define AFE_PORT_ID_QUINARY_MI2S_TX 0x1017 +#define AFE_PORT_ID_SENARY_MI2S_RX 0x1018 +#define AFE_PORT_ID_SENARY_MI2S_TX 0x1019 =20 /* Start of the range of port IDs for TDM devices. */ #define AFE_PORT_ID_TDM_PORT_RANGE_START 0x9000 @@ -718,6 +720,10 @@ static struct afe_port_map port_maps[AFE_PORT_MAX] =3D= { QUINARY_MI2S_RX, 1, 1}, [QUINARY_MI2S_TX] =3D { AFE_PORT_ID_QUINARY_MI2S_TX, QUINARY_MI2S_TX, 0, 1}, + [SENARY_MI2S_RX] =3D { AFE_PORT_ID_SENARY_MI2S_RX, + SENARY_MI2S_RX, 1, 1}, + [SENARY_MI2S_TX] =3D { AFE_PORT_ID_SENARY_MI2S_TX, + SENARY_MI2S_TX, 0, 1}, [PRIMARY_TDM_RX_0] =3D { AFE_PORT_ID_PRIMARY_TDM_RX, PRIMARY_TDM_RX_0, 1, 1}, [PRIMARY_TDM_TX_0] =3D { AFE_PORT_ID_PRIMARY_TDM_TX, diff --git a/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c b/sound/soc/qcom/qdsp= 6/q6dsp-lpass-ports.c index d31388ed3ccf..e5cd82f77b55 100644 --- a/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c +++ b/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c @@ -519,6 +519,34 @@ static struct snd_soc_dai_driver q6dsp_audio_fe_dais[]= =3D { }, .id =3D QUINARY_MI2S_TX, .name =3D "QUIN_MI2S_TX", + }, { + .playback =3D { + .stream_name =3D "Senary MI2S Playback", + .rates =3D SNDRV_PCM_RATE_8000_192000, + .formats =3D SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + .channels_min =3D 1, + .channels_max =3D 8, + .rate_min =3D 8000, + .rate_max =3D 192000, + }, + .id =3D SENARY_MI2S_RX, + .name =3D "SEN_MI2S_RX", + }, { + .capture =3D { + .stream_name =3D "Senary MI2S Capture", + .rates =3D SNDRV_PCM_RATE_8000_192000, + .formats =3D SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + .channels_min =3D 1, + .channels_max =3D 8, + .rate_min =3D 8000, + .rate_max =3D 192000, + }, + .id =3D SENARY_MI2S_TX, + .name =3D "SEN_MI2S_TX", }, Q6AFE_MI2S_RX_DAI("LPI RX0", LPI_MI2S_RX_0), Q6AFE_MI2S_RX_DAI("LPI RX1", LPI_MI2S_RX_1), @@ -680,6 +708,7 @@ struct snd_soc_dai_driver *q6dsp_audio_ports_set_config= (struct device *dev, case SLIMBUS_0_RX ... SLIMBUS_6_TX: q6dsp_audio_fe_dais[i].ops =3D cfg->q6slim_ops; break; + case SENARY_MI2S_RX ... SENARY_MI2S_TX: case QUINARY_MI2S_RX ... QUINARY_MI2S_TX: case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX: case LPI_MI2S_RX_0 ... LPI_MI2S_TX_4: --=20 2.47.3 From nobody Sun Feb 8 19:24:41 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BD6D43D518 for ; Thu, 5 Feb 2026 17:14:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311668; cv=none; b=QbFu1OiDuzGbwz4L5/SPiFpazy64YwS7qQIRWDt9wtOl7Jc/OSLonEe/BRu+0eKSjOskFRhbc+CEo2Yce6aUnBu9RwqLsWU2Uu9U02ZNw61Qdim8zdpr0GvT1UYEdYwodyiBb+k96u61GdL50bZtZU17b9qcH3BBqX9tB8FnMv8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311668; c=relaxed/simple; bh=jFJ7rXFjEEX2IgSJ4lsi92py1epN7EisVUgldVC1iLc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bDFcxjunSnW5e+37Y0bpKQN3S7sd2MPG+OdshyBICUCeRYzGIn/X51mlM1NjtlCDDIhxgfQfZlSs0YLi7R/yWDDxycBEknjlO0/6sbja/Yjo8DvDO2obU05M2ZiLcWZbiwkV/YG6/k4/NCqpFduykaUizg0KuBeksqW5ypx9k2c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=HUBGYboi; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=W4j0ZGLz; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="HUBGYboi"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="W4j0ZGLz" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 615B5pIe3237394 for ; Thu, 5 Feb 2026 17:14:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=QeXNPncWOQl n6sXzodfErITJ/YZ4Z4KW6LENrZa0q1c=; b=HUBGYboiAca+MaF2KpgoQ754iG8 TaJP67DuKvNlFtHQidrv/ilchPjgi3fCMb7ZjjkKnfVLmcVoP+mJhR1bDX6GSZsa b9QDjK+NQ0rMtf/XE1g+HANQ9PPUsWoq2dTZrhvTRRrRoQabMM/4pM8irFioQSO4 vswgACJOuqzOROEWR2eXpO74EQYh37MYPdHcpoiu4exk2qomzFxGx2SYY63p86FL sjN656t6wPoYk8sQrRxMeI2CjybTFB9eVjYZtJmROK+xNAuIUhPYS9WfAq5KzOJa PIdILhNIKa6i3CqdC/J38nJ2c1XTaSDIifJ/SeGL/hGfAXtH9va//6HEICA== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4cp53h9t-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 17:14:27 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c52f89b415so313379085a.0 for ; Thu, 05 Feb 2026 09:14:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770311667; x=1770916467; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QeXNPncWOQln6sXzodfErITJ/YZ4Z4KW6LENrZa0q1c=; b=W4j0ZGLzdKAubAYmDHsyhZj2+Ueqy/0p69kFIQvVy4pYtt5a2qGhK59UTKCiPEQeYC CiDnn7dRrQVX4RthzfREMdawTsnftTI2BNFper30hlOKlR3LRoDuncjF2iq7JcBjXOGr S2thPPEv3IJNRsC8NSJWTatZpQQRSLgazcfwVp6vYEzdV1/f1VEhqt0FSTT6iTHoiDeM ZUeBkhmblCEupJ1TAizQbjwm4UyrW9duHFa19W88oT/fE8FwqNIlJLWvucks26DC/TAF 1HnNSwyPbvQ3Es72AId/ZUIK6SvnoZesbkf8bVka3EM4+aev6mzHRAU8W+jG+FS8p+x1 7ZZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770311667; x=1770916467; h=content-transfer-encoding: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; bh=QeXNPncWOQln6sXzodfErITJ/YZ4Z4KW6LENrZa0q1c=; b=JzCrwTm2oO7s2/D5VBulph9L8ByJKaCbqD3J4bW+M08F/su4bxWGkxNBb5A+9Houaw eiSw0o3+BeCZO8GPkrj5fKdmGJduHmPKWmEeWo2SojqNhmXsuLUJSEMzdpCr5vBpwKPZ ZYwXYM0bnr9Nw9T3L/H1MrC10uDHYkwWMAiGfBx94hhzrjkA/+JNh3epz7Udqdj+3WQH meSOKCJO2JGjh84lBFXE5PBQFhoEz0E84dPdVD5f61LoNAZrLh6Ae8i2TI36dGjmC6RJ VGUQE4HlMSwl/wRw9YBNzT1v2DlBlm3OzUSnVLplVfm6szZdwOVThbuIe4a4Y2obf9U4 BvmQ== X-Forwarded-Encrypted: i=1; AJvYcCUuuP4UzTFNTJbpX0TnIyao8b7hZLqBVz5yo1z5AXRGe7p2iIZuXVvYNnZtd5IH/0DGV7NWlmUGZi7HQvU=@vger.kernel.org X-Gm-Message-State: AOJu0YxzMVPyXPSHgi+01g1F/KBgxgC/qtL9x9iy/SD4OOA64OKyGiZI Lr802Eh5DKM9EKtjXlXCZ0JknKK+PIkDXcDHQgXbO57sGzPEo75YQ5I77JF9v+geK3UaUSpxco4 KIjFld0cToFntQNUbzXIvSLgmIcExw7vJKzmO1dMV2BIhgWGt/glUhUJGjD+RfXCVJds= X-Gm-Gg: AZuq6aKGypxCq0CqNuAm9lgu2BnlkdM3b99T7xf1wHeP0IEu0EMafNpMctTKYxb4/IZ UGBG+w1YIDCs96/lONgjMi7LttPV3WTUzZLkc7a9vLANqWbHiG2AZSs1SHgCANx6nB5VAbVcGHl b2gOuOoQcR+KTJ+NS87vkaChN16Vxbd5zLaw7cTALEtLIrS6vofzs/f+FlZWoNmnzMGb7auxS3U tjXEGFQWwJrgnoK3d3CHtQjKMu2yZdVr08U8NazQIZk+GDAtkNesoywD2sCYEGnzilSjXk6YCao LnaF7omM1a5WzXX/qIFxnvzmgtORun2h01+K0+Dgp0zh9PTbkjIKoiWekV6xYaqRGpuZgq9g1kJ KIjkFi3CnhW3cx/lnd8d5BjwH+GGsnNxeT7nSHBWV2Gc= X-Received: by 2002:a05:620a:1902:b0:8a9:ef98:6835 with SMTP id af79cd13be357-8ca2f8675bamr889402785a.33.1770311666947; Thu, 05 Feb 2026 09:14:26 -0800 (PST) X-Received: by 2002:a05:620a:1902:b0:8a9:ef98:6835 with SMTP id af79cd13be357-8ca2f8675bamr889398985a.33.1770311666447; Thu, 05 Feb 2026 09:14:26 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm14802849f8f.21.2026.02.05.09.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 09:14:26 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, cnor+dt@kernel.org, srini@kernel.org, perex@perex.cz, tiwai@suse.com, alexey.klimov@linaro.org, mohammad.rafi.shaik@oss.qualcomm.com, quic_wcheng@quicinc.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 08/10] ASoC: qcom: q6apm-lpass-dai: move graph start to trigger Date: Thu, 5 Feb 2026 12:14:09 -0500 Message-ID: <20260205171411.34908-9-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=Oc2VzxTY c=1 sm=1 tr=0 ts=6984cff3 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=D19gQVrFAAAA:8 a=EUspDBNiAAAA:8 a=nXfEiGUnzg8titmCROQA:9 a=NFOGd7dJGGMPyQGDc5-O:22 a=W4TVW4IDbPiebHqcZpNg:22 X-Proofpoint-ORIG-GUID: QIoz0lpM5thP8GLLg8cfVJ_1_tEviNV3 X-Proofpoint-GUID: QIoz0lpM5thP8GLLg8cfVJ_1_tEviNV3 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDEzMCBTYWx0ZWRfX41GUXFhnZqvL 5UIrFMTNVvZ5m+Nd0JieZdYVnLMV2FVaMY8NlB7Stcwrf3v6VkZrPx+Ogn7NDXQWefndExyiqvP sd1vIjde7KdLHcMq80FUlJAJOfsxpcn08z5+ul4p5gij0VMemVn4un2RLm8mPeVMpUEYFH4rMjH B7ko0ZJK5JpoJNkCSZLw3I/Ksn9p3AKJN0Y8jsfKqpQ6zuGRkycgeviTctfmzTssM3ApREJlyUU ONyR30P12kdykna9RM6XaIJBw2QusGRoxOcWm8ZWiOf9Adxq1b4M/K4Mz2aIM0jcjumVWb9arvG O0Sogo9PsX8vCD8r3INUMjv1lRibGAX+HbQhdFfHC80v2Qs/2fZgJNkYSa18CgXWqwLeHxvogxC jg21OacI0urOgK7F1q8E/4KdWsHef3fmMroei5Yghhvk1XKlo0SufWi28ntGn3S2/hKGr3Y3s9g 2RPmOI+m/huIzDFwZhw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_04,2026-02-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 bulkscore=0 priorityscore=1501 spamscore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050130 Content-Type: text/plain; charset="utf-8" Start the graph at trigger callback. Staring the graph at prepare does not make sense as there is no data transfer at this point. Moving this to trigger will also helps fix some of the issues seen with pipewire and display port. This should also fix some of the Qualcomm DP cod= ec issues discussed at https://lkml.org/lkml/2025/5/29/102 CC: Dmitry Baryshkov Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 39 +++++++++++++++++-------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6= /q6apm-lpass-dais.c index fc246485e326..21624a2803a6 100644 --- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c @@ -159,6 +159,30 @@ static void q6apm_lpass_dai_shutdown(struct snd_pcm_su= bstream *substream, struct } } =20 +static int q6apm_lpass_dai_trigger(struct snd_pcm_substream *substream, in= t cmd, struct snd_soc_dai *dai) +{ + struct q6apm_lpass_dai_data *dai_data =3D dev_get_drvdata(dai->dev); + int ret =3D 0; + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + if (!dai_data->is_port_started[dai->id]) { + ret =3D q6apm_graph_start(dai_data->graph[dai->id]); + if (ret < 0) + dev_err(dai->dev, "Failed to start APM port %d\n", dai->id); + else + dai_data->is_port_started[dai->id] =3D true; + } + break; + default: + break; + } + + return ret; +} + static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, st= ruct snd_soc_dai *dai) { struct q6apm_lpass_dai_data *dai_data =3D dev_get_drvdata(dai->dev); @@ -171,10 +195,6 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_subs= tream *substream, struct s q6apm_graph_stop(dai_data->graph[dai->id]); dai_data->is_port_started[dai->id] =3D false; =20 - if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK) { - q6apm_graph_close(dai_data->graph[dai->id]); - dai_data->graph[dai->id] =3D NULL; - } } =20 /** @@ -203,14 +223,6 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_subs= tream *substream, struct s dev_err(dai->dev, "Failed to prepare Graph %d\n", rc); goto err; } - - rc =3D q6apm_graph_start(dai_data->graph[dai->id]); - if (rc < 0) { - dev_err(dai->dev, "Failed to start APM port %d\n", dai->id); - goto err; - } - dai_data->is_port_started[dai->id] =3D true; - return 0; err: if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK) { @@ -254,6 +266,7 @@ static const struct snd_soc_dai_ops q6dma_ops =3D { .shutdown =3D q6apm_lpass_dai_shutdown, .set_channel_map =3D q6dma_set_channel_map, .hw_params =3D q6dma_hw_params, + .trigger =3D q6apm_lpass_dai_trigger, }; =20 static const struct snd_soc_dai_ops q6i2s_ops =3D { @@ -263,6 +276,7 @@ static const struct snd_soc_dai_ops q6i2s_ops =3D { .set_channel_map =3D q6dma_set_channel_map, .hw_params =3D q6dma_hw_params, .set_fmt =3D q6i2s_set_fmt, + .trigger =3D q6apm_lpass_dai_trigger, }; =20 static const struct snd_soc_dai_ops q6hdmi_ops =3D { @@ -271,6 +285,7 @@ static const struct snd_soc_dai_ops q6hdmi_ops =3D { .shutdown =3D q6apm_lpass_dai_shutdown, .hw_params =3D q6hdmi_hw_params, .set_fmt =3D q6i2s_set_fmt, + .trigger =3D q6apm_lpass_dai_trigger, }; =20 static const struct snd_soc_component_driver q6apm_lpass_dai_component =3D= { --=20 2.47.3 From nobody Sun Feb 8 19:24:41 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 707B543DA38 for ; Thu, 5 Feb 2026 17:14:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311670; cv=none; b=SjQpNZunqo9PY9QihD2ClAEN5Jm1sXiaS27lUxQfXnuVPcmdV01+olnnVRPIEvpcONVAsAwZQw+MEDiWwhuudBZ2ybm3HgubXDfqTnFHpwxI4tRQJrqACoasbt5tO/gYWS6rpnXZIIWXSm38oGZyMFQx4KgMvBBa6hOZr41d21k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311670; c=relaxed/simple; bh=1o79ow1bIiOv5CRwM/ZPHhJrp0A3v74qMbYwG0K9OoQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oXtVKr+kY6BRa1In+YUpSDx6ipNz0G2DJiW8LYFpY6/qNS3VnjivWlr9g4C9wAJlxeozG+e6iC/YPFh0EbYIw+eVLIXxYBQ2uogrnhGJPFHySRoH3yM/DpPRnib9MO26ioxQFT6CD8Klmy2dqJ3GUX+6WXVKtf2xy53/r8Zp5YY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=NL7Bf4zg; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=IcWHohMF; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="NL7Bf4zg"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="IcWHohMF" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 615F7fLB2945186 for ; Thu, 5 Feb 2026 17:14:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=fPI1A9ucPaM cjLIVgjdmicQQNCHcfLusgVWrHdAui+Y=; b=NL7Bf4zgPthI4xf7aaJE+w05KbJ a2iV5pS3NzXYpHumzJ/olqZ6T4GPgLtF7QN8XS0UIJPPnVieyzYVZB/V5Y18s8CT xw3ONXMwyhl4/LOabidCkAqmcM/mKJVeYb5e5JZIJQ5X5pOkkov1Q3MNpLJNwxkx ki5gaFTTwIJKtuqZPdabDbDnxLxrA1m2mHjd7PGlgOAgKLEZ6m9OWsX8PAP9ktwE moQaZDGzUyblNOnRt49Nqq/BlgjMsULnkawZegzQ85MotAH1sNVMKcMojgFnU38+ Veg+8bfGR6/no35icUVXgKd35EmIe7ehSHuNp6PlQgA+CMBztv0Ey+x89Pw== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4q55srs3-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 17:14:29 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c70ab7f67fso481684385a.3 for ; Thu, 05 Feb 2026 09:14:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770311669; x=1770916469; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fPI1A9ucPaMcjLIVgjdmicQQNCHcfLusgVWrHdAui+Y=; b=IcWHohMFotV+7z0CYg9VbNb/dotm3VLbCf3FxLlToQSzR+xTmiTWFZax0oJQn4WkO9 CoERCILqAsQxxDXfUgHBERuSYNW2xZboASDQ/afxBDMkQoj8tkD3uRIzXgshIZBfhZ6q jTRzu/UM5P+YtybSxHDt0OUoLYeT36oCYOOaEchJ9xSBIEPDCGDm/EZ/iG22k2RG9C5n eyQDBj86gfpLQZcRrBLkBxdpUV7pZXYxBYqLn87/A6WdDBmjo//bUsFaOXGl627HH6Vc cZSgHpcy/BeISa8CdBT7Pj5IIKcqoR8MxeQb18H/GJJBsOivQJ8FaoN0IgJWGsta/vb/ 3PtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770311669; x=1770916469; h=content-transfer-encoding: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; bh=fPI1A9ucPaMcjLIVgjdmicQQNCHcfLusgVWrHdAui+Y=; b=P1+tI9K/OTj3mbus4f382GfeTer2jYEbzxLIGnmAyh3+QTsKfm++B+8dLL8OzCOjXo J6VvUWAaJQpixpu9ZGhmNCPLdsmGtwwN8kG/bhtihQNTfeCiJVIt7b4HcVRW7Vsu9Icg 1nEypcx6wkrLBTzBSETasLBX4MWTuI0B1DlvQWSzITLxUMDVARQOtt3+4NNN1EV/bp1f ZfN9gMCtQvoVoMgppVTtJq8YsFoSEBn5iXlzBWQ14/l3USMsPjMdbKpXKVRGxb4h/aUl 1ynlwX9vGjWWnbI0IYT9ZIE+dZar++bRZ8aCZDc+t/9B5DfabURb9GHnLn62Ajvic7/o Xd0w== X-Forwarded-Encrypted: i=1; AJvYcCWaK/N2aNNC3IvmOTVxTSgXn8/uRFiqewpJPNRYP73e5YaJsD87dnjGPsdXSKj+JSvvke+cjY5rV5QeRNE=@vger.kernel.org X-Gm-Message-State: AOJu0YzLS+vhvqZF7Rm8KRfz8HCy6RN91q1tEGr9qtsxplL1VBOck1b9 gXQD5kidwdUj/xdDyrU6hfCPxwfKFmqaD0hBm1fO0OSh51xp4csoIJfghgPc0aeyFrR9iIZcYtn qLwJm4X+zukcJZVim/uf1PrSP2l85WMQTUXqphjmAnrgb+9v8aIaIebfUoinFk8ADGi8= X-Gm-Gg: AZuq6aIwUdDL1LMLcmChm3sQUzKghxa/GbyRzKTbRWHH08BZWrnY3IgXf1/c7z/u4L4 a2UW/+M+QM1YuP3N2zKYRATWxOvNiWjjjj5SkIC5NOSTpWpzz7anKX2E+bUVTOie62q0HovphU5 mYHC9E1oDHOzmR2i26Q99mdNSnp3k0oDXvMHcDb0MewthSWETP+OhQ6+1VWaWojlE2pxz+Ylani Ow1TJ28gN+sYTA1ysUFkpsmkca1Ot5IuAdlInOZyb8/79OFBTfO1hGHUu2vkafy87Vs38owHIpN L3oUSo4PzqAof0TCMo3unQq7U2xSJ6z/CcMl/S1EJxWIBahKWwUI8/EoCq+iDnw/vY2vbKZp5SG DqQOTsnZGnImnCiGbdj1dTreLPWGPz2VxXhVIcsHtTRc= X-Received: by 2002:a05:620a:4056:b0:8ca:3c67:891c with SMTP id af79cd13be357-8ca3c679845mr595857685a.71.1770311668593; Thu, 05 Feb 2026 09:14:28 -0800 (PST) X-Received: by 2002:a05:620a:4056:b0:8ca:3c67:891c with SMTP id af79cd13be357-8ca3c679845mr595850485a.71.1770311667932; Thu, 05 Feb 2026 09:14:27 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm14802849f8f.21.2026.02.05.09.14.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 09:14:27 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, cnor+dt@kernel.org, srini@kernel.org, perex@perex.cz, tiwai@suse.com, alexey.klimov@linaro.org, mohammad.rafi.shaik@oss.qualcomm.com, quic_wcheng@quicinc.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 09/10] ASoC: qcom: qdsp6: remove search for module iid in hot path Date: Thu, 5 Feb 2026 12:14:10 -0500 Message-ID: <20260205171411.34908-10-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDEzMCBTYWx0ZWRfX12DLfJHWDJ8y TL3+oQ2YjL4SkkrTqpBlV1XUdTxo5wLnG17SLvOG1h8TIL9SAXciUSp3QIPt4fng6wSSqbbTCIn OFz0HwJ3Nj99QQRu6lz17HST3WfKMQY+q5jPGKMo+FEkpGc5BolvxYPRDaiRpZq2v5ckPAmdwQa GZZBc//K3o/PzA4rEiwaTHsBoAO1isBcwgmJofC78vv1tkwAgOi4UHv5xE0Kwe1lK6CCouG7MbG w+g83NWd38ixZGfoEbnYo3YmuqAsAY9W/axrENWw1olIc+7G1u/+SsJyLdZnFBzQ6BQu1ICgpDY 7Rn/XVo3srfFzOk2qBnoRiQgfx9fPa8oF4g5sDD1cJ98oFKpSVhkin3iF5wvgupJvTPu5RspAwW Im/QqnP9yf1t70EEOKYW+fywUVBo5juUcugZFqrU2FmXjmu3JkMmzOdSMfO01rI7kGYZGPpE/wR iTL9P5XNkgzEeijz3WA== X-Proofpoint-ORIG-GUID: ShkV_OvoCIwmpCG8wFFKmgAVRVZYLwKm X-Proofpoint-GUID: ShkV_OvoCIwmpCG8wFFKmgAVRVZYLwKm X-Authority-Analysis: v=2.4 cv=Z6zh3XRA c=1 sm=1 tr=0 ts=6984cff5 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=Ll4dbTg5roZnn8cDlSAA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_04,2026-02-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050130 Content-Type: text/plain; charset="utf-8" Remove searching for Shared Memory module instance id on every read/write call, this is ineffecient and becomes un-necessary if we can cache the shared memory module instance id per PCM graph. Add new member to graph struct to store sharedmemory module instance id to avoid searching for this in hot path. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6apm-dai.c | 5 +++-- sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 4 ++-- sound/soc/qcom/qdsp6/q6apm.c | 14 +++++++++----- sound/soc/qcom/qdsp6/q6apm.h | 3 ++- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-= dai.c index 87e4474d680a..94066b69b5b5 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -355,7 +355,7 @@ static int q6apm_dai_open(struct snd_soc_component *com= ponent, =20 spin_lock_init(&prtd->lock); prtd->substream =3D substream; - prtd->graph =3D q6apm_graph_open(dev, event_handler, prtd, graph_id); + prtd->graph =3D q6apm_graph_open(dev, event_handler, prtd, graph_id, subs= tream->stream); if (IS_ERR(prtd->graph)) { dev_err(dev, "%s: Could not allocate memory\n", __func__); ret =3D PTR_ERR(prtd->graph); @@ -496,7 +496,8 @@ static int q6apm_dai_compr_open(struct snd_soc_componen= t *component, return -ENOMEM; =20 prtd->cstream =3D stream; - prtd->graph =3D q6apm_graph_open(dev, event_handler_compr, prtd, graph_id= ); + prtd->graph =3D q6apm_graph_open(dev, event_handler_compr, prtd, graph_id, + SNDRV_PCM_STREAM_PLAYBACK); if (IS_ERR(prtd->graph)) { ret =3D PTR_ERR(prtd->graph); kfree(prtd); diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6= /q6apm-lpass-dais.c index 21624a2803a6..569ba1991992 100644 --- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c @@ -202,7 +202,7 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_subst= ream *substream, struct s * graph, so sequence for playback and capture will be different */ if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK && dai_data->graph= [dai->id] =3D=3D NULL) { - graph =3D q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id); + graph =3D q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id, substream= ->stream); if (IS_ERR(graph)) { dev_err(dai->dev, "Failed to open graph (%d)\n", graph_id); rc =3D PTR_ERR(graph); @@ -239,7 +239,7 @@ static int q6apm_lpass_dai_startup(struct snd_pcm_subst= ream *substream, struct s int graph_id =3D dai->id; =20 if (substream->stream =3D=3D SNDRV_PCM_STREAM_CAPTURE) { - graph =3D q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id); + graph =3D q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id, substream= ->stream); if (IS_ERR(graph)) { dev_err(dai->dev, "Failed to open graph (%d)\n", graph_id); return PTR_ERR(graph); diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 2cfebd622be2..282ba22938e7 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -411,12 +411,11 @@ int q6apm_write_async(struct q6apm_graph *graph, uint= 32_t len, uint32_t msw_ts, { struct apm_data_cmd_wr_sh_mem_ep_data_buffer_v2 *write_buffer; struct audio_buffer *ab; - int iid =3D q6apm_graph_get_rx_shmem_module_iid(graph); =20 struct gpr_pkt *pkt __free(kfree) =3D audioreach_alloc_pkt(sizeof(*write_= buffer), DATA_CMD_WR_SH_MEM_EP_DATA_BUFFER_V2, graph->rx_data.dsp_buf | (len << APM_WRITE_TOKEN_LEN_SHIFT), - graph->port->id, iid); + graph->port->id, graph->shm_iid); if (IS_ERR(pkt)) return PTR_ERR(pkt); =20 @@ -449,11 +448,10 @@ int q6apm_read(struct q6apm_graph *graph) struct data_cmd_rd_sh_mem_ep_data_buffer_v2 *read_buffer; struct audioreach_graph_data *port; struct audio_buffer *ab; - int iid =3D q6apm_graph_get_tx_shmem_module_iid(graph); =20 struct gpr_pkt *pkt __free(kfree) =3D audioreach_alloc_pkt(sizeof(*read_b= uffer), DATA_CMD_RD_SH_MEM_EP_DATA_BUFFER_V2, - graph->tx_data.dsp_buf, graph->port->id, iid); + graph->tx_data.dsp_buf, graph->port->id, graph->shm_iid); if (IS_ERR(pkt)) return PTR_ERR(pkt); =20 @@ -604,7 +602,7 @@ static int graph_callback(const struct gpr_resp_pkt *da= ta, void *priv, int op) } =20 struct q6apm_graph *q6apm_graph_open(struct device *dev, q6apm_cb cb, - void *priv, int graph_id) + void *priv, int graph_id, int dir) { struct q6apm *apm =3D dev_get_drvdata(dev->parent); struct audioreach_graph *ar_graph; @@ -631,6 +629,12 @@ struct q6apm_graph *q6apm_graph_open(struct device *de= v, q6apm_cb cb, graph->id =3D ar_graph->id; graph->dev =3D dev; =20 + if (dir =3D=3D SNDRV_PCM_STREAM_PLAYBACK) + graph->shm_iid =3D q6apm_graph_get_rx_shmem_module_iid(graph); + else + graph->shm_iid =3D q6apm_graph_get_tx_shmem_module_iid(graph); + + mutex_init(&graph->lock); init_waitqueue_head(&graph->cmd_wait); =20 diff --git a/sound/soc/qcom/qdsp6/q6apm.h b/sound/soc/qcom/qdsp6/q6apm.h index 189ed8a1a60d..19e223635edf 100644 --- a/sound/soc/qcom/qdsp6/q6apm.h +++ b/sound/soc/qcom/qdsp6/q6apm.h @@ -98,6 +98,7 @@ struct q6apm_graph { void *priv; q6apm_cb cb; uint32_t id; + uint32_t shm_iid; struct device *dev; struct q6apm *apm; gpr_port_t *port; @@ -112,7 +113,7 @@ struct q6apm_graph { =20 /* Graph Operations */ struct q6apm_graph *q6apm_graph_open(struct device *dev, q6apm_cb cb, - void *priv, int graph_id); + void *priv, int graph_id, int dir); int q6apm_graph_close(struct q6apm_graph *graph); int q6apm_graph_prepare(struct q6apm_graph *graph); int q6apm_graph_start(struct q6apm_graph *graph); --=20 2.47.3 From nobody Sun Feb 8 19:24:41 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7475743D500 for ; Thu, 5 Feb 2026 17:14:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311672; cv=none; b=G9reslZ6Ht/eg/D9j3uNztNBGPIQERBZKiM7oAqi/SXd/gEdLhhfbyKMzHrEAASGG8iuR1OchuPrbdr823KNs7NAnNYENeDklHpCr0l7KdgoAqbOaOH4flcoL6PgtSpu54xyLpp0R93ZYeS+AQNgbWk6quPgVDerRNMdGuiIQNs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311672; c=relaxed/simple; bh=vuRX+W1q3fyWlPl+Qsrbnh5CxCX5l6c/vEM8mN6V/20=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ex3vuBxeKizF6Yrr9NuifJIAte+0xr4V9CmpCEBPCQbzTzOaUA4gyK0a18yjYMWPaj6CjSJrobaTW3GEDEsZAq6wMhUG0eBfW2wZZrUGyOScH3wdAffHZgI2B+bua+DK/6Q9H2XELKgyFz6Y6fL3YxwxVdvENoXZL/YRhB3LrJY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=NCREUsYv; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=B989dFO4; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="NCREUsYv"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="B989dFO4" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 615CU4YN3047953 for ; Thu, 5 Feb 2026 17:14:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=Y56whS/w1wg 0ftrGnAYvb5bPQHNA0WkHm66yq2qgP18=; b=NCREUsYv9ISnBgx4lXH8wmKGl3z jGFxwb+Pnc0DIiNMuxylT/5Ya9A/e56xFz2Req5Brn6IPZSuytxGCVlmdUg253ud PTZYkVIln23VamJJzbt0cTTf6wu6pSmKYES3+15tLIL0YXIhNAM1ddlLHzR2xck6 VODGBS2HKdfqSlRkSIRz+BO3ZDNfcnwxK6KaHWqsF42HNDoQT17s3aMWh61lWmVP b6fD3v2zDeHwTcTmqWSf99GN7txrR/rRBAWUzVil4mDzZ1XtIoPmbivMsbEpydnf vvIH+DGsss6F0xwcduUfR60JKn3degQBEIsllmhIpdq/bzTM0Mqfe2UxApw== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4mrtj7nd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 17:14:31 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8c71500f274so140653585a.1 for ; Thu, 05 Feb 2026 09:14:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770311671; x=1770916471; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y56whS/w1wg0ftrGnAYvb5bPQHNA0WkHm66yq2qgP18=; b=B989dFO4WnaoCoTW73oUCHacMF86R/OzP/p7c1I/NbBSUh5TncqaQaazoqdMZGDj0a YvwSWJSfrBURMwcQzHCVg/SJ0xIC6bnYxdKH0FqaRGJXUeZnU6rOdpOM7DKCSpyZ2//n mrbqZ3j/2zoyIaqrstfdLM4kt7BPTlpsh0mwMSLbwbp18QTn8SMDU/W550ZDllBoCZSJ 77Eu5AkLnOmI7oPb+mers2TEu4ZOqCh0jNeGVCwmntHAbLwmSTj2hRRVSKmz7yoWvqqy HV23SXv6V3qXlW/VrtVZur5RB87VQ9N0NBys8zRraGo+kgoAqLJQPKD9cSKZs58e9kn6 3kLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770311671; x=1770916471; h=content-transfer-encoding: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; bh=Y56whS/w1wg0ftrGnAYvb5bPQHNA0WkHm66yq2qgP18=; b=RQ5yPHGMP6pAVU/8O2iMPnreMPyIPBrt0ET8B7rn0YLHNhtgv2vqMy/wtgkdMXlEFB JpQlBNOlIfkE9/b0Ads1faJMD+on2aEgAyGBbLNj3lhAMHdghGUi6Vpq8lVd45k9mDeA 455tA2JxubGl/EmwFstS3PPYgLX5QC3BHlK6IezEzsoAh3lv5DDSDx91ildgBQx/lDZ0 UyfPMgidX0qh+lr7wac6H7t5Bj9OAN2XCFgqVa/NoJ/FL6lKZCUH3pN/BmifUgh5r3xw urC6OueKJxy4eBDjdZrwFhMD9kup7EZ9n1FcCZsahZfNie6rZzcMfIrOUisd39JT/5OL WOjw== X-Forwarded-Encrypted: i=1; AJvYcCVq5kGJ+xA1F+dG2ZLbooWqvFDd7hKzZkm28N5pkQRv5u8fpQk3YGcafQZE0x1pcnvRXdaOSPJOSsyWDg4=@vger.kernel.org X-Gm-Message-State: AOJu0YwnaoRL73qIzTg7jLt63hjalSZrMrGnbBZD1KD3lTHy129QS8q0 B9VpHE24bxS8yP89xzj9opESVRrWDVRsDvrs2+G1SQSvDRJErjHDVbY9cgX9TPllgZSpMzstraa dCiJIa+RfEMyXkwBUty3EqEOKUL7LAix9FJb8osUZdXCYYDFA+MTnve+B6wndqeSfPqY= X-Gm-Gg: AZuq6aJpXesceZPAR+qzHwLm1gF7MRjWb4g26xvghroZHOeYv1tzCmkip7ZxNB8+hDv 9A2EhdczYxuAvqU/qckFuYvdApWUrSYwZ9yGNs3o2OuWlYcQrflgzRLVTdhdiVQg3dqgaHzSP78 e0F/kEE1k1SXD6HYQ3wzmOYaUSAvFFcK1i7BGrFhHJa8Ybp+pB8TymYZocJznOdHbYbG7KE9ya9 gKfPi3UlWlvGlJ5jPeM7THZEGCcc5EUkNms92bcoRTqqIuwFILYCsXUyujFhqSDqULzniFe1IlA ab4Ritgp0C/yI84ZIC38lvwG9WkaZskP3pAfPV/bVmrt7qGMIjEoTbO/e/JU8Mmfy9ipNPSC5xY 5glK2PrFOmthqmNZErzD8YKWQP5Lzx64XOzUTA266Q6Y= X-Received: by 2002:a05:620a:4720:b0:8ca:2cf9:81a3 with SMTP id af79cd13be357-8ca2f868aa7mr897622285a.40.1770311670395; Thu, 05 Feb 2026 09:14:30 -0800 (PST) X-Received: by 2002:a05:620a:4720:b0:8ca:2cf9:81a3 with SMTP id af79cd13be357-8ca2f868aa7mr897615485a.40.1770311669785; Thu, 05 Feb 2026 09:14:29 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm14802849f8f.21.2026.02.05.09.14.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 09:14:29 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, cnor+dt@kernel.org, srini@kernel.org, perex@perex.cz, tiwai@suse.com, alexey.klimov@linaro.org, mohammad.rafi.shaik@oss.qualcomm.com, quic_wcheng@quicinc.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 10/10] ASoC: qcom: q6apm: Add support for early buffer mapping on DSP Date: Thu, 5 Feb 2026 12:14:11 -0500 Message-ID: <20260205171411.34908-11-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDEzMCBTYWx0ZWRfXwnwySzuZZhCK D7J6YEtyerbe0gwaEcdPrUglHEhcfXRGBPFkwzVO3kCTFgmyABUMEstRSuFlpwdJWEEro/fY/5a w1Cwa7tYiopd8EjsVcOOmEpxuNg5P7//MhURepEoy/bEACHEdpHjN0V9wUVWe2wJzL5+QIEYuo/ n4HPbZ8eetnauLexrAZSP/CBpJPsAGrT1R7x2HCFoKjT+97OvlA9U/x5+OoJzmlRuB59RcI06if aIOsIOZcVMut7skvEtIDl/fWo0RmTvRYqK8pRiDifm35gY7BU/7Sq1u/ulvDu69t+dBzVcvzg+4 d1OVmojrLwKgruyXjoaGNX3mrK9Bq4BHC0z10ZZENAXOuYSCBK350yMm2j5Rq5L8OKk1O1nPOeQ CSSVxAoPbayrHyfTQuJzwBv3KZ2toAL+F7TWwnYWLp2+8dCfy96Pe6zdVN96xR3m8zXdao3V9zY MaxpLOU68c1TykxT1Gw== X-Proofpoint-ORIG-GUID: mZJlNtcSskHqjrLwN6Mw5ja4FXSiJvkQ X-Authority-Analysis: v=2.4 cv=UoBu9uwB c=1 sm=1 tr=0 ts=6984cff7 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=5FlrmoDGYMl1lO3QxRMA:9 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-GUID: mZJlNtcSskHqjrLwN6Mw5ja4FXSiJvkQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_04,2026-02-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 suspectscore=0 bulkscore=0 adultscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050130 Content-Type: text/plain; charset="utf-8" Buffers are allocated on pcm_new and mapped in the dsp on every prepare cal= l, which is inefficient and unnecessary. Improve this situation by adding adding a functions q6apm_[un]map_memory_fixed_region to map it on to dsp only once after allocation. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/audioreach.c | 60 ----------- sound/soc/qcom/qdsp6/audioreach.h | 5 +- sound/soc/qcom/qdsp6/q6apm-dai.c | 99 ++++++++++++++++--- sound/soc/qcom/qdsp6/q6apm.c | 159 ++++++++++++++++++++---------- sound/soc/qcom/qdsp6/q6apm.h | 15 ++- 5 files changed, 208 insertions(+), 130 deletions(-) diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audio= reach.c index 241c3b4479c6..b2975eebab71 100644 --- a/sound/soc/qcom/qdsp6/audioreach.c +++ b/sound/soc/qcom/qdsp6/audioreach.c @@ -1396,66 +1396,6 @@ void audioreach_graph_free_buf(struct q6apm_graph *g= raph) } EXPORT_SYMBOL_GPL(audioreach_graph_free_buf); =20 -int audioreach_map_memory_regions(struct q6apm_graph *graph, unsigned int = dir, size_t period_sz, - unsigned int periods, bool is_contiguous) -{ - struct apm_shared_map_region_payload *mregions; - struct apm_cmd_shared_mem_map_regions *cmd; - uint32_t num_regions, buf_sz, payload_size; - struct audioreach_graph_data *data; - struct gpr_pkt *pkt __free(kfree) =3D NULL; - void *p; - int i; - - if (dir =3D=3D SNDRV_PCM_STREAM_PLAYBACK) - data =3D &graph->rx_data; - else - data =3D &graph->tx_data; - - if (is_contiguous) { - num_regions =3D 1; - buf_sz =3D period_sz * periods; - } else { - buf_sz =3D period_sz; - num_regions =3D periods; - } - - /* DSP expects size should be aligned to 4K */ - buf_sz =3D ALIGN(buf_sz, 4096); - - payload_size =3D sizeof(*cmd) + (sizeof(*mregions) * num_regions); - - pkt =3D audioreach_alloc_apm_pkt(payload_size, APM_CMD_SHARED_MEM_MAP_REG= IONS, dir, - graph->port->id); - if (IS_ERR(pkt)) - return PTR_ERR(pkt); - - p =3D (void *)pkt + GPR_HDR_SIZE; - cmd =3D p; - cmd->mem_pool_id =3D APM_MEMORY_MAP_SHMEM8_4K_POOL; - cmd->num_regions =3D num_regions; - - cmd->property_flag =3D 0x0; - - mregions =3D p + sizeof(*cmd); - - mutex_lock(&graph->lock); - - for (i =3D 0; i < num_regions; i++) { - struct audio_buffer *ab; - - ab =3D &data->buf[i]; - mregions->shm_addr_lsw =3D lower_32_bits(ab->phys); - mregions->shm_addr_msw =3D upper_32_bits(ab->phys); - mregions->mem_size_bytes =3D buf_sz; - ++mregions; - } - mutex_unlock(&graph->lock); - - return audioreach_graph_send_cmd_sync(graph, pkt, APM_CMD_RSP_SHARED_MEM_= MAP_REGIONS); -} -EXPORT_SYMBOL_GPL(audioreach_map_memory_regions); - int audioreach_shared_memory_send_eos(struct q6apm_graph *graph) { struct data_cmd_wr_sh_mem_ep_eos *eos; diff --git a/sound/soc/qcom/qdsp6/audioreach.h b/sound/soc/qcom/qdsp6/audio= reach.h index 89f172aab8c0..6ddc287f0fb4 100644 --- a/sound/soc/qcom/qdsp6/audioreach.h +++ b/sound/soc/qcom/qdsp6/audioreach.h @@ -722,6 +722,7 @@ struct audioreach_connection { =20 struct audioreach_graph_info { int id; + uint32_t mem_map_handle; uint32_t num_sub_graphs; struct list_head sg_list; /* DPCM connection from FE Graph to BE graph */ @@ -838,10 +839,6 @@ int audioreach_tplg_init(struct snd_soc_component *com= ponent); =20 /* Module specific */ void audioreach_graph_free_buf(struct q6apm_graph *graph); -int audioreach_map_memory_regions(struct q6apm_graph *graph, - unsigned int dir, size_t period_sz, - unsigned int periods, - bool is_contiguous); int audioreach_send_cmd_sync(struct device *dev, gpr_device_t *gdev, struc= t gpr_ibasic_rsp_result_t *result, struct mutex *cmd_lock, gpr_port_t *port, wait_queue_head_t *cmd_w= ait, struct gpr_pkt *pkt, uint32_t rsp_opcode); diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-= dai.c index 94066b69b5b5..35ec05fa90bc 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -228,11 +228,10 @@ static int q6apm_dai_prepare(struct snd_soc_component= *component, cfg.bit_width =3D prtd->bits_per_sample; cfg.fmt =3D SND_AUDIOCODEC_PCM; audioreach_set_default_channel_mapping(cfg.channel_map, runtime->channels= ); - if (prtd->state) { /* clear the previous setup if any */ q6apm_graph_stop(prtd->graph); - q6apm_unmap_memory_regions(prtd->graph, substream->stream); + q6apm_free_fragments(prtd->graph, substream->stream); } =20 prtd->pcm_count =3D snd_pcm_lib_period_bytes(substream); @@ -247,8 +246,8 @@ static int q6apm_dai_prepare(struct snd_soc_component *= component, if (ret < 0) dev_err(dev, "%s: CMD Format block failed\n", __func__); =20 - ret =3D q6apm_map_memory_regions(prtd->graph, substream->stream, prtd->ph= ys, - (prtd->pcm_size / prtd->periods), prtd->periods); + ret =3D q6apm_alloc_fragments(prtd->graph, substream->stream, prtd->phys, + (prtd->pcm_size / prtd->periods), prtd->periods); =20 if (ret < 0) { dev_err(dev, "Audio Start: Buffer Allocation failed rc =3D %d\n", ret); @@ -403,6 +402,12 @@ static int q6apm_dai_open(struct snd_soc_component *co= mponent, else prtd->phys =3D substream->dma_buffer.addr | (pdata->sid << 32); =20 + ret =3D q6apm_set_memory_map_handle(prtd->graph, substream->stream); + if (ret < 0) { + dev_err(dev, "Audio Start: Buffer Allocation failed rc =3D %d\n", ret); + goto err; + } + return 0; err: kfree(prtd); @@ -416,9 +421,10 @@ static int q6apm_dai_close(struct snd_soc_component *c= omponent, struct snd_pcm_runtime *runtime =3D substream->runtime; struct q6apm_dai_rtd *prtd =3D runtime->private_data; =20 - if (prtd->state) { /* only stop graph that is started */ + if (prtd->state) { + /* only stop graph that is started */ q6apm_graph_stop(prtd->graph); - q6apm_unmap_memory_regions(prtd->graph, substream->stream); + q6apm_free_fragments(prtd->graph, substream->stream); } =20 q6apm_graph_close(prtd->graph); @@ -467,11 +473,80 @@ static int q6apm_dai_hw_params(struct snd_soc_compone= nt *component, return 0; } =20 +static int q6apm_dai_memory_map(struct snd_soc_component *component, + struct snd_pcm_substream *substream, int graph_id) +{ + struct q6apm_dai_data *pdata; + struct device *dev =3D component->dev; + phys_addr_t phys; + int ret; + + pdata =3D snd_soc_component_get_drvdata(component); + if (!pdata) { + dev_err(component->dev, "Drv data not found ..\n"); + return -EINVAL; + } + + if (pdata->sid < 0) + phys =3D substream->dma_buffer.addr; + else + phys =3D substream->dma_buffer.addr | (pdata->sid << 32); + + ret =3D q6apm_map_memory_fixed_region(dev, graph_id, phys, BUFFER_BYTES_M= AX); + if (ret < 0) + dev_err(dev, "Audio Start: Buffer Allocation failed rc =3D %d\n", ret); + + return ret; +} + static int q6apm_dai_pcm_new(struct snd_soc_component *component, struct s= nd_soc_pcm_runtime *rtd) { + struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); + struct snd_pcm *pcm =3D rtd->pcm; int size =3D BUFFER_BYTES_MAX; + int graph_id, ret; + struct snd_pcm_substream *substream; + + graph_id =3D cpu_dai->driver->id; + + ret =3D snd_pcm_set_fixed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, component->= dev, size); + if (ret) + return ret; + + if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { + substream =3D pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; + ret =3D q6apm_dai_memory_map(component, substream, graph_id); + if (ret) + return ret; + } + + if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { + substream =3D pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; + q6apm_dai_memory_map(component, substream, graph_id); + if (ret) + return ret; + } =20 - return snd_pcm_set_fixed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, compone= nt->dev, size); + return 0; +} + +static void q6apm_dai_pcm_destruct(struct snd_soc_component *component, st= ruct snd_pcm *pcm) +{ + struct snd_pcm_substream *substream; + struct snd_soc_pcm_runtime *soc_prtd; + struct snd_soc_dai *cpu_dai; + int graph_id; + + if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) + substream =3D pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; + else + substream =3D pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; + + soc_prtd =3D snd_soc_substream_to_rtd(substream); + cpu_dai =3D snd_soc_rtd_to_cpu(soc_prtd, 0); + + graph_id =3D cpu_dai->driver->id; + q6apm_unmap_memory_fixed_region(component->dev, graph_id); } =20 static int q6apm_dai_compr_open(struct snd_soc_component *component, @@ -530,7 +605,8 @@ static int q6apm_dai_compr_free(struct snd_soc_componen= t *component, struct q6apm_dai_rtd *prtd =3D runtime->private_data; =20 q6apm_graph_stop(prtd->graph); - q6apm_unmap_memory_regions(prtd->graph, SNDRV_PCM_STREAM_PLAYBACK); + q6apm_free_fragments(prtd->graph, SNDRV_PCM_STREAM_PLAYBACK); + q6apm_unmap_memory_fixed_region(component->dev, prtd->graph->id); q6apm_graph_close(prtd->graph); snd_dma_free_pages(&prtd->dma_buffer); prtd->graph =3D NULL; @@ -679,9 +755,9 @@ static int q6apm_dai_compr_set_params(struct snd_soc_co= mponent *component, if (ret) return ret; =20 - ret =3D q6apm_map_memory_regions(prtd->graph, SNDRV_PCM_STREAM_PLAYBACK, - prtd->phys, (prtd->pcm_size / prtd->periods), - prtd->periods); + ret =3D q6apm_alloc_fragments(prtd->graph, SNDRV_PCM_STREAM_PLAYBACK, + prtd->phys, (prtd->pcm_size / prtd->periods), + prtd->periods); if (ret < 0) return -ENOMEM; =20 @@ -834,6 +910,7 @@ static const struct snd_soc_component_driver q6apm_fe_d= ai_component =3D { .close =3D q6apm_dai_close, .prepare =3D q6apm_dai_prepare, .pcm_construct =3D q6apm_dai_pcm_new, + .pcm_destruct =3D q6apm_dai_pcm_destruct, .hw_params =3D q6apm_dai_hw_params, .pointer =3D q6apm_dai_pointer, .trigger =3D q6apm_dai_trigger, diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 282ba22938e7..7b5f76955cae 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -200,13 +200,61 @@ int q6apm_graph_media_format_shmem(struct q6apm_graph= *graph, } EXPORT_SYMBOL_GPL(q6apm_graph_media_format_shmem); =20 -int q6apm_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, = phys_addr_t phys, - size_t period_sz, unsigned int periods) +int q6apm_set_memory_map_handle(struct q6apm_graph *graph, unsigned int di= r) +{ + if (dir =3D=3D SNDRV_PCM_STREAM_PLAYBACK) + graph->rx_data.mem_map_handle =3D graph->info->mem_map_handle; + else + graph->tx_data.mem_map_handle =3D graph->info->mem_map_handle; + + return 0; +} +EXPORT_SYMBOL_GPL(q6apm_set_memory_map_handle); + +int q6apm_map_memory_fixed_region(struct device *dev, unsigned int graph_i= d, phys_addr_t phys, + size_t sz) +{ + struct audioreach_graph_info *info; + struct q6apm *apm =3D dev_get_drvdata(dev->parent); + struct apm_shared_map_region_payload *mregions; + struct apm_cmd_shared_mem_map_regions *cmd; + int payload_size =3D sizeof(*cmd) + (sizeof(*mregions)); + uint32_t buf_sz; + void *p; + struct gpr_pkt *pkt __free(kfree) =3D audioreach_alloc_apm_cmd_pkt(payloa= d_size, + APM_CMD_SHARED_MEM_MAP_REGIONS, graph_id); + if (IS_ERR(pkt)) + return PTR_ERR(pkt); + + info =3D idr_find(&apm->graph_info_idr, graph_id); + if (!info) + return -ENODEV; + + /* DSP expects size should be aligned to 4K */ + buf_sz =3D ALIGN(sz, 4096); + + p =3D (void *)pkt + GPR_HDR_SIZE; + cmd =3D p; + cmd->mem_pool_id =3D APM_MEMORY_MAP_SHMEM8_4K_POOL; + cmd->num_regions =3D 1; + cmd->property_flag =3D 0x0; + + mregions =3D p + sizeof(*cmd); + + mregions->shm_addr_lsw =3D lower_32_bits(phys); + mregions->shm_addr_msw =3D upper_32_bits(phys); + mregions->mem_size_bytes =3D buf_sz; + + return q6apm_send_cmd_sync(apm, pkt, APM_CMD_RSP_SHARED_MEM_MAP_REGIONS); +} +EXPORT_SYMBOL_GPL(q6apm_map_memory_fixed_region); + +int q6apm_alloc_fragments(struct q6apm_graph *graph, unsigned int dir, phy= s_addr_t phys, + size_t period_sz, unsigned int periods) { struct audioreach_graph_data *data; struct audio_buffer *buf; int cnt; - int rc; =20 if (dir =3D=3D SNDRV_PCM_STREAM_PLAYBACK) data =3D &graph->rx_data; @@ -248,21 +296,37 @@ int q6apm_map_memory_regions(struct q6apm_graph *grap= h, unsigned int dir, phys_a =20 mutex_unlock(&graph->lock); =20 - rc =3D audioreach_map_memory_regions(graph, dir, period_sz, periods, 1); - if (rc < 0) { - dev_err(graph->dev, "Memory_map_regions failed\n"); - audioreach_graph_free_buf(graph); - } - - return rc; + return 0; } -EXPORT_SYMBOL_GPL(q6apm_map_memory_regions); +EXPORT_SYMBOL_GPL(q6apm_alloc_fragments); =20 -int q6apm_unmap_memory_regions(struct q6apm_graph *graph, unsigned int dir) +int q6apm_unmap_memory_fixed_region(struct device *dev, unsigned int graph= _id) { struct apm_cmd_shared_mem_unmap_regions *cmd; + struct q6apm *apm =3D dev_get_drvdata(dev->parent); + struct audioreach_graph_info *info; + struct gpr_pkt *pkt __free(kfree) =3D audioreach_alloc_apm_cmd_pkt(sizeof= (*cmd), + APM_CMD_SHARED_MEM_UNMAP_REGIONS, graph_id); + if (IS_ERR(pkt)) + return PTR_ERR(pkt); + + info =3D idr_find(&apm->graph_info_idr, graph_id); + if (!info) + return -ENODEV; + + if (!info->mem_map_handle) + return 0; + + cmd =3D (void *)pkt + GPR_HDR_SIZE; + cmd->mem_map_handle =3D info->mem_map_handle; + + return q6apm_send_cmd_sync(apm, pkt, APM_CMD_SHARED_MEM_UNMAP_REGIONS); +} +EXPORT_SYMBOL_GPL(q6apm_unmap_memory_fixed_region); + +int q6apm_free_fragments(struct q6apm_graph *graph, unsigned int dir) +{ struct audioreach_graph_data *data; - int rc; =20 if (dir =3D=3D SNDRV_PCM_STREAM_PLAYBACK) data =3D &graph->rx_data; @@ -272,22 +336,11 @@ int q6apm_unmap_memory_regions(struct q6apm_graph *gr= aph, unsigned int dir) if (!data->mem_map_handle) return 0; =20 - struct gpr_pkt *pkt __free(kfree) =3D - audioreach_alloc_apm_pkt(sizeof(*cmd), APM_CMD_SHARED_MEM_UNMAP_REGIONS, - dir, graph->port->id); - if (IS_ERR(pkt)) - return PTR_ERR(pkt); - - cmd =3D (void *)pkt + GPR_HDR_SIZE; - cmd->mem_map_handle =3D data->mem_map_handle; - - rc =3D audioreach_graph_send_cmd_sync(graph, pkt, APM_CMD_SHARED_MEM_UNMA= P_REGIONS); - audioreach_graph_free_buf(graph); =20 - return rc; + return 0; } -EXPORT_SYMBOL_GPL(q6apm_unmap_memory_regions); +EXPORT_SYMBOL_GPL(q6apm_free_fragments); =20 int q6apm_remove_initial_silence(struct device *dev, struct q6apm_graph *g= raph, uint32_t samples) { @@ -494,7 +547,6 @@ static int graph_callback(const struct gpr_resp_pkt *da= ta, void *priv, int op) { struct data_cmd_rsp_rd_sh_mem_ep_data_buffer_done_v2 *rd_done; struct data_cmd_rsp_wr_sh_mem_ep_data_buffer_done_v2 *done; - struct apm_cmd_rsp_shared_mem_map_regions *rsp; const struct gpr_ibasic_rsp_result_t *result; struct q6apm_graph *graph =3D priv; const struct gpr_hdr *hdr =3D &data->hdr; @@ -529,18 +581,6 @@ static int graph_callback(const struct gpr_resp_pkt *d= ata, void *priv, int op) done->buf_addr_msw); } =20 - break; - case APM_CMD_RSP_SHARED_MEM_MAP_REGIONS: - graph->result.opcode =3D hdr->opcode; - graph->result.status =3D 0; - rsp =3D data->payload; - - if (hdr->token =3D=3D SNDRV_PCM_STREAM_PLAYBACK) - graph->rx_data.mem_map_handle =3D rsp->mem_map_handle; - else - graph->tx_data.mem_map_handle =3D rsp->mem_map_handle; - - wake_up(&graph->cmd_wait); break; case DATA_CMD_RSP_RD_SH_MEM_EP_DATA_BUFFER_V2: if (!graph->ar_graph) @@ -571,17 +611,6 @@ static int graph_callback(const struct gpr_resp_pkt *d= ata, void *priv, int op) break; case GPR_BASIC_RSP_RESULT: switch (result->opcode) { - case APM_CMD_SHARED_MEM_UNMAP_REGIONS: - graph->result.opcode =3D result->opcode; - graph->result.status =3D 0; - if (hdr->token =3D=3D SNDRV_PCM_STREAM_PLAYBACK) - graph->rx_data.mem_map_handle =3D 0; - else - graph->tx_data.mem_map_handle =3D 0; - - wake_up(&graph->cmd_wait); - break; - case APM_CMD_SHARED_MEM_MAP_REGIONS: case DATA_CMD_WR_SH_MEM_EP_MEDIA_FORMAT: case APM_CMD_SET_CFG: graph->result.opcode =3D result->opcode; @@ -773,7 +802,9 @@ struct audioreach_module *q6apm_find_module_by_mid(stru= ct q6apm_graph *graph, ui static int apm_callback(const struct gpr_resp_pkt *data, void *priv, int o= p) { gpr_device_t *gdev =3D priv; + struct audioreach_graph_info *info; struct q6apm *apm =3D dev_get_drvdata(&gdev->dev); + struct apm_cmd_rsp_shared_mem_map_regions *rsp; struct device *dev =3D &gdev->dev; struct gpr_ibasic_rsp_result_t *result; const struct gpr_hdr *hdr =3D &data->hdr; @@ -790,6 +821,7 @@ static int apm_callback(const struct gpr_resp_pkt *data= , void *priv, int op) break; case GPR_BASIC_RSP_RESULT: switch (result->opcode) { + case APM_CMD_SHARED_MEM_MAP_REGIONS: case APM_CMD_GRAPH_START: case APM_CMD_GRAPH_OPEN: case APM_CMD_GRAPH_PREPARE: @@ -804,10 +836,37 @@ static int apm_callback(const struct gpr_resp_pkt *da= ta, void *priv, int op) result->opcode); wake_up(&apm->wait); break; + case APM_CMD_SHARED_MEM_UNMAP_REGIONS: + apm->result.opcode =3D hdr->opcode; + apm->result.status =3D 0; + rsp =3D data->payload; + + info =3D idr_find(&apm->graph_info_idr, hdr->token); + if (info) + info->mem_map_handle =3D 0; + else + dev_err(dev, "Error (%d) Processing 0x%08x cmd\n", result->status, + result->opcode); + wake_up(&apm->wait); + break; default: break; } break; + case APM_CMD_RSP_SHARED_MEM_MAP_REGIONS: + apm->result.opcode =3D hdr->opcode; + apm->result.status =3D 0; + rsp =3D data->payload; + + info =3D idr_find(&apm->graph_info_idr, hdr->token); + if (info) + info->mem_map_handle =3D rsp->mem_map_handle; + else + dev_err(dev, "Error (%d) Processing 0x%08x cmd\n", result->status, + result->opcode); + + wake_up(&apm->wait); + break; default: break; } diff --git a/sound/soc/qcom/qdsp6/q6apm.h b/sound/soc/qcom/qdsp6/q6apm.h index 19e223635edf..6bdc63c7dc01 100644 --- a/sound/soc/qcom/qdsp6/q6apm.h +++ b/sound/soc/qcom/qdsp6/q6apm.h @@ -133,11 +133,16 @@ int q6apm_write_async(struct q6apm_graph *graph, uint= 32_t len, uint32_t msw_ts, uint32_t lsw_ts, uint32_t wflags); =20 /* Memory Map related */ -int q6apm_map_memory_regions(struct q6apm_graph *graph, - unsigned int dir, phys_addr_t phys, - size_t period_sz, unsigned int periods); -int q6apm_unmap_memory_regions(struct q6apm_graph *graph, - unsigned int dir); +int q6apm_map_memory_fixed_region(struct device *dev, + unsigned int graph_id, phys_addr_t phys, + size_t sz); +int q6apm_set_memory_map_handle(struct q6apm_graph *graph, + unsigned int dir); +int q6apm_alloc_fragments(struct q6apm_graph *graph, + unsigned int dir, phys_addr_t phys, + size_t period_sz, unsigned int periods); +int q6apm_free_fragments(struct q6apm_graph *graph, unsigned int dir); +int q6apm_unmap_memory_fixed_region(struct device *dev, unsigned int graph= _id); /* Helpers */ int q6apm_send_cmd_sync(struct q6apm *apm, struct gpr_pkt *pkt, uint32_t rsp_opcode); --=20 2.47.3