From nobody Fri Apr 17 04:49:52 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 C95D733B6F6 for ; Mon, 23 Feb 2026 18:07:59 +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=1771870081; cv=none; b=q4QvcaUrFsCmKnqXfhiU04dFlT96/VI25Bj8mFIJBq2JEwAYWQB/2mtybUE9W77fquadxq6nTol0qksrwPkyCGIN2VzOYJnnmKbTRM4/LXiK5PYY9ToKmKPrX1L7C9KcczWNw/CLWooLtyuM29Vs4uRyZVckHrOMElvwqa0RhhE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870081; c=relaxed/simple; bh=oEkIhNKWtLpHdr8wqnNeYG4kHYWQ5Gh5zUBeJNZTPnk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gQ0mlAK1CTHGgIilaa9PuQF5pSjivJb8hKXjNa3yXaeOrzxrriSA8LMxObaDOSos/TGqYQnZz4673SNa4n9BJS3dj5nHuu+I9sI6PGh3aTxXbZiM9a6+wfVQnthWX1Va+4A8ZWDd98GwnngqAg7d2ve1s8LyLYFcm20PN5sqRlo= 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=ajQ603iN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=EL7YIfTe; 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="ajQ603iN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="EL7YIfTe" 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 61NAWN243733304 for ; Mon, 23 Feb 2026 18:07:59 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=I3U7Vm1CHB5 FgP0u4G05ZUf+1Mwffl62vHgDE0f0D1k=; b=ajQ603iNcCJMVr/s1juL4ITQR/f IlSFdAgEi++wCaIXPzNRZHKB/GBsDdzkSX0pNUr1rPsm3bsTES+9kdcLfbDBZRPA AS2ciCMahzoxwE9SexzBUFWmzWF12TcARL+oQPHqLdUPQl2NPk+Cxh+y/qsDXlF4 coqqJP+aiQ345v9WK7YwEyq9XMyyxS0uu7c5EcQzqP1vIZs3kS8jTXjyxV4Ubj7k bsHBQrNaT+KG0J7OCNuIuppv0LsxI2D2PMIWRJ2RTdFIUqxSGrJNX/Km2wlju9jz TrhQBgXGaGX4Tcgl/VgWSJdNkhNqZdPDYEnFgCfRDM37dQhQRA2KKW1Ojqg== 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 4cgn7t9e8p-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:07:58 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8cb5359e9d3so4498926285a.2 for ; Mon, 23 Feb 2026 10:07:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870078; x=1772474878; 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=I3U7Vm1CHB5FgP0u4G05ZUf+1Mwffl62vHgDE0f0D1k=; b=EL7YIfTe6/04Tn0q+q0zjWYsFH/xaT4Wb1J8v5DDXFOrpRCe2H0wLF4khJ/SVGcq6h Ode8MGW44FyqSZXb4cXcTfzqjdsdfXia1Ph44mO41wnvs1vZ7M0vPs0q9nN+5t08fXpv 6KB8IEgEajx9tjtY6DksRybapQFd0kmFNRZUAnvxt2rVixfMKL5WDXZJiaGyCa95p9ur eQj1KejeEaMrKEtbmZO8fxAZHzrOxJGdk/KUKaNN2yChGD4bfKw7lZB5so7pJjX4GH4a XfB6ktKxFrKPkKTsfXAz0YE746Px2S6WTDRdE9LXWpGp5LLYPJwGks+qT+lsTq+iiiOB HAHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870078; x=1772474878; 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=I3U7Vm1CHB5FgP0u4G05ZUf+1Mwffl62vHgDE0f0D1k=; b=YknbWsNw7zWE1R3VUWrJfAgpywcxQpnkGW42dpt6XwX6L6AW3JJUoMFCdKr98BGRIG RCh57Nc4e8/BsvyuD0KNRXoR62SLVWFDrXm40LMlaNw/RxV3UG/YxA+IC4aeYq68Zs/0 mdyQEP3tZ7JTKpPR83NXyKsmbXV0DEYjZs7+IaUE3tt/HB5/oVrqACapcBeLubg6m1oA Co04VUAXXnf8oPsOXHbPV53JMGcnD2Ad87TwijvppQAyzk8uq/Gp5/XPAh59tGMxisY9 lIhjjOqUtFeYzsfHDFP/V/u7wK1RgX2EgC0/c91vD911Jn2ZaCwX/AIj6LeJcD5YjgRU W9MA== X-Forwarded-Encrypted: i=1; AJvYcCW3U0szYkre4fgs33PjyvTtasEqFM4TGnbBluYhE5i3L08gejotiHnwPy176wlajDeYAiSzpVFel0ko/o0=@vger.kernel.org X-Gm-Message-State: AOJu0YzoiPVcQie5dMQ3mpAQ3yqCcMoH30MPcgywt/d4GcDmlQL79geq VU0D16ULD0ZMHEZ/eeKh4TopKeIhZP1gwdvXTQyVt9/KV4YWZOg82RX+MZNvaKSH3OgGHXTJHTD GFRw/ZfFi4oSMIq0UzaF2lU6OSAB8K10DjFasAu8fXuWjs+8+t50hZtADwpCywQdVV4U= X-Gm-Gg: AZuq6aKhlv6p2RKPMukwdMn+n2gd88rB4U37taEl5ndRmUYYzX1U1fsWnjfD85dOemW W4gZRJ1Pk/QZkPPcyQDgd5BcQxP5jFo/1g9CSG6vSr6mcIreI9nj209Ft+RFC+a3TEnuAk/9N41 7sdO9C1vh7NwzbFQ6VM0USm9jA3vXDMtjic9n/pfuhvQdRpqmHMKtAWlp6nk6RfK8uwUdnoG341 P77+6eS/qJhEo6LD+q4tkyi6nUW4WkWa/sHSftD1LZelti7WmlxDvEM0fvIYsmqhQyY4RUzq/wv TzIP/tOgyw+AQqDg9wkttlj1y+6xRTKJp88dCEEJuJVKT7F0pDTVJBh7IUh+n/R18gsKW3vTMte YZgP86vWfdZRHjsHnRD0VJJGn9ftVCbQEVsod5hp1mVOI34WYKtzJFds= X-Received: by 2002:a05:620a:319a:b0:8c6:a7c8:de5d with SMTP id af79cd13be357-8cb8ca6e71dmr1179962685a.37.1771870077093; Mon, 23 Feb 2026 10:07:57 -0800 (PST) X-Received: by 2002:a05:620a:319a:b0:8c6:a7c8:de5d with SMTP id af79cd13be357-8cb8ca6e71dmr1179957185a.37.1771870076615; Mon, 23 Feb 2026 10:07:56 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:07:56 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 01/14] ASoC: qcom: q6apm: move component registration to unmanaged version Date: Mon, 23 Feb 2026 18:07:27 +0000 Message-ID: <20260223180740.444311-2-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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=c5OmgB9l c=1 sm=1 tr=0 ts=699c977e cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=V_9xLtwMS8rYbOKIGWYA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-GUID: LUrBD7h4pm93eS0DEoW2mUHFHaNP-j8h X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfX6XRFgvt10X7V VPDTOJVrATewKzAEQ8bYDBBWVct2tIMwRM+8XdWlai9ZtABr145T7/tjOj9k9gIfwCB3ci839ZT BvpPM6sLfjPidHj5p4fSAMZ9Xk9CelfH71kRjC4norqspx19IeDQ17LVKpOLJ9kXl9ewNpenod3 OXubwbp64sSv+jE+/HAxtgzQbH4Xb26NnlWrQqZgpM/eSNNhC71Phnlrl3hjkzcQ/a9fMBP57oX IuiGo9R/ONtEhNtABOjnmLJQlOj89pkL4RFW1/sRBgi5t/l4kitHX0NNCj+MYhPQc1/hSK0h9Rr LZosiygWKaEUfCngmkC279fys1cA+BPUu8RYGaJFwHBSU0MLQ9kyw2sFitXcGO13fzpcJoqwq7B +F8y6ay3VrC5J5ss2PBObJikLErDmUkuLaj3dyUYpw/Tb4grskrL5BgqxnY2wATnLBJ6dVn/ogN qE/r7JznXxp/MvoC07Q== X-Proofpoint-ORIG-GUID: LUrBD7h4pm93eS0DEoW2mUHFHaNP-j8h 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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 bulkscore=0 spamscore=0 suspectscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 Content-Type: text/plain; charset="utf-8" q6apm component registers dais dynamically from ASoC toplology, which are allocated using device managed version apis. Allocating both component and dynamic dais using managed version could lead to incorrect free ordering, dai will be freed while component still holding references to it. Fix this issue by moving component to unmanged version so that the dai poin= ters are only freeded after the component is removed. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BUG: KASAN: slab-use-after-free in snd_soc_del_component_unlocked+0x3d4/0x4= 00 [snd_soc_core] Read of size 8 at addr ffff00084493a6e8 by task kworker/u48:0/3426 Tainted: [W]=3DWARN Hardware name: LENOVO 21N2ZC5PUS/21N2ZC5PUS, BIOS N42ET57W (1.31 ) 08/08/20= 24 Workqueue: pdr_notifier_wq pdr_notifier_work [pdr_interface] Call trace: show_stack+0x28/0x7c (C) dump_stack_lvl+0x60/0x80 print_report+0x160/0x4b4 kasan_report+0xac/0xfc __asan_report_load8_noabort+0x20/0x34 snd_soc_del_component_unlocked+0x3d4/0x400 [snd_soc_core] snd_soc_unregister_component_by_driver+0x50/0x88 [snd_soc_core] devm_component_release+0x30/0x5c [snd_soc_core] devres_release_all+0x13c/0x210 device_unbind_cleanup+0x20/0x190 device_release_driver_internal+0x350/0x468 device_release_driver+0x18/0x30 bus_remove_device+0x1a0/0x35c device_del+0x314/0x7f0 device_unregister+0x20/0xbc apr_remove_device+0x5c/0x7c [apr] device_for_each_child+0xd8/0x160 apr_pd_status+0x7c/0xa8 [apr] pdr_notifier_work+0x114/0x240 [pdr_interface] process_one_work+0x500/0xb70 worker_thread+0x630/0xfb0 kthread+0x370/0x6c0 ret_from_fork+0x10/0x20 Allocated by task 77: kasan_save_stack+0x40/0x68 kasan_save_track+0x20/0x40 kasan_save_alloc_info+0x44/0x58 __kasan_kmalloc+0xbc/0xdc __kmalloc_node_track_caller_noprof+0x1f4/0x620 devm_kmalloc+0x7c/0x1c8 snd_soc_register_dai+0x50/0x4f0 [snd_soc_core] soc_tplg_pcm_elems_load+0x55c/0x1eb8 [snd_soc_core] snd_soc_tplg_component_load+0x4f8/0xb60 [snd_soc_core] audioreach_tplg_init+0x124/0x1fc [snd_q6apm] q6apm_audio_probe+0x10/0x1c [snd_q6apm] snd_soc_component_probe+0x5c/0x118 [snd_soc_core] soc_probe_component+0x44c/0xaf0 [snd_soc_core] snd_soc_bind_card+0xad0/0x2370 [snd_soc_core] snd_soc_register_card+0x3b0/0x4c0 [snd_soc_core] devm_snd_soc_register_card+0x50/0xc8 [snd_soc_core] x1e80100_platform_probe+0x208/0x368 [snd_soc_x1e80100] platform_probe+0xc0/0x188 really_probe+0x188/0x804 __driver_probe_device+0x158/0x358 driver_probe_device+0x60/0x190 __device_attach_driver+0x16c/0x2a8 bus_for_each_drv+0x100/0x194 __device_attach+0x174/0x380 device_initial_probe+0x14/0x20 bus_probe_device+0x124/0x154 deferred_probe_work_func+0x140/0x220 process_one_work+0x500/0xb70 worker_thread+0x630/0xfb0 kthread+0x370/0x6c0 ret_from_fork+0x10/0x20 Freed by task 3426: kasan_save_stack+0x40/0x68 kasan_save_track+0x20/0x40 __kasan_save_free_info+0x4c/0x80 __kasan_slab_free+0x78/0xa0 kfree+0x100/0x4a4 devres_release_all+0x144/0x210 device_unbind_cleanup+0x20/0x190 device_release_driver_internal+0x350/0x468 device_release_driver+0x18/0x30 bus_remove_device+0x1a0/0x35c device_del+0x314/0x7f0 device_unregister+0x20/0xbc apr_remove_device+0x5c/0x7c [apr] device_for_each_child+0xd8/0x160 apr_pd_status+0x7c/0xa8 [apr] pdr_notifier_work+0x114/0x240 [pdr_interface] process_one_work+0x500/0xb70 worker_thread+0x630/0xfb0 kthread+0x370/0x6c0 ret_from_fork+0x10/0x20 Fixes: 5477518b8a0e ("ASoC: qdsp6: audioreach: add q6apm support") Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6apm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 1d5edf285793..9891e757165b 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -746,7 +746,7 @@ static int apm_probe(gpr_device_t *gdev) =20 q6apm_get_apm_state(apm); =20 - ret =3D devm_snd_soc_register_component(dev, &q6apm_audio_component, NULL= , 0); + ret =3D snd_soc_register_component(dev, &q6apm_audio_component, NULL, 0); if (ret < 0) { dev_err(dev, "failed to register q6apm: %d\n", ret); return ret; @@ -755,6 +755,11 @@ static int apm_probe(gpr_device_t *gdev) return of_platform_populate(dev->of_node, NULL, NULL, dev); } =20 +static void apm_remove(gpr_device_t *gdev) +{ + snd_soc_unregister_component(&gdev->dev); +} + struct audioreach_module *q6apm_find_module_by_mid(struct q6apm_graph *gra= ph, uint32_t mid) { struct audioreach_graph_info *info =3D graph->info; @@ -819,6 +824,7 @@ MODULE_DEVICE_TABLE(of, apm_device_id); =20 static gpr_driver_t apm_driver =3D { .probe =3D apm_probe, + .remove =3D apm_remove, .gpr_callback =3D apm_callback, .driver =3D { .name =3D "qcom-apm", --=20 2.47.3 From nobody Fri Apr 17 04:49:52 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 C1E8533B6F1 for ; Mon, 23 Feb 2026 18:07:59 +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=1771870080; cv=none; b=dtjM0anD8qcQZqr6qhB+qULXhyUUXj25nOLcL8vXMGbhtM4qz9+VXeLQIOqZ2FUxP9NWDNPhUEmTFIj88ytuJqIxZ4g5Q7ePfNMjYlxpQBv4gIcbe4c4G1v0KGU6KjkKNIh17wh0VwKTy0q94Ury6vT3m4Dc8fZpRUn3Mm4meQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870080; c=relaxed/simple; bh=DFQzZINZtXFqVKS+d/H7Nq3BWvhDSfyQmYunncyvNfk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Idp8Qqmni5Mtwr5szeRy6jIXr8qjKAyZsUY+EBLpRdh9xlOJvc1dzWN+Fraq39erndd2Ma2Sv2E9L2+R21oyW40s+OVrkMlyj851CaaUFoY36xM+RIOU8f9A+srbooUZ1b03CCutcj7i/KtTcRlmUs0ecBdXij/n4TiS4Kl5Y2M= 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=aYrDs6DN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=etjOHkyZ; 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="aYrDs6DN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="etjOHkyZ" 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 61NC2qa03152071 for ; Mon, 23 Feb 2026 18:07:58 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=TNBgtOWdzqa N0EAZI+bdR9OoxF9zijtL5mpQAoIQbzw=; b=aYrDs6DNFPNEoEJsTwHNDDk7mHt YTg5WGu6MEbBrB07Bcug4w/m1IhfiiHDnPUIamLCYKetrp3eipZamUvHobO2XLNL yLUo//y5yyw15TDdV3DoebJPikN0Y8lEnep2YG0j4+eHhVxYcjMdiGiUxZuHumw6 9phgdA0Sq4OBtQX7ynwM7cY/rnZREtlkbTKpUhCzzTCLzJTOXQQE3Rb5KL/W557y 9A83GYncnFTSEy70aWK3e5KHjvWQ/WxkPVf6L5ENcPEFvafH4tYdcyVtTlGXOw9P kzaI2809gKYmr5cBftaTQofpmQx1teRcQrXZIEoXzYnJlLDGJ+XHCBkDLEw== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgpj895ne-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:07:58 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8c882774f0dso4187349185a.2 for ; Mon, 23 Feb 2026 10:07:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870078; x=1772474878; 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=TNBgtOWdzqaN0EAZI+bdR9OoxF9zijtL5mpQAoIQbzw=; b=etjOHkyZEkBNysLBkiaSMUGy1ULxxqy5u+BWXg31yUyrzFQlBCkKTXJsqMpwjYBEzl ol8EtuzS5R16Q/+Srio+lnRJhcfJ+YhaXFBzayYpo1xEMYVXHYvGjKNaDYkiV8YYrkiT 5d7Ix7VBugG+VdK9AeFZMJPiWl3f289kCb1MKyseKS878prnv8z4hXi51RyaTG64jk2Y 3qPgdBYuGpj4w5jxkgICGGAosRBMfafBLStqQOSZ0g5oQQfeeciToJxrexKpf4+5kab+ KAuUbV981zd1pkqt8GFH8TU7OKHyb/LycLluTQ2unwbPyuS+bUnKPYx2fsi6BKl2QRzn Wuxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870078; x=1772474878; 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=TNBgtOWdzqaN0EAZI+bdR9OoxF9zijtL5mpQAoIQbzw=; b=ZjYWfPAw/k+FdpmYf9UyW+h4rlXBJshjcebT+RT/3C0pQXGX9x5rhxLSJh2WNcgo2n M2rg+Pu3fjxEOwbF6y1l1Cmlr7HV7rceGrxfpakWuTGrqyym7NSKo7SJqV4cPKvPswoW UCmIYH4YBBanBeBPNWvrNry+AuuwXmOo0EbcUQ6YyT7qpBDk6OHn58mQM18PWJg5pfSb aeblKLXLG7lt2/qlRiWYdLthsQX42tLx/TdOcwbd/ZKOe7s6O4LnsvFIXQnyAuFHiAw3 COzwstU1n8WruJIDBKORGLS4mpxX+VbLhdun6xUzqB91yG00UvdAHlFbcO+jqEm6V335 s8Aw== X-Forwarded-Encrypted: i=1; AJvYcCVcl7RPUoSyCyhEek6ViOS636ngqo/pZ+DB139F/mvbfRU6LlWaZh2c/IAyzgozViyDZr1hnbb00412chM=@vger.kernel.org X-Gm-Message-State: AOJu0YylyKOmnFNc7TaNv54g5Ftooia8AAj9Up+IadVnN+iy2l/SHri2 BA0Unnx99LBFRxvjNQ6hh9kFXi/StFn7GWFcGJ/yB2DeSv3PHAKqCp/B4BKbFbWcU9F/EnfEVnA lb05rmzYWcTzMASNQ4Esq/1HpswawfRV+jmsJA6cmGqQlCJaQgJMpwb0cyyfMumiPb14= X-Gm-Gg: AZuq6aLK5rgluOLilTmTqkPOE1NYxLw6JHK2disl5NaSRpI+tQoTuBHgEJYeca5sHrj gr5UuJ1g8KaLmkKhJnSbDh61/AenwTTYy6AyEx2JOh22ksthtEtTXJW73F2XOoWLsrQIJsb7Uvc UZgGW9pdkHX+TBjskgcy5pTELtxcioKBdhrzlJdlRCs6q/ea0sB9mrhL2iY9ucw6j/qTxfpSY9R Ey2ve5Iyb+IbF5XnWQtRfbuw5dYVw00vG0Rjn09AGg87X/FOWlC2JkiP3L/lQDy5G9woly3xKLi urWX1Y9iQvedTAN//bp+DG/rF6y7M7qrB3AcFGukCDI1YgTUCGkD8H140h/Tz6XJBGgOoJA+xbL dt7Bz9VgJoWy8penSEeMzv07dt5Bwco6S9350+bcyZKADFzcdqRRYUec= X-Received: by 2002:a05:620a:191d:b0:8c6:a539:55d7 with SMTP id af79cd13be357-8cb8ca800d6mr1186627885a.55.1771870078182; Mon, 23 Feb 2026 10:07:58 -0800 (PST) X-Received: by 2002:a05:620a:191d:b0:8c6:a539:55d7 with SMTP id af79cd13be357-8cb8ca800d6mr1186622485a.55.1771870077646; Mon, 23 Feb 2026 10:07:57 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.07.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:07:57 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 02/14] ASoC: qcom: q6apm: remove child devices when apm is removed Date: Mon, 23 Feb 2026 18:07:28 +0000 Message-ID: <20260223180740.444311-3-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfX0AXfhu1zsP+D Jf/2nK+lIOldqYzyRWH4twfzzTsizP+1gOsZjzzcpAuJgyMA3Cn4PbkdSAqv/eGg1ogLh9LmZwV UvTljw9qkGkAEc+sbNShdjQeIAogeN1BIosKFzfMUEDXIARiX6wGLOHeMBG0HopJvZC6Y179oKc YmZs1fef2J+dJPZnKWaIDTJsTwgB8zMFDdTp5sca0DSC5XYlvEoHk/Pp8IczUh0vzyDb/Px9wcS 4g1i3LkgHJo5tRcKM4jP9sgu+N6JQ5BjpPNQHGrwdzp/JeGQG9Kg1kqT4f9VNqNJGTYSgg5D27M BYMFIG7yITxibQNKqjsLyHwBCCgP4f2OWeY56uH5NJsnlVgn5F0D97ZidOjQ42u4XOnFX9DkoS2 OQXW55EYpBcBpKMt5Q/bzMB5c7REDmC4YQtCnnF4Hn5Cl8/8qHvXyCb8PG5hXHY4X8pHlfS13qC pXUQxfHQCB14cH1wGoQ== X-Proofpoint-GUID: FS7UZ6pKhtn1sxSRdF4jiVg8vcZBvNrd X-Authority-Analysis: v=2.4 cv=Z5Lh3XRA c=1 sm=1 tr=0 ts=699c977e cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=vtfATQNByG3yFndO7KsA:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-ORIG-GUID: FS7UZ6pKhtn1sxSRdF4jiVg8vcZBvNrd 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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 bulkscore=0 adultscore=0 impostorscore=0 priorityscore=1501 phishscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 Content-Type: text/plain; charset="utf-8" looks like q6apm driver does not remove the child driver q6apm-dai and q6apm-bedais when the this driver is removed. Fix this by using a manage version of of_platfom_populate. With this change when the dsp is shutdown all the devices assocated with q6apm will now be removed. Fixes: 5477518b8a0e ("ASoC: qdsp6: audioreach: add q6apm support") Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6apm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 9891e757165b..be8b205d42c4 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -752,7 +752,7 @@ static int apm_probe(gpr_device_t *gdev) return ret; } =20 - return of_platform_populate(dev->of_node, NULL, NULL, dev); + return devm_of_platform_populate(dev); } =20 static void apm_remove(gpr_device_t *gdev) --=20 2.47.3 From nobody Fri Apr 17 04:49:52 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 E8E5633B967 for ; Mon, 23 Feb 2026 18:08:00 +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=1771870082; cv=none; b=SCN9VI7gvmNntooo75Tcxor5F9CZ9vJF7KRfGq/l5yGoN4ALt0i/jfhoVbtYpSpf4EfqS5Z4/chTfkDqtFQoIuib7KA1aXOXPfcIIYkqsTnIbEBZ2H0cmdBz/iGIAyXiESqezDqpt7XjqUo01cXxu5vzbU8sRWIPkAAMAGS1YlE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870082; c=relaxed/simple; bh=z0nBWK5+F2wsJrQIhtl6TV5njKOz8lu+80qf9G2Sim0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dp7zmkHqSfrCDWp0Uk30Yog51fBZ85F2z3Zo8yk6yNTMmEKmXQ0p7amn5Z1Y5Ko6hHb00VnBpYHY6JI0LAdHYK9plYe8DXBoP89TgAJv/xe9IxEa7cZrYTFMTMIuT9NSbwBYkMB2uhpH3mBCmKwszmAVPLx1DBqnV5c3r6fvv64= 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=H8r2I+7K; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=gNU4R34I; 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="H8r2I+7K"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="gNU4R34I" 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 61NAWDDu3732709 for ; Mon, 23 Feb 2026 18:08:00 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=vJxFLg7wg9k swXDRQsScAbUneSzeSw/ohZQ+0IC4ocg=; b=H8r2I+7KV8h3oqSJmnLDpVD5DrB TJAJH1j9/fPIoXssIrJ7o8VgeLWj5xTEq4mugrSm8EvoZgZ9DK8gpjFF+C3aJfCc p4KBiRrQmTADUN/TTtixKoLRU5nL1Xxz8OENvGrfTe9qkx8GKAPPvlzh1GkG5fUC EzW68UON0TZ4AfPm5VxTp7881nOW+R4Py310JLdoW/G3bI005QNpmmO8APk5ZaJN BXbXiMZgz1p4pwvBXpgu6V3kqbBKV73QKCOSoe+BLTzlcu/qImKRvr03uf9IdWjy 0DPKS8zrKQlzuorSIYCuxuKyXcj9QOGPhr4imCSebQlUCico9gBCf4NX/uw== 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 4cgn7t9e8t-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:07:59 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8cb3b0d938dso4795468585a.2 for ; Mon, 23 Feb 2026 10:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870079; x=1772474879; 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=vJxFLg7wg9kswXDRQsScAbUneSzeSw/ohZQ+0IC4ocg=; b=gNU4R34IkcLXbdc5o9GztyjYW24HM3lcc8HC2O+wIHO2sF3Bi0/yNTaTX6PBwxKEpb t8O/zpJhX6Ekggb0QQ2r2nPpESaVy5IRUksaAMJQGqcGMwfLiGs0eOgvX9hzI52ITAa9 QafDfO5fRyBK+mi5vBVUHyfQFYMcaM/m5pVqod2hmpjqPIVJ7rQWw4BmkftsiCPY6NW4 vQis1O0cNpirHcZITg62FavG68CI8flx3CAECtQLjZw1lJJwHK8qmMwx8OAwCO98MKbF Z7G08THef+9HwPHiptNU2kYAhyuH0cPmf7y/tFuUE0ShSyykFHms02d/b1Y7UszWsDYJ USXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870079; x=1772474879; 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=vJxFLg7wg9kswXDRQsScAbUneSzeSw/ohZQ+0IC4ocg=; b=OeExRblDdcuDb85IGxeJJMrOFy0FCab3Eu/Y43CER6CWMlzvPrmPG43tEBNibboloO FEdycpYUaP6AQcPrGBW2mimBvobhJQv9cRKbbQtEACP4iRRqKu5MpYRbu6tu0nIdUm6d XqiLsUfypjBjfM+YFrNsswKWISmkPhzuU5zk9ocGLNveCTkeTISzkr6zxCFdxRZ93Zam hWyIaSlF8gJQYT5pIHgHj5y56GqCnbChrnrZ/7ADL3x5oR0c8iJuG6eQrTxtD8zBFgo1 i+pagCIKzfUZz3uKGrwHOAv5j7PeRhjXgUcCmam08a/2EI3xJyH8CUln2L1zjE0sG3Nj m1Sw== X-Forwarded-Encrypted: i=1; AJvYcCXQlCD+KpXgTVnvKalDJLlAC2/ZQAMvq77I+OyBZGPebTrJH2wL7b+Ij5DAINHl1jt5IxRZqDxG5TNqkKw=@vger.kernel.org X-Gm-Message-State: AOJu0Yxma/sx7xrSQ+zBptUxn70BDRVCFGyYDlZiJhokWE9v5U0ohlhL 661cS0E6kEDkeHmLGPD2Cb9M0juLM/ySQb4TbrUHo6ltE2usafT7nohNE5Dn4Q4eq/1EbZSIQGj noFjtDJnnyWUKORoXb/EFgLkczAUiGU8LwEf5M2e1Kce3SPt9JfUknbX6zYlgJgyPhYU= X-Gm-Gg: AZuq6aJ8GVU4JolvaeqMY8U3R3bWvWQ4clyciFTBYVthqC+Qj4x2pBXTLCKcRznHZf8 uipc2oSKnIRLWCai+jI2LZFG7k13yvSviGD5FICBLhq4N3woPTKALPEXHkxcHJAZiwcmolmbYSc 1hjhS8DVN9WCWlhnqVfOJy4b6ZZnobFH5pK4j0wzolXQ2n87wOMqr1GcZ6tpMNVxTjSrDYKC6K1 z7+/tdTqAx+XrIeQkDMMWATEVf3v3vnJeDE5X6JzTp91inmIcNr91rB07QVy3X5I0OQyfa42S8S eMemV3Tu8lwI8IHKWpoypct6lbqXaT0l0lnCERUgBMfA3UQbJJnTij+0ZsFDSRwIR2psbazI8WM droHaVaw253uOXwL0cwn/Gvt3RMkChD1U9GgQEWsCMrjV25FDrHYOipA= X-Received: by 2002:a05:620a:408c:b0:8cb:5176:f00 with SMTP id af79cd13be357-8cb8ca6731emr1093334185a.45.1771870079266; Mon, 23 Feb 2026 10:07:59 -0800 (PST) X-Received: by 2002:a05:620a:408c:b0:8cb:5176:f00 with SMTP id af79cd13be357-8cb8ca6731emr1093327785a.45.1771870078795; Mon, 23 Feb 2026 10:07:58 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.07.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:07:58 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 03/14] ASoC: qcom: qdsp6: topology: check widget type before accessing data Date: Mon, 23 Feb 2026 18:07:29 +0000 Message-ID: <20260223180740.444311-4-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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=c5OmgB9l c=1 sm=1 tr=0 ts=699c9780 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=5HTw2GpdgXbBP0wXRk4A:9 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-GUID: 8iKCvHdxXQvU_lXp3ndcUr02HK2uX9i- X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfX/2pZS/TnR29L 6UKdK4TLCIy1MsoppsfaiqYIeiRBNC/s5jkvAND8gCP4sKWKVrrMFHS9bGDA140ui0mY+gt+Hj0 6DbAuu1qU1NriQbFAChVVevL2PylKpidKdhrjHzQZfpl7sIsF1jupAsH6WixYjlODloc5Xiua57 AxMpCHPeQwDqHPsSZQ+k25tpl0PTW755+hdKfoLbEZvSbZdbKbR7uomvrK49mi7MU8q7CWgrBZE 6fEt0jY7J5giBWxujLF+I+1h5ehHdzFdnuGuw8Q82jrEDrDo62lV3herEuoxCAUlvCx/7T8TZG8 fsalKPdMofEsDT8ZgNSAgUX/gQH1oYdoimfvEcgagQu4ZwRme/4Gh1hJ4VHz58Or7OS01pyNiQ7 b9lX3baPyzvRLfBYBFoNUzdRW3Fs1+SoFR0azGaZoq640zYmvM63DRj5WAcxHXmL9NSSJd7n0zO IGpMhZ61KyZldl2Ho/w== X-Proofpoint-ORIG-GUID: 8iKCvHdxXQvU_lXp3ndcUr02HK2uX9i- 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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 bulkscore=0 spamscore=0 suspectscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 Content-Type: text/plain; charset="utf-8" Check widget type before accessing the private data, as this could a virtual widget which is no associated with a dsp graph, container and module. Accessing witout check could lead to incorrect memory access. Fixes: 36ad9bf1d93d ("ASoC: qdsp6: audioreach: add topology support") Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/topology.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topolog= y.c index 2e71eaa90441..80afcc817d78 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -952,9 +952,6 @@ static int audioreach_widget_unload(struct snd_soc_comp= onent *scomp, struct audioreach_container *cont; struct audioreach_module *mod; =20 - mod =3D dobj->private; - cont =3D mod->container; - if (w->id =3D=3D snd_soc_dapm_mixer) { /* virtual widget */ struct snd_ar_control *scontrol =3D dobj->private; @@ -963,6 +960,11 @@ static int audioreach_widget_unload(struct snd_soc_com= ponent *scomp, kfree(scontrol); return 0; } + mod =3D dobj->private; + if (!mod) + return 0; + + cont =3D mod->container; =20 mutex_lock(&apm->lock); idr_remove(&apm->modules_idr, mod->instance_id); --=20 2.47.3 From nobody Fri Apr 17 04:49:52 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 EAA7B33BBB9 for ; Mon, 23 Feb 2026 18:08:01 +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=1771870084; cv=none; b=FbadAEPGEiop9Bd45i7N8yy3ZnIqwhniqiNPcOoOQBuVAoKq2nbnI2ua2ODMxLiZfR3mgMg7zExcKUCZ0w+TFRSZpQ0jg4pq8hnZUDjKFaYhwiX1Ht1bbwvgV5DMEYfOORHtuOxddJ+eqX9YEC76FMw0+wNezXm0AuzEZnfRc7A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870084; c=relaxed/simple; bh=KvhN5EIM3XXPaotrLaYPSuOdgBSYq4SNpSPqi8ZqfN8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JeTcbr395fC/b5zD6x8IyBn/njncih60t73TjPsnR5RfzwtH7oycZkqy+7ntnuQrDzo2k/yF4x6CKiq47ES4MbE/hn4m1YtRuqg53Q7MswULJ0kKGSbafV/F3XqsFA0iISPIhH2Zt18yGK5oIgemxQHYGSPDpMoj9nNG1YfiZ5g= 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=NQCq6Q+O; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cuWZtmid; 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="NQCq6Q+O"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cuWZtmid" 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 61NGRHY41640561 for ; Mon, 23 Feb 2026 18:08:01 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=K4gYoo9JoJP OJ5mTuliJj+hphclVDgk4+5Zp53bnrEg=; b=NQCq6Q+O2FeHjLFGEWtVf9EKOMK svQJaP+fIfVj46ZNjebQtx25ni115KQASMvJPdDw8D3kJDsN/cjI6Pn9KulS/AtA W4KQkyzPIIKSmbwBVEUTNWxA7UpjKwkf58ZoGDpfEBBREm2fqT70hnZnSDePqtB9 DNZdeAabpwvPqa0N7i18GmiFW9meLDuI83gl104ASSayZsAD0B77cFvY2WV5dFex tAG04zrddMw6zE8S+SGCgzQcWwQCxs1Iaw14gqwY1GK2OLZVjGaG7CsdOqXqYdjT 0FDhV8Qua1GtkKGXZ8yf62h902dcZPlT7A3Ya8hW5tM3EIlCmgANBnm/Q0A== 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 4cgte8rb3e-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:08:00 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-8cb403842b6so4855777885a.1 for ; Mon, 23 Feb 2026 10:08:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870080; x=1772474880; 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=K4gYoo9JoJPOJ5mTuliJj+hphclVDgk4+5Zp53bnrEg=; b=cuWZtmidmb+0Q2Yf7vwqK9ACnWVQAYc4/60wyD1oJiGuOsAjxdwdJs5LD5SwQtk1MJ BacmtfQTrVfpzuGI45rnwTaRa6x8xgmWrDuFpNJK81GpglmaWxxxwahiFKTnaGQtdm32 J22ZrTO0DuHgDorL0H7FtozsuzgSp7WC/EChnbV7hukIs6pfPP/ujHQMHJXQr90Gx1Ln lw1y1pufRSTk51kQc48QRgwqYxl6xViSLrZNGOES5vjSbjR9QloHtKiTxC9PpVdvdXTa UASblWXoqTq6GteZwyDqKT575So8MjIIgdODgNy6zO47QeDKxpbqWM5nVrJfeesTmPkJ h0nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870080; x=1772474880; 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=K4gYoo9JoJPOJ5mTuliJj+hphclVDgk4+5Zp53bnrEg=; b=iZM1xdP0c5dEUKiQkob6O7zJE0b9gf99w1hsD69nm+LhyL834FAR4slLsgzY9lMbKh 9eB3hT+WxkDxyoeplltQpOEFtFpYrXF0nB5er31b6JHb2P37rmgB3OWXIE3dbVqrj1/T rx9Yb804cBS3kkScZQrJwdlmoprJxUz8UoZuLlH/Dl7GhYwYFeeyKYGMkJqWoxJtJUk6 GaBcYuU1WBeI50r/QS5AzOzTZ5tvOyx94eVpbtXiIoO7pxw1HY+RLCiNtx8oqfENrD44 IDA+QOq5Asr5rIzAXCgq7vYD6QmziG84pdVQL3NS1k/pgXuE44+G+kkIbjOohsan7ZVr l2Og== X-Forwarded-Encrypted: i=1; AJvYcCV8XXYzSOIU+KOiDNQnrrOzYsJxqSIOG/dAbmdDbYha8id0apIF5DrLurxrjv9a5zxMSbl/ScpktDGPZdI=@vger.kernel.org X-Gm-Message-State: AOJu0Yzk9U57mOJnM9g/7NO72NYSKoMWU87q2Mg5v6m3IQJyk2PD7s58 g7y9VwlZrHiX1K+ilR5J4Brl1CRUyJkmDa/ZvI+cszJ1jE4ozXjqTz0FhJ0GSN4B7O+dXNIpg3N bCrGNz3DXJLAlfPUWoM5Xap+SqgX5Hfhz33gTAJs/YUdKQ6P8NiA9DnwlG50C3zESQeE= X-Gm-Gg: AZuq6aISjq3t9LMmvpT8U4yeucQD9u2YdskmY9j4HaN5kDv1EFVPXji1Cg7VS49mLlQ CCv9zUZk6AEcVJuhp7HsqUWPlTrQleCdVI10tKgjaIDoyoZe40GgiGF618/IuYsuyMoJS/el3Rk xxTrQduvDEjG79AG5auHbAcotxr79/XCQCGQJsO3AUj12txvXI3UQtwurhwAMRfES2ZvEzmlHFC KEsyoyqCakA72tD/foHQkIlx8d025zENvVSmUkhluwgrWXjJ+sT/mMhm9tTChKaE7QOw9fwJie4 wYMJ8YZkhcwFTFm+FvYXShOjCCOVT+dmN8WvFMVNi0HQqvWmik9+UYvfc39kR+d9xS7e/2I7DNS WR4yPKHLhbdcSFy7bCGECxQu2npU4dsSRTS+dKPXMlw63kf5mqT8DmiM= X-Received: by 2002:a05:620a:f0d:b0:8ca:2a04:3ff3 with SMTP id af79cd13be357-8cb8ca03fe5mr1202489985a.30.1771870080380; Mon, 23 Feb 2026 10:08:00 -0800 (PST) X-Received: by 2002:a05:620a:f0d:b0:8ca:2a04:3ff3 with SMTP id af79cd13be357-8cb8ca03fe5mr1202483585a.30.1771870079897; Mon, 23 Feb 2026 10:07:59 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.07.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:07:59 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla , Stable@vger.kernel.org Subject: [PATCH v2 04/14] ASoC: qcom: q6apm-lpass-dai: Fix multiple graph opens Date: Mon, 23 Feb 2026 18:07:30 +0000 Message-ID: <20260223180740.444311-5-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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-ORIG-GUID: -F4tK3rZ-b_7LQ60-SE_QbUyoacb6ZGx X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfXzGtHuSgwk+NE FVBD4PvlbW2u5r8t1HqloWAiUPk/0AWPiIWq9uusqASKIr/mWbtj68RqJTfsQA6PumnU02/AWbT M+GjXzTyagG1h/KBQyNxuI0b6vEvmhrvcxI9iyMFtuZ4b4XxTNVjkpUtZMTvU7d7GM+zVpbV30b CMNLfWTZxBnWaMENmVnR0X0G+pVQIoH6B1MLisvV2fkWsgaEpKmggGvqxkgajsmH3uEyGH0Cg8I 6iCBVgtf3tAJ9xBVDGzQIf3oQbpliUffZ2qn4n3xYOyBLnAm8XZ+s3jFVMpfUBTxiu27FMryxCc cJ4pGuAdTpjPxaf2qjmQShpG2fcwmdFkE8zM6wLRonkxs4UQjpCBsw+wZF8Tge3b6SvAE7DFnVm q26kVs+AjVPjJYg9PbTenZdXbWlRWaYHddSbe0XVJxIg5HfUz06BiKAEXFOj0ffnxKAQjW5xfL9 QNZmUWzghqYhY4sXKcA== X-Proofpoint-GUID: -F4tK3rZ-b_7LQ60-SE_QbUyoacb6ZGx X-Authority-Analysis: v=2.4 cv=WqQm8Nfv c=1 sm=1 tr=0 ts=699c9781 cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=M_mAHeyD2EURj3i0m2kA:9 a=bTQJ7kPSJx9SKPbeHEYW: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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 adultscore=0 priorityscore=1501 spamscore=0 impostorscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 Content-Type: text/plain; charset="utf-8" As prepare can be called mulitple times, this can result in multiple graph opens for playback path. 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 Fri Apr 17 04:49:52 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 3D38733C1AD for ; Mon, 23 Feb 2026 18:08:03 +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=1771870085; cv=none; b=QZos8gZoV3feHUnKNbnHtAi1UBfWG4l3/VudRPpmm1weyAp4w6v2436NfulWD4Y/rC7eHqrH6ZW0SWsKOrKfLOkv0G8Gz0eG5neYbn7sH2QzKYdRu8aYebXwo129pQqfA0fIS7YST3KrBsMf7UefzaOnc7zlhRup9pKPnYdoe/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870085; c=relaxed/simple; bh=D974qErk+eSVxHSJ/kOz4RqeA8U4H6OLfYkanxY/E0U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rg9XI7tbb8ACoOfiI4lMbAzMNkiAEmL+mAp3nLvc4sJAWotSWova3j9Qa33KWqpVXXY59btD7z3qeo834/s89Aq3/VeiHRDZszEZWUPvBuECvnSs9/aY+PHraz6fotc3hW0mpLb7bUUtTmNvQKA07ZJd7B1WqXtRhdlfT+75xps= 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=E5w2WyfZ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=eymNMg/a; 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="E5w2WyfZ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="eymNMg/a" 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 61NGRJ2E1640607 for ; Mon, 23 Feb 2026 18:08:02 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=UxOF72ZgTD7 tt4flWCIeDBHXEX4DVKcDbCAoRgYqJlk=; b=E5w2WyfZPUGpfO/3ef28JwgbvGP mNMyMsHpfSZOoI/EYyOggTRnwKFTq7hTwxWF9azVe1SsiKGGiTOEsw2ItVwQjG+j 4Wo/McvzGRVyMAwulQBJW1s4LvanvSULobCdRa/OGXC1wFAcWRlLhxZVz4lLvxb6 bYZWC3gxF85+vokzFfT9GKdv1TippnJQ5LO9cyJSkoro4SOEQKbDEIBonTeVDWpV 7zMRKBSUnlHlaOl4AM9fAFq2kbyLiqW7vK2WjRo2teOCrguomkcu99TQ4xIrHK7/ AvA+Sf8Zc762bSs4U+8/qWzKVm+jOMxIcVpdb2ikGpkg3eP6UUWV300oepw== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgte8rb3k-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:08:02 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8c71500f274so522243785a.1 for ; Mon, 23 Feb 2026 10:08:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870081; x=1772474881; 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=UxOF72ZgTD7tt4flWCIeDBHXEX4DVKcDbCAoRgYqJlk=; b=eymNMg/af40ZIDRZKkL3Z82uAVc1RyhZOvNBfjT6I578poDcbyjGR1mwNuLusqYCMC qZtMmGOwgZwEirxSsZMnVi70X50vC2Fa9gQnUWdUTxi1grRYUA/WW3lNvrahT6TX9why mHgp5iaQUq5nm5lTzEDywvGRA52dewODU2zORte54pjxzF4WRHTcCZRONLzWTG7u2JQF QSDVWZhylNwlNGssIzBW1Q+AbAoi7SXGvplzc0H1TcYYj3YX74WGpJLb0rnkKrrUgXHA TESfS9Pfec1HnFahxq7MclsxOU8PSwzG5w64qSCyhWXesQysgYlu7+maOGtW8AfDVWuR 9PEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870081; x=1772474881; 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=UxOF72ZgTD7tt4flWCIeDBHXEX4DVKcDbCAoRgYqJlk=; b=SQJZmE7QGZly2XBHDkB8JkUMdInlcrXghyE7fxd920SYFETHYXyBM9t8Jy1o4xCXWo ZFTfuO8jq6YAJ7Fc0yipEDmumF5lUdb0GXHuXdjVZQjm2EE8CMNF91pzHXqKk0sPb4ZQ U8Xo+4ETd9l85Ga7RwDmuqleBf+FO1KxYDbleRNB4dqBFTUfyEc7ZpqNw4NUMX3ExfPY 4LsyNCzMSySdTZsK6MZX4IXARCDg1fJhy0rtYAIs3RYkkl1kjITK077fGDKvkemFZ3WZ MZgUku+JHxgPEXsiC5+scDKr7jRN502W6rWwKhaXtce59wgFsD4/A6ZEo+xD2xs2T5wF x/iA== X-Forwarded-Encrypted: i=1; AJvYcCXEDoVi74P3+yjiNTyyJwaJzaDBPwNwGfSq7AG9ZIRP75WRdTb+0bDqzJapCDhvU6ZHlAKk4Y6JBNn9MhQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwBes+nTP17CDzMWqyqIjpaIXbzP2+uvXWTBER6obx3u8oKL0Kq q7P/TDXY+iwHiHkpbLPjVhY2Jkc01Vnf0TTXXfY2C2/OjbYX52kS/7heeVbT0bqwgXX5JNXf9AS OtathdglnYkChzP4O8eeKpGiOlTzDwH7Fr8SOInlNMo8CwjOP3PQQUOVneqZ7PIKWH3M= X-Gm-Gg: AZuq6aJS4VFg+UolfGK0L6B84/Q2JKaD8sQI+Z3n/M5BwSKq7S4NS2xCRpqzia4vIZA bbqMkBS4oaYzys51NQVFgRLsfy9SKS2Q4oIfGdzde64CV3r0aEDp5fTEk8UKlBybZ6caL7lqWPN jugl0F3U28NZ4MlfGohuCBKb6mz8jQWXWUopcfAORl10zRPt3q5HcgyqyM4jdAbP3YMJ4ZjFG0e N64q12nqTVZ2s2b8YQTsp5K5wvDGl2bQDVe/LzxERB99fLXTRMHC2+Bj6FXcoJA8yJNYSR4Ur0c 61oJQGnrDTPyYikkrdbqF4yZ/zFRwOPbZECOQyPQ8g0XXY2M07vAHWBn7ew+1tgxBUcesqbcSOX zGFfmcK6ns5w0FLuZWjrp1kxt9N2Brn9IXtbQQ532YC/6ouUMXcxImm8= X-Received: by 2002:a05:620a:4016:b0:890:2e24:a543 with SMTP id af79cd13be357-8cb8ca07cb6mr1259244585a.34.1771870081485; Mon, 23 Feb 2026 10:08:01 -0800 (PST) X-Received: by 2002:a05:620a:4016:b0:890:2e24:a543 with SMTP id af79cd13be357-8cb8ca07cb6mr1259236385a.34.1771870080953; Mon, 23 Feb 2026 10:08:00 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:08:00 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla , Stable@vger.kernel.org Subject: [PATCH v2 05/14] ASoC: qcom: q6apm-dai: reset queue ptr on trigger stop Date: Mon, 23 Feb 2026 18:07:31 +0000 Message-ID: <20260223180740.444311-6-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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-ORIG-GUID: 0EXTwTgTYLV9q3HOngWnKVFl8ikw7Uvr X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfX36EG1yZBJkAm T/77tPJg3J8y4U9MFE/wFn3F6/QZDuhkc88S5ijHbkNYTjHU608Ir7ocRXsD4Lfjeci1A3OrLg+ yxDEbPohYXeYfObMcNuMpDVJ69l2E4ltNWgs05p2P/nhUBdMWriqn93L6oqC2Ont21RMyu4DLeV ydC7PwwliDGtjNa4D6n2+rBAUbkxK+M25BzIlyN8JU9v/nCfLyPx9G/Vo+VG/AEQVdyHYzOde4Y bAMC+sy8hZBhshR30HM1be/Wi6YIx6Jo0LPLGbnk3G9YLJmL676Iclb3HUNfHVa0R7ZTs6RwMCx Ga/XvmGHry7UAbDb1Nr6PXYVjYDs08XeleJ7rV0xH+hCcscFLrwZosVOFZFx52b5POPvb3DDQRi iVi4j062x25lZ+7Rmvw7qKwtptv/nrhOY7wsvfsb1foYgteescyA2o5Z/9fZAxIBQxe9E5583qM cF4Xh+2fBl1bU8H4Y0A== X-Proofpoint-GUID: 0EXTwTgTYLV9q3HOngWnKVFl8ikw7Uvr X-Authority-Analysis: v=2.4 cv=WqQm8Nfv c=1 sm=1 tr=0 ts=699c9782 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=w9bA4Yi6UXS1dLCTJJEA:9 a=PEH46H7Ffwr30OY-TuGO: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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 adultscore=0 priorityscore=1501 spamscore=0 impostorscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 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 be8b205d42c4..4d2fa6a5e065 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 Fri Apr 17 04:49:52 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 58D5233BBD2 for ; Mon, 23 Feb 2026 18:08:04 +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=1771870085; cv=none; b=YUMMoKP4MNyUmLSnrR9ANYOCDWfBS9O6Lzb091Wu1mRCNsqcLc59me2L9jLxvBsA7Tl2/fvY8pZ86ePY7FMdKWFxM/eWfer+HKLkKweL9a8KkAWgNCA7qHN2AsO497TcnThsNMM3/vUDBxpfDYwgLNSAAuWFQfPqIiQ+aJwTQ5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870085; c=relaxed/simple; bh=VNHduoXGqlVxdzBtpgR9jvDgv6WgWm5Ys+b36xvTjTw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dJ151/B2fP3b297aUxPcxtNnRKQSg++XOfw7ngYrh9SOgKpH2DSDl+MLik6zIJG9UFm7hrk1pot1Llq6ftGboFzHKDRbWKYqGNBkJZftZ0uSy3Oq88Krh31AaoIlceMLdbZHcxxGOK3K8018n8TyUmebniwAYMt2tYUDKEKhQ24= 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=W7VvNPEc; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BDT1VdHw; 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="W7VvNPEc"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BDT1VdHw" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61NI4I6M1298512 for ; Mon, 23 Feb 2026 18:08:03 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=UDRf/+L305X Zc8ITbEbLHZrwiYXIk2guFDOZXnVMNE8=; b=W7VvNPEcpUGweUd04xr3LE/x4lX WPUywO+xtxf5tGbPnef+/PWJ4tZAyiT0zF0twZ2It4L7igg77pp1vyyQI/Oj8D5l +qBaqFQ9/ipoarwzwQhyxQkkAYy9VGCgWuWoziJ2bNUclS3wC3p+c99NDvtU+pDT LbOPMKgSQLMKVt3azO5loWp2+W2soTO8REQHi6o6IG7JV3/bb8kYD8jTPcGJsfJt 4/arXYV2oxFnd3i4+XfTO2D0WJrYYYNbArczkeDEij3usfrF8u+QotRh/KrlrnEL 6etbYEA7L66/VhygXRqYp+uQAPrgFaUXn4z7eyhArBUxIneMiRK07M14LSQ== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgn8y1e6b-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:08:03 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8cb413d0002so5166700185a.1 for ; Mon, 23 Feb 2026 10:08:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870083; x=1772474883; 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=UDRf/+L305XZc8ITbEbLHZrwiYXIk2guFDOZXnVMNE8=; b=BDT1VdHwpqPt3Ezx4uIhMwa4QIIUBtOT14QkdJ8oTaP/A/8tNE8I7UNnix9JBHNi1E YqeybRarpD/0HY921kSLPlmLWS8GNlpRv+ntTprOH+e+q9ihbxNHXrhQUfuLkIlR8Y8B jn+KnTtQL7znSIW2SOYfCiKlWhIlbjRj9acZYXAL+TSItyN0se48vZi+CvPfO1Xazwe3 gn746aDd6QfZOZv5Bd+qMfnjnLhdZOOu1hgvCDKF9hb2rsjPMFUwSfSCEZ+dccQ2OaMt a++9voDov9N40kzbgYY2uMPSfouMhDvwicjBv2KDOJsqz+JkrWKy2XZRIlrWNs/WrTWV PgnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870083; x=1772474883; 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=UDRf/+L305XZc8ITbEbLHZrwiYXIk2guFDOZXnVMNE8=; b=i+LGQjMFAxG/7K3WdmnEdkuNTJ2cz82gqHMbmrPUlvmxm7qo8M7GWTYIEuZF/JoVtf ON72ISsSWwJt1cAlmhMtIZ326jjYWnfyLUyUnQrPHR6d7nDl2XBpQEntPsz0HRuDq1Za pNT/IrLLX/bReAlq8Ou2hEFeCG66eAvcKubVrhembbHrAR9bvG6EXMovGhYXfZGHeIfw UqPCM7ystVzFtUlX3hwlv2BYn1nPXaVA6riPdbEFSrJEEzgR0NS9b+567fPWeOmIhY6g rGA900mCrn1IyLnWk+s3/GugltZiYNNa8UJXcCLkmMrgg5VKujyLPz/Uz9j8qprgVdj7 8New== X-Forwarded-Encrypted: i=1; AJvYcCVKOA3XZ4sMTb+5/qUtSjzmd5EJq+M7rbTR4iVFjH9yZabrAErKw9MxPqnG368OsPpFF8WpZSsHL0nCM8k=@vger.kernel.org X-Gm-Message-State: AOJu0Yy1mSX8su1aKCJGyWkDgCtCHnU7ycoJOFNKmOwPeaePvbNN2vsm HbRcw0D0aUmGEkMUT/rIJErFEnHxHRbWapPNztwwCMANxMFmgXo14+1edieYZfkofXxBYG0kZBL KpOlD9mnOTBdAay4enpI5KOGjCqwAqKp/VolpgGFJyVA0aVl8cm8W7V26AH8MB7VJrG8= X-Gm-Gg: AZuq6aJ1mZdM01BCqVgg6xRBi1adQSpAXefic4TrkeFPA60NEnhilylnRND7+O+hMG2 M87eJSgvQR4DrZ2GJriAFE6cMXD+wbxkQrs4DGIo7yhmHJH7GmmdfkFreOLduoljGCNPBlBUYp7 gCz0DYD6Qs19CCHAr6hfb6P8SJtGQggz2bA5NSkzwWKLtK91howg4OOu6XmVf5IE5fo++nQrf+o Fth/hSsrdmHdxEY5hzwf/G77qul1Q4Rs43z6zuiOPCV0avV0PJDo5Lu+toMXxOxhvn0q7dTiiSx oOiSofoc8vxPfMeiocZy5BUXoFFF3BR7Bl+uSK2FB+T2e7v6yHLqluDCUOBXn1rov5R0gDnK+dc Ihqr+W/onEQkY+Q8L5AIaKtR/EMfTH5VC8SaykP5KlpcKIm5h9M2Vmp4= X-Received: by 2002:a05:620a:4484:b0:8c7:3ff0:d472 with SMTP id af79cd13be357-8cb7be731d4mr1789939685a.15.1771870082663; Mon, 23 Feb 2026 10:08:02 -0800 (PST) X-Received: by 2002:a05:620a:4484:b0:8c7:3ff0:d472 with SMTP id af79cd13be357-8cb7be731d4mr1789934885a.15.1771870082116; Mon, 23 Feb 2026 10:08:02 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.08.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:08:01 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 06/14] ASoC: qcom: common: validate cpu dai id during parsing Date: Mon, 23 Feb 2026 18:07:32 +0000 Message-ID: <20260223180740.444311-7-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfX3lotke6LM940 Wm1ddWmrlfuzsT8m+g2WN04dT1aDzHKGRbpn05URC1J+yMKNCeLiUkIN/IaxT1wLix5V+U+uPxB VW/UEFXZx6w7TLn8LjZLf0s0evBrNoVxhUgv9D6jOmx5/cxYZsf3dVrvQrcQOzAhq832Q//usZF fXyLhJ2R8A0UHIVJVSrZVB/Vndwha/SXsIv71qgHxPwuKYxWayYXJF7rYEitHNOrqqLbp6DTeOL fEXJwGjt0IR3ppy6tMYm/TOXF+9clG3VlEhS+8FImmGP8bbf4EcXNnEfdPtv9uD+FWGimG2FqlL 56xAXoa5RsfABRw+loPEkMukPiCp8jjRB+axEFldY+DmgMPO3grkWHMahK+k+rc70zrxz3gOIVV RjQSVFGwiC1UQgqObRB7+AB+/KBERHfoVZcBC9F6lGJ1uUDf4dCBTgpOrfqBOBru1w7J8a41BWd haZM88E/jkD4HW2LAXA== X-Authority-Analysis: v=2.4 cv=edYwvrEH c=1 sm=1 tr=0 ts=699c9783 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=FTFSxu1yF2iZ1NjiFwcA:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-GUID: 6ju5vFMYbOllgq3O9qcnf4zZGNTQbyAm X-Proofpoint-ORIG-GUID: 6ju5vFMYbOllgq3O9qcnf4zZGNTQbyAm 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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 spamscore=0 impostorscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 Content-Type: text/plain; charset="utf-8" lpass ports numbers have been added but the afe/apm driver never got updated with new max port value that it uses to store dai specific data. There are more than one places these values are cached and always become out of sync. This will result in array out of bounds and weird driver behaviour. To catch such issues, first add a single place where we can define max port and second add a check in common parsing code which can error out before corrupting the memory with out of bounds array access. This should help both avoid and catch these type of mistakes in future. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/common.c | 6 ++++++ sound/soc/qcom/common.h | 3 +++ sound/soc/qcom/lpass.h | 3 ++- sound/soc/qcom/qdsp6/q6afe.h | 3 ++- sound/soc/qcom/qdsp6/q6apm.h | 3 ++- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index 7ee60a58a336..2f5d3ab1a353 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -120,6 +120,12 @@ int qcom_snd_parse_of(struct snd_soc_card *card) =20 link->id =3D args.args[0]; =20 + if (link->id > LPASS_MAX_PORT) { + dev_err(dev, "%s: Invalid cpu dai id %d \n", link->name, link->id); + ret =3D -EINVAL; + goto err; + } + if (platform) { link->platforms->of_node =3D of_parse_phandle(platform, "sound-dai", diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h index 1b8d3f90bffa..ab8061049375 100644 --- a/sound/soc/qcom/common.h +++ b/sound/soc/qcom/common.h @@ -4,8 +4,11 @@ #ifndef __QCOM_SND_COMMON_H__ #define __QCOM_SND_COMMON_H__ =20 +#include #include =20 +#define LPASS_MAX_PORT (USB_RX + 1) + int qcom_snd_parse_of(struct snd_soc_card *card); int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, struct snd_soc_jack *jack, bool *jack_setup); diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h index de3ec6f594c1..68b71039b981 100644 --- a/sound/soc/qcom/lpass.h +++ b/sound/soc/qcom/lpass.h @@ -14,10 +14,11 @@ #include #include #include +#include "common.h" #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..0b8c3ec1315c 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 "../common.h" =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..5cf538397841 100644 --- a/sound/soc/qcom/qdsp6/q6apm.h +++ b/sound/soc/qcom/qdsp6/q6apm.h @@ -14,9 +14,10 @@ #include #include #include +#include "../common.h" #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 Fri Apr 17 04:49:52 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 848D633D508 for ; Mon, 23 Feb 2026 18:08:05 +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=1771870086; cv=none; b=CSfS2XwOxRDUdLxRYGVH6SJduHiXJ56WWHGM9DKfknOF5B/mHwujdNn9KDk+S0+ZB5McCJlwLgcvgLYFhE+if8ojxjG/5kMreEQ8qfpiDcPSeihXRpReZwisK5/4NeBZ4ShrMXMeQsaW3G7da4/UgYMcNO1oSqtsAkBCYuTh9wQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870086; c=relaxed/simple; bh=k+V9np/k8kxcG0TemOtAqNElAc/Y6WE69Qv6f0bpv5k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ioT6B4QamSMyKxmagdpYa3jFjRWpbPbWAtBomBA2xp7JpDhwsXJYRT/iBQ9hBf7l6efiAmbtvcX869umF3voxqcX47MW7yHDZKekKqntbsmIJ5McTEYSlWVpw4Dh09mn7/dXECmpxaZbezUcAlbrOr7dQRlcjlP+ZUliA7edcKM= 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=V3UKlMMa; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=RpgfWJMV; 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="V3UKlMMa"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="RpgfWJMV" 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 61NGRH7m1640476 for ; Mon, 23 Feb 2026 18:08:04 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=GCQtUWK31BU Ldny6QyCqYw32AyO5oDoICxT6CT2h5Hs=; b=V3UKlMMa53IEVtRUvpH7OOtBK6F asBxIhDCVBZQEtmCbcMW6sQaHptOg3blPD5EBDC5GyKmcZuJDOGA/1dYHe57P6cG IrM6jqefjVFxlbTYQC4O8BRO0+uMrg9Snb3BkBrNYfjPuzk4ky6XVwuxGzffSqb2 fRIaqOqEcz46Z8alWfYDrzBGrzvFYM/fzcHc6O6CSR52ISom/XGRbI8ecgDJh9yw GvgrbCCrChoGDRdBbLQq+T0TlMgNrm41Ns9DknAewuadn/r3uOWClWJ0A/eur6xY FL+a0gensUDUHQmjafoPmaaDmGBlJKUL9OKAY8n118YGfCu1lZb875aJ/Zw== 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 4cgte8rb3v-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:08:04 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c71655aa11so6958589285a.3 for ; Mon, 23 Feb 2026 10:08:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870084; x=1772474884; 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=GCQtUWK31BULdny6QyCqYw32AyO5oDoICxT6CT2h5Hs=; b=RpgfWJMVf2S2h3LUnMKqMz1UuyzEb1sNmVFjdqRFoy6GygYwThVkdXUGCuHN3yMl63 6hsJUDGFg9eHmKDbkz8SqC+sAxvhS2Ws9YPTMELVnKRdec/a5lQX0N9zoy7vmUk7ZgNr sLXgAYdwtU3RJ4rxKFkkUDsWzKmzI/+PRwWv3bLX6k2wwQVV5LA7Sp/nBRbf+bPqrHmN Od1QpwBVLMtSJRGSLZfZSYOzCTwRT4OsnLr92kvfYtDTV6tAU8ngV0G+I4ZC0JVY8z6+ KjOBLWci/9DWj7STx05rnniHhS6aRZEmNHaxhjzJrDLwjJN33yQPJlu/E1orSjEZ8XpY r+xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870084; x=1772474884; 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=GCQtUWK31BULdny6QyCqYw32AyO5oDoICxT6CT2h5Hs=; b=SRJDg67nrFvrm2dlibvaN6dWjJwefgfoBdQ+gz9EGZmQi+tyQIT+/kf2dgD09nLkTj oTSBy7AbQwx0wC8MGRKDI4sFZVlbzTF/EVQWwFOb1f1wXjcqSgDPUuU+atbVmLBFcPs4 mEVZOaKKP0ECrfWJcUKaAlFP93QEqy9lyRgGf7QMd6WKXd4xUwhIZeu4rvJWkz147UV9 Uw8wkWBEq91sfIj1rfcdGY5g/QLLro+QX1SdNBt9eYzmXWOsGbc7D01XuVbwXMYYrWeI FuXGD6JCCdZlyM2I5SIr6S7MGZ2ZgfA57xuCvp1I791kRYODbtZFxbULS29G8U4x+a14 MQjw== X-Forwarded-Encrypted: i=1; AJvYcCW7dwx9H3+ZOMYokhZsdQGqdD972haRAOBdwE7BaAym1bKs4OIuZomOsLMjGi02jetno9w/E9I2xcnGw/M=@vger.kernel.org X-Gm-Message-State: AOJu0YzxjnkN06siYDaRjViMvzZXtqtUfQ302bQyscvyrfgb2//qVA1r 3QQWuIdJahXJfgB2wLDg2Lx7lcReQYp9mU519dNPFgOD9PblAqdPPvweqS9gr/p3EqLbPrydVTz sWTKL5EgyOb2jOIhGqJAxC0M/Do/VHpGLhNVsa3WYeY7JMq9yfDpvY+1W4CVj/l+RCy39+2hC8c g= X-Gm-Gg: AZuq6aKuTwGBAC4TibWOWIjIDqjobigqjKR59WqHi4OtTm4PKYgHyKz0ZuVk0ifWLxq xcoib8yS9VH5HJQqEIuJ8Ag5pHbAUFo9+21PBfHyyR30frFnBaORcwcfGC/xhHpdX/0FjHzWHQO enjL0UePj6GnZ7cfQOBjJPN+LdtlPEp6Q3wkbVX4CDaerNE4tcncJXjIbaHTUSwo1DzlJ9gBSgP SPSPXuZQ7P7cbwtmFKNYoSiLUkDOmATPVcPfq+nGzggzKdnu1LftmYTdUhcSktxLFXbreC6FgW/ 9LJL3x3mpWKhzJBpIsqP1cBZu+nRQHGnX6nKcrUYeJycJXo/lArbYiOIIK+CLbYG9M6tqri0mPY pRt+V5p/apkDrKzq3/MLLwF9W1uTtxvtWI5oznfCIV/ZCzQHF0x/MEWk= X-Received: by 2002:a05:620a:3711:b0:8cb:8150:b1cd with SMTP id af79cd13be357-8cb8ca0d7e1mr1183559185a.26.1771870083814; Mon, 23 Feb 2026 10:08:03 -0800 (PST) X-Received: by 2002:a05:620a:3711:b0:8cb:8150:b1cd with SMTP id af79cd13be357-8cb8ca0d7e1mr1183551785a.26.1771870083202; Mon, 23 Feb 2026 10:08:03 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.08.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:08:02 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 07/14] ASoC: dt-bindings: qcom: add LPASS LPI MI2S dai ids Date: Mon, 23 Feb 2026 18:07:33 +0000 Message-ID: <20260223180740.444311-8-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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-ORIG-GUID: mK31bfLYNnS68PviL1uhgPHLhTbY8bn4 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfX1mt0LGpoxsKo rWAj1KS/ZF86DeZI+Op8EQ2tvhu6p3IHFbV7X5qNyxRHOeUyiCMa1pkdacqmfB40HznINKlnRch O+BjwKwht8PzSQ+TE1g9ocSj5h2kYIbjU1P7YV74K05Mm0N0LIZ19T8avt+hlNnkWtM+bfS6FIl xuZzA1k7C9TTRKLgdy4lx64XmqQAU4036Vk4akU92P8GKZLQRPlwOXv1aW21cOkExnhUVUmsjc+ PRdtKxGd1xv+XsrH+AIGUEStsTkALbQeAQ2W0xFzi6H+NVJx1nFqJaIqwyuO8pC64T5kgLGht36 KhJ985Y+FFGfp1p6IlkwJq7P2hibXuCE1K2dTI0nTqB12piA9VXYZae2+kMPEntnh4+2tp7WaL+ pcUm3g9TNYHWvCOa9SePKUXQ/1f4RiBkx96zBojBWNzjzy2/BXGcbrqWi4oqgaJMH3vtFnPotwP QsyzYLE3YCHPD0afd2g== X-Proofpoint-GUID: mK31bfLYNnS68PviL1uhgPHLhTbY8bn4 X-Authority-Analysis: v=2.4 cv=WqQm8Nfv c=1 sm=1 tr=0 ts=699c9784 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=O6SSznAZH13pnem00RwA: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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 adultscore=0 priorityscore=1501 spamscore=0 impostorscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 Content-Type: text/plain; charset="utf-8" Add new dai ids entries for LPASS LPI MI2S lines. Signed-off-by: Srinivas Kandagatla --- include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h | 10 ++++++++++ sound/soc/qcom/common.h | 2 +- 2 files changed, 11 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 6d1ce7f5da51..e27a31ece1f2 100644 --- a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h +++ b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h @@ -140,6 +140,16 @@ #define DISPLAY_PORT_RX_6 134 #define DISPLAY_PORT_RX_7 135 #define USB_RX 136 +#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 =20 #define LPASS_CLK_ID_PRI_MI2S_IBIT 1 #define LPASS_CLK_ID_PRI_MI2S_EBIT 2 diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h index ab8061049375..85ca73408151 100644 --- a/sound/soc/qcom/common.h +++ b/sound/soc/qcom/common.h @@ -7,7 +7,7 @@ #include #include =20 -#define LPASS_MAX_PORT (USB_RX + 1) +#define LPASS_MAX_PORT (LPI_MI2S_TX_4 + 1) =20 int qcom_snd_parse_of(struct snd_soc_card *card); int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, --=20 2.47.3 From nobody Fri Apr 17 04:49:52 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 7C29733DEC7 for ; Mon, 23 Feb 2026 18:08:06 +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=1771870088; cv=none; b=FOUAF0EXajzg/rB5z2ruDhdn7Lstz8zH8mb6i3qUkBJOwXOEG67wmgmP3+BbeQ9AMQpjox0PoCN3AUPVpRD64madRGlMRjhm8aRWSmhlrJqCy/z2+QYJnEVbSstSOH35G2Njx8cV7vho+WMiG3AzJ7bwPdkKr4dhtj5TDcG4uXU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870088; c=relaxed/simple; bh=1AGWMMo+ZQ2MpMqgndQclqL9hoOIddPn00jRigW1KUQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IiZWHDdFwBQwcf5CIDnge8832eu2IHxhLZuvdijMlhYLLcEOtub6pdlp/eUs232xNogswykP/2r5OjBgNV8+gY+MuWa0hVdQ4/6j7eBLmtVuBD6xafcCkv5eUNZ6PVMrpo5UNmrON1Jk079z4TmOvmRAeGNvMkiTMmnycAycYCw= 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=VHs788gH; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=RGJEWjch; 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="VHs788gH"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="RGJEWjch" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61NAYcYm322188 for ; Mon, 23 Feb 2026 18:08:05 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=2UA23pg+dGV Ambwz2ppXfyVdk6xlbVmq70z85L7JFXQ=; b=VHs788gHBLElUvHdyl49YXjfMgO poFeujaOurmAB7oXuAfO2ltjQ14p1pkLY+Gr3BNDPr+MjSUaDEDIKI7V+H/fp0O/ 26YdVr5OHDhEGLeOqzVpZ4JZ+Yvs/R8DtXCthvi6AsqF8RdF6f86PXExyMCY2EGu cRzWNOltytisSzvzzbXu2qXVaAgyOzEyjUNhkUO4dMaO+IQnerGTOQosMTM+VrQg O0XTwBIfqJfLUaeS+SmJNzEWBAt9xaXB9RDJ8eHInYOWdB008x2MIfMu+ixVZMVD AxG3ZaGHzb8wUaqRyR7VhgFJnUDj0eOvSrRU94u8D4geQ64E9EumDOug3Xg== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgn8y1e6s-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:08:05 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8ca3ef536ddso5457075885a.0 for ; Mon, 23 Feb 2026 10:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870085; x=1772474885; 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=2UA23pg+dGVAmbwz2ppXfyVdk6xlbVmq70z85L7JFXQ=; b=RGJEWjchbTIeGDYBFh6UuZJKNFcMXcd9fh4iGb2HscvGwRKCAAbQy9TWdm7RCjLKpa wZeN1UI5g4zBWMmLcJOr+Jd9T6nn41ofw6H53Ezn6JB4tsquo3XvSDpgiCewjV06xYsv BENCyoocvmlf+t9aYR6il9573PiR5b+SgXkVJU7HzTcYnY9UlC9vFDQZFu4bDUhmj+GQ vKDR8JqKFDLqtsReu4KoDP/pzkGe/8H9qmXp93SuQqpQfx/eFTe1DOJNHHKNfDvUoK8D StZQus2A8toR4JBLLHkI9maSNM/9hAbAxX5KOJoW/RnzZTZGo35hjdgm3Lfdux9OX349 +MtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870085; x=1772474885; 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=2UA23pg+dGVAmbwz2ppXfyVdk6xlbVmq70z85L7JFXQ=; b=w3/0/PFrmW27AzEa++LjoBA15dD4c3QMZOSYt1+QyM1cPm8r4GPgkjrtihlKFGEFQZ EZgiFO1DLjS1FuzYseprlz6iyoVwzxXS88ZwRVGPB+cmkUQp256qUP5+nFSq8Cu8eCbW gCxCfmuRMW0Qyg8D4b6ywPfJ3KokfXl8/L0JQTUYzDQ9ehyIbXg21exs9KNs2fTYc3+9 6+GJ6zm9fc9cDJVrpN8YSBJRa6CcHpnogBfY94cjY79NUV3kaAl5VnR9BWKrxl/s6FxT zXeC9UF7/udeO+lla00nL52u/HLwfgb24y1JMOgCtd8NW5DcO3eU3Z1RVsJvXXXgC1F8 r7ew== X-Forwarded-Encrypted: i=1; AJvYcCVPeYYT9/08NxeHR8zyLflTdtgT0W3NKNRJANiY0/MUentrGCBvhlJ3A0B1hVTlVPQDusSS/nhFu5CJYg4=@vger.kernel.org X-Gm-Message-State: AOJu0Ywr37PSeANjsEjtbgZzNio0wdrpJe1cooEKoIvL6oA14dEF/Wn2 sj2x6Et8XvQL71q251WWdQ5dqD+vJy8JphV+Q2FNNdrX9RlZxBIDHiuz5DoxiDi5pszGGQ7hrP9 DhdPgBL3jDy543EweG658P3FHban/2l02QYEKnwVXyQOvTCsYO2sENVlkXKI7NJ4xNr0= X-Gm-Gg: AZuq6aKXtNNdcI+lH41FYOlShma4bbibKoKArd9XEZOy3uIoeVW9+HkrlkH+qLEzwBx Uvf+3U2Ftq2PwvXA6MtCp/e1yWsu+zZgij25jNAzgteA73SC+4qGMv/ipM0tff9Z0cOQkwFnuI2 hlVtLblWSrjChjDeJytkGUG5fPpXjNjD8FhzTv3hZHoW9f4OiVpSqGYqxFNFVWgDsdQow+q9STU CUXZ38mZopcCaTxYbCXuhBGRFtBO1/cxh9EF3CLg5HvtAjBHC1DL3Dj/5W4DakdNb09NoHFqumz pdNSTpAPD3DS5gIlVD4i379LVasWreOeDOBhpKn6C+7qadFe64MPtb19jDZn20QfR4MxWvCOCR9 EeBOs/JH/Vy+y0YWG/1KuhyAGeKEeiIuYMMA+f/g6ViqiRCVmjCiEFRE= X-Received: by 2002:a05:620a:4150:b0:8c0:d16b:b0a7 with SMTP id af79cd13be357-8cb8c9cda80mr1154634685a.2.1771870084902; Mon, 23 Feb 2026 10:08:04 -0800 (PST) X-Received: by 2002:a05:620a:4150:b0:8c0:d16b:b0a7 with SMTP id af79cd13be357-8cb8c9cda80mr1154628085a.2.1771870084439; Mon, 23 Feb 2026 10:08:04 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:08:03 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 08/14] ASoC: qcom: qdsp6: lpass-ports: add support for LPASS LPI MI2S dais Date: Mon, 23 Feb 2026 18:07:34 +0000 Message-ID: <20260223180740.444311-9-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfX4Z3VeOs0EWoC gScxNS8AsRTUQZWmT6tCZJO9wzG8TWX5hVyVm5p4uocKhQR0teC7l3cubaUKzXuK0AuinQTNi0I s+hnLfJ+9MaKWDoKJDilFz8JVvCp1TI/Xzd16stvCXJV/hB7HJZ2uLkc81pxfPTxlTCnkkjbKOq ACGJAKr6M2HuMkHu2HFeBrOrR87YQAHm0y+bLUeYRNtUTZqVoL3QTgqnEjkkEzW8erKkf7K2cx/ s0mAlIPWcOXK2IIyK92RCacesuJE0J52VcV9vcuNioenRy5dUVPo5a0gBEur8a4tKrpCP9nvUec BF4rKR04jNg8o96JtRoVedZXpmBEgwTTZd2KGrVZFXxVdfqi+xhn/QoG1FsHV58BKvGxw+e+8hr fN18EiZXWchGoJAXtUWrGKg+KiFXjw0XBEIg80R0HH8fY3JoLRnnZM92JSAcAcc2GZeu4tJU8gi 1ZBSYuY0HamnnB7b8BQ== X-Authority-Analysis: v=2.4 cv=edYwvrEH c=1 sm=1 tr=0 ts=699c9785 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=nvRDalaNTaWZAukup-IA:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-GUID: fvMMcSY0G84Xnvqv8BOEFU6n7vWFLjPW X-Proofpoint-ORIG-GUID: fvMMcSY0G84Xnvqv8BOEFU6n7vWFLjPW 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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 spamscore=0 impostorscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 Content-Type: text/plain; charset="utf-8" Add support for LPASS LPI MI2S dais in the dai-driver, these dais are used in Monaco based platform devices. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+) 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 Fri Apr 17 04:49:52 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 E11E933D6D4 for ; Mon, 23 Feb 2026 18:08:07 +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=1771870089; cv=none; b=KhMVQHIQTcEC0r16PJZxYJRqwwhEpmtQHgGLbGJbfG/6GZK04qv9E0oj3qsmGHj9DeRuMN4zyOLMmRjuqnHq4WN6gMeiEGyi4QDJOeLkDwXsx5SWVykZFzfWHTpAU2aLXOX3NXQtcwnIhO9nmASR7dOQrPjhKL7uSSFTrcK1N/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870089; c=relaxed/simple; bh=7a8FeAvNk5/WvnNq5f6gPOGdPG6W/kpZ8BVaxW/g9Oo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lw4OskGVKf7TFNRrqrFAcWIrKcWvGI7ljopkCdnjStcLyxnebcFKy1WXGyuVtS7B+TOMs/KRrlK+VNCGOCIJ5mhAYzBLmSL6y1yvphNqYRzSZcTM8rOfSoUJmNj4Cgjpn1s73B0lqdTMnW5ID2OHOH2CYY8+VIRVH399QmEZnPY= 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=YM3292cg; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ESirJL3t; 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="YM3292cg"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ESirJL3t" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61NHxmYY322212 for ; Mon, 23 Feb 2026 18:08:07 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=Gsm1SwBtjf7 DAueGLWMEyiZtda9HtqsqwTa4B2zHbb8=; b=YM3292cg2BAWgQ40lPIoDXbX0tl VZbDk7Rsf4VzpcR07tSC37mnnX2lxhw6q84jgATr0rVqU6IQaJ1lKyTdiR9h8Wv3 7wMTDSu8sYwDpy5oMkXb50RDH923ukTVRtCf/f6aPaqv2dkiYYQv5+NS7FB7BlvZ +fMLypPJpKvuvikI7HhGNiRWS2cDHckZVU+6hw5Ljek/wTwEvOz3Nv0/Kcuen1Ql SFwjRAliu5+EI7sa0OEiGC+jgtycLGkRnsuBQdpO7Sv/KX+I/D0TpsgHDaIB+mZg tV2oT8DWX/cCA9ixh+2MQarnjtQPyL8LnP5efOj2eNtVSwy+08nY5EuXw3Q== 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 4cgn8y1e70-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:08:06 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8cb4817f3c8so3913597885a.3 for ; Mon, 23 Feb 2026 10:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870086; x=1772474886; 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=Gsm1SwBtjf7DAueGLWMEyiZtda9HtqsqwTa4B2zHbb8=; b=ESirJL3tW633dJFL+JnaczQ38d2DKNjqh5xF9HB95OL27s1LRio8M1vAFpCCQ8ixve wqdZ+4rn8ds1nYZ2dQBKnEUUHC8+at/ZTc2z8a98ARMtrQ2RZkFkZJ0NLEYrF6BDqzsM G12k6C8XSylNGSyvbYk8qFfLO2lErTVRbThOE3rfp/wk7ILptDPen79iPW7Yv6W6NwQE 7RaEiulngQ8HrXdAnminNGnzqNrgiy2YjqunMhs9hVZ6FC8IiUgD61zR9iYrOv7t7Ad7 gDY5I3FfqiHbQ+uRT1pC8MtOQcUd3EvyMt3zHLfHmCPuAVR1uTG37GjQdhZ7hDa9+1oe nhwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870086; x=1772474886; 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=Gsm1SwBtjf7DAueGLWMEyiZtda9HtqsqwTa4B2zHbb8=; b=uHYW66V+amcxzdl1/GRBRItSGoO0D3vUt9B7GsRcZYtF0cptgHJo+0yNMXztknTIvI UHWJEhCfIyhisDnu6HeD9kGsKfhlh2ujbINujyRudtQNzQ3wVDKk5ZUoILZRf4zUd+Wh b32uFL7bb5OT7xLZ9ZA/GL7HvjH7+kOZ7bl6aRAQwbUEPPk+ctr4/JtRmtm05wW6M3OB p9WQXy9gAax9OPovvB2gc9MeNTFBC92LRwrcWZqKbt03fFofsiPbyAt0qd2g1qJ5Ij49 mzZM6/2cHwfOk4R4xJ0Ia0B2vosOJraWsFubMjPVmjU5ZBdS8JVmw87B99k+ZjNAl/HY wvaw== X-Forwarded-Encrypted: i=1; AJvYcCXn7U5ylAbCDoEmET8gtTiHavGyZbz/pafODhRYxoleudraGw3W6Qa8evJUZiqXoHGhLMrf6DzKFYCIFvY=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3LGxZPAWJxtqiXBJdbPQHTs4c8nU3szmHot6ZmrLLM+Svf87u ENNQBxaS5qer3BnYU6ElbQPsCdI0+mQ3wY+UvPOEsUpRlm8xhc0+Hof6fyfQW4ikMZqLWNGT2M3 cyb4OnrNxKFRyZny9GKX0jsY2nNh5FZwzNoKjYMP2DmpmL+1142hl/xtP+3f+At/fefY= X-Gm-Gg: AZuq6aI+IXFRXoy3SmPTNfGAqIvUdGayljRr92mcWEXfY6CTg+vJjVoeuaDuYn3WojF 9Y0Dk6fjPLI4EaIasRmmdS5kmdM8MkpqzxeOPv15k5AEgeQp4Otm0NfKCSRtCECRRWfowma0cEQ csm2ahN5ajXjnmGegA6qPSxLTBsnGlPGQeEaXjAIMtrG2fuYj3YZRRPhfBkRmCi9zI+zEbcBXhR ZnD23QGXsQDR0tINBgY11EjBmK/dy6mPwwSVKoLBp1gq6k8c0B7tEl/7repIpmQ7w8hWj0tvtkj 2wQ5MJ0pQOLGKb0PLiE0kX2w7pW2sFJd4mWS3DOTUb2+IxU4ZijGOPfGevMeBWbXCmtX9VlLg79 s3cHqQDDreE27sVwHiKn9R0MNEIz2iHQMqMIidfCuKoyjGbmImPfUqJs= X-Received: by 2002:a05:620a:44d2:b0:8cb:47b4:165f with SMTP id af79cd13be357-8cb8c9cdc29mr1199393485a.14.1771870085976; Mon, 23 Feb 2026 10:08:05 -0800 (PST) X-Received: by 2002:a05:620a:44d2:b0:8cb:47b4:165f with SMTP id af79cd13be357-8cb8c9cdc29mr1199386585a.14.1771870085518; Mon, 23 Feb 2026 10:08:05 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.08.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:08:05 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 09/14] ASoC: dt-bindings: qcom,q6dsp-lpass-ports: Add Senary MI2S port Date: Mon, 23 Feb 2026 18:07:35 +0000 Message-ID: <20260223180740.444311-10-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfX+giQu/GsPDd3 5sQHmfaprETkQaOCKAvvMmgGEjLJSvbHGVVEwqYONVD/UelR6WWth8xrQaqjDZABdxHFcSqyhTE E64UFHR8DRFBIOUdA25hFR/bI+PAGYrzevntsB+UtcpppWr2vdEa8uMD79aETMdejvCvAlt8P02 7q1kgYx4DU0jRvQBKkeZDirYkB4K1lblI4ZUMM/E7/5O9l8IkopocerVfEZ4YmbMMiPXw97pb5X NzXA52c2NL7Yv8OkiN1YmsR5W60NunzweiTaVs0BTdF8TQz2+IVaaG9T3gIMye7/bjoWSsxPuVK VXYVY1NGxfcN1k9SumhPp3npmVVru3RezUR6ZipywQKBYZkC3dzPF23aAFXP/qHm84Q/ciYkZ8B VmVh82qrEY/lXmI1GgaqpH6j/oV3PF5+2tLSRD83HbAu5yqEZfRm0yTZaA9rFJYV5kMoqgfxBFR xHcG6pDOitYBOjVmfXA== X-Authority-Analysis: v=2.4 cv=edYwvrEH c=1 sm=1 tr=0 ts=699c9786 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=S1r85Wze4wKqmHhc2Z8A:9 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-GUID: veUUKUD5TLOwHB5e9GuICvZSp_yF3x1y X-Proofpoint-ORIG-GUID: veUUKUD5TLOwHB5e9GuICvZSp_yF3x1y 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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 spamscore=0 impostorscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 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 | 2 ++ sound/soc/qcom/common.h | 2 +- 2 files 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 e27a31ece1f2..45850f2d4342 100644 --- a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h +++ b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h @@ -150,6 +150,8 @@ #define LPI_MI2S_TX_3 144 #define LPI_MI2S_RX_4 145 #define LPI_MI2S_TX_4 146 +#define SENARY_MI2S_RX 147 +#define SENARY_MI2S_TX 148 =20 #define LPASS_CLK_ID_PRI_MI2S_IBIT 1 #define LPASS_CLK_ID_PRI_MI2S_EBIT 2 diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h index 85ca73408151..ee6662885593 100644 --- a/sound/soc/qcom/common.h +++ b/sound/soc/qcom/common.h @@ -7,7 +7,7 @@ #include #include =20 -#define LPASS_MAX_PORT (LPI_MI2S_TX_4 + 1) +#define LPASS_MAX_PORT (SENARY_MI2S_TX + 1) =20 int qcom_snd_parse_of(struct snd_soc_card *card); int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, --=20 2.47.3 From nobody Fri Apr 17 04:49:52 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 CC56333FE18 for ; Mon, 23 Feb 2026 18:08:08 +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=1771870091; cv=none; b=AQhre5ZPdttZlMKCPDTc+2v2MaKKXwDLAoTMeBNzAUIWGMMu5fwTECvExsuwBvYuvH+c4IsFK5caSwyHfMEH+Q/cEkBQ6DyAVXWCU52QEQZn9jchMXd39vXf/hdUMXxEGZUw11PIlhRENK/qYSichpDPtCPWS6S5w00Qvom0NwI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870091; c=relaxed/simple; bh=mDW997OLPhj9/cZiWF71LObptofAy2aHxMQZYNVrW5o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dr/Gp39Al9/ITuhp2RrIcchkArlDS0MpBTag/UmuyXy3cYojGTRxLftqRgIZy3J4Qr9mGJZk9/azXXiCQtdh24XggEDD8ABlXvsdYLx4yQ7oyahGBoTmwOGF2pvnXR/HFpKxEk8jLoIjqJgiOOpRFB8E7EXuLoEYPaKcu3d647c= 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=L+hQOrXQ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aLEI8HUL; 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="L+hQOrXQ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aLEI8HUL" 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 61NC2gTq3151767 for ; Mon, 23 Feb 2026 18:08:08 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=L+hQOrXQbXJniDzO4nBsFweSd3B olomAKEZwZKEIJsNpBTLPBoQdBs2Keg6WBe61e8MQrxQF9UmpBLNy09U/4XFW4AW +rdl3ycpSjAFWVH+mp7n+hzfYg8EZXgqut3zu9Oi3f42ElrZwM2AyhVGEXeB+nbY K6+Y03yuiZ6yR0BLbFX+n0B4Gbs8SsR0ng3hng9G9FHj1BpipH0vWyrq6SfERTAS GkXaXon/QUjXsmz8vFXSdwgqShvOB5rOSWs5IKOvLK8UNmGL3QsCz8YjlgpfzvDt Lg9Qk5aSbJ7hoX3Mm49+jSjIsRq69GDvw+hPRDtTEU39uGgsPr4coJxFrSQ== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgpj895ph-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:08:07 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8cb3a129cd2so5843944585a.0 for ; Mon, 23 Feb 2026 10:08:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870087; x=1772474887; 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=aLEI8HULI/gaz5RKeC7fKv3alYEmJ8Jp4TOGhgkMUqlLKEiNVJgSyxN6unILUXQfNt 1sBr2+vyZnEvP/4JdaWTHuEHIc+uxM5zbRYycBZjMeeQUVt5tYVepIpNzJcEEAbyi1bN xPz4Sa6kEqHDdPJ/tupj6vLhpAYe8fhkdISVTz27E9QTsgb2gmxS/yGSFgYtIKRWyrjq 3sCUkNzTtzLT0Yic/z6mYMpOfEiKmfBZcX1gc4S1VCozagQ0TXtnnU43NClImZgJ1QMX g1j913MxWKso/ewHeopJZO34ySxJFNh+Fi3YQaO9n1RfWaH6hu7aTTKgAxw2eBv+166h 2Qtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870087; x=1772474887; 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=a9ASYk90QnBeha3bf9HYVUgEdZXfXq3E+7UZ50zu1CG2Qt/Mu07gY03IZOKZ7Yusup 3/Y2tc7MbUvLmFgHe/YjzfEA2STB/9rtCqVu1jx3O24SI3y+u+t43lDSSwwMaBb/T5wg DzxuHl9lcJ+LEp+oQVgcAszz6ivnbi+RIkTZLW5ch+DBIJFIAFvKDao/188XCehrUw9W KECSQKM3y2OtNNXgykvZ1z8Zv6LCeM2dYIA9uGhPFVX6NGDUGnAL/WPT5Z5IchCih/Sf ZbVY4Q4mzvf9iEesx60CzDhm6VmZQyEN7q5//Uu/7XACnIXypZ6d6d1u4ybPkxvV9M+n T/Hg== X-Forwarded-Encrypted: i=1; AJvYcCXbEtHA06kHJ10TvWtCivCKXtLx+ohUFW8+9S/HQkmu/9q+Gc0eThul3rneCl5vtHPzTF2hvGk8XNC/Yd0=@vger.kernel.org X-Gm-Message-State: AOJu0Yz496NDGZ8q91qAX9CtSpT9mdU8iSurS7BOQtpeTf7i9+F5650z touE8EvJ0AVUUSqTZE82ey2+n3h6OCl1xFeMJF2DgFk1zVedv+9BZ2R0KZxxGvuW2w3U28qmHFu A/3biZgCbWv2nNBB9i46vP7hb10cuC6xQJGZEpNVPHQXOJgTkmxeAx5DerQd6vIbFn+I= X-Gm-Gg: AZuq6aIikdsALwveoyDopkFiXnaXc+txg+tRyY8bl/fMFw0zN/KQV0BPEJ30cLXwKVK hW93Uv1pQmppe3UhstFelI1ost5Bjm3DfEVhCYGnGVrkGJiPxT4a5cTHrrtadruDyshRTzCWVtD 3LQAKkZcRpHwOr3wHXyzuMyA9TrLyaSlRf35IT+5Kx4pevaqPcJeXA5fwcmx4mXj6N/RrMUU+pp a2DyG11hcCaOdVc0qLbSsIcoNHIvRn/7pZ8H0NCyduc77ehqCCS4aL0Q/QeUktSR2IewEvtXmTO 91YiAUxHV/9UxvxqX4czKppfR8uiWOmoS9kfjW6qECkoKHqndPdxblLX31Qw6gi4lEJXOeg/tQz Zd31TNKqxd/CZsulR04CSWy8gZm9HoyVZfcF3sRjauvdrMsyOmQTLOSU= X-Received: by 2002:a05:620a:7084:b0:8cb:5c90:dd6f with SMTP id af79cd13be357-8cb7bfe78d2mr1905588385a.32.1771870087169; Mon, 23 Feb 2026 10:08:07 -0800 (PST) X-Received: by 2002:a05:620a:7084:b0:8cb:5c90:dd6f with SMTP id af79cd13be357-8cb7bfe78d2mr1905581185a.32.1771870086629; Mon, 23 Feb 2026 10:08:06 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.08.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:08:06 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 10/14] ASoC: qcom: q6dsp: Add Senary MI2S audio interface support Date: Mon, 23 Feb 2026 18:07:36 +0000 Message-ID: <20260223180740.444311-11-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfX4/QDAnhgSgkl dDLsi5CKBhdVqx2FUdw2l0mR1goNEpx+luYEFZh9Pi4Ufaf2PMxfNy77t/keKzRy+GTFobP+Eqs Pb1c53bR0yIEJJ2hbJPZ6XTdsRVwp/TZmQHJ5pDrb6br3M0PoAwSr03TDnQlpZ3ynH90YAVsow+ 0i3kmxQxBb18bMmhrWxxaLrmHPHjK+WvO0XolknSZhVUkUPXH6MUOIbW+jz3pGTFA5GzM4RPqyt /mKN+96fxolU6kmBEY1sHdS4dVzU3h7h9sGYHmCtAEFpVVrWtv0vgW0cGDi891KYJ7ZKNCOIazX Lqm4OW0bzQB23Hb3JEmvj3Rv9HizXxDFSfT94I0+FeqRPfImFEMCZTdkVc9J7pc9ukAgkxDAeu4 Dne5EfxF77DcP3TZ1yyLct7odn6nBtUuUvzF+jFEJfNVcAMSZ7xpUMDXsKkp2B0fIKBzwQ9uK6g 1fViTpltJ7In1ub/hww== X-Proofpoint-GUID: QaBWUQceo2rpI0h6ud10T7eXpQR7XeFy X-Authority-Analysis: v=2.4 cv=Z5Lh3XRA c=1 sm=1 tr=0 ts=699c9787 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=aBFzMgE2VLA-TvnT3JMA:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-ORIG-GUID: QaBWUQceo2rpI0h6ud10T7eXpQR7XeFy 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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 bulkscore=0 adultscore=0 impostorscore=0 priorityscore=1501 phishscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 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 Fri Apr 17 04:49:52 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 CBEB633B97D for ; Mon, 23 Feb 2026 18:08:09 +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=1771870091; cv=none; b=Mcd8Sb97mtkeUoZrz9Gr/q3papET+cF4/N1dvcrNueosD4ZZgeiTzubhQ+kknwsAQJL4nrZyjt7hGHV+Gw8Tr4mzUWVfSRLPz+RZXvUOZjNEmB/Ofh4ue825Pz79qY5RO6GXUpdJo4hYt4nmEpIZbXt4mkYzeTxEcfZhPTaErTM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870091; c=relaxed/simple; bh=sSGa26gpWdI3zubzr4vR8voY2ZZ9uOTTFQpEZo9CUFk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AsOFuGKtAkBsw+q3So0XpAVpmg54z/RgkEnRzc4fDBacchuK7+NIxHbdEQVlbz5FaI0DNryUoxiBTviM2EM4QQU/AxPYqMAxhutL4Kz+fiPIswSbj7tFGYOlq899iDBAUvYdUqJYcauNxPmIF2dKoI7P2an/3Cu0GFkmQZFCsaQ= 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=MDwcp8Bf; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=NT1eaPuM; 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="MDwcp8Bf"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="NT1eaPuM" 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 61NGRLNp1640663 for ; Mon, 23 Feb 2026 18:08:09 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=MDwcp8Bfxy0VgGZWJDylw48t4FS bYHoWtHaXMuoG/0tq7FLaYjsZbWhXJ/xBMHFLTR7xLQdy3d1m+D5V27hE+bKfW68 iyzHM27H+8+dUxOf0X1bykUAATwdC0HIjB8JznuYJ06GFG0pdSrDFodGY72hT2vF aw0tw0t4BGu+oaxZ2ir91aVeOWd3qQcZuBWx5r/amHh5iHa91P3LOLENkRvk2Jmd SACHVlmp4KLCNfJWsjNiHMNWw/fbbNJJ3Son0YDWZ2mTTX4/U+QlynKDdkKanWmD C0NeeW6DWJ+WepQq/Aez5HDT3VAsT2JCD6pSf8B5fBNxeFrxW0jVEzHxfrA== 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 4cgte8rb4c-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:08:08 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8cb706313beso657499485a.3 for ; Mon, 23 Feb 2026 10:08:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870088; x=1772474888; 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=NT1eaPuM1w34HVNY7gZFlfEA4h2DIXExkkMtnUVl1yMIX8XICoZ7Tpc5IohGAvFG+3 ESggBOYvowdRZwBHpWM9hXIlUitcrR4hRIkJDshQy66FkH3oA/zAmYyVnbDP2w4JQuez /bRn5MZkS4RUGoShpaN2sRb7ST+ctm+0pX8yz12xB1gybLCY5l9UC9+SqkqP40MgOVqi z+lc3iGDht9wQVP0T8ggH8Z+30wFQixEQYYMk2dwgDHng+r/xiOnML0K+bblgl8XhOMy BlAXdI1Jphtz9XhECz3P3noSeZGrY3TG7ZvwK9HMvjJvdD5k2S1c/ZcQ+WLN8t/5iWHG si0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870088; x=1772474888; 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=sTSZJgQ6kU5k6HQnfPjA9x9PdDYNeWaQW+4eAXp+QXe8vgdmY1B/vIYzEpCCSzORPi N4i+ej1zWDOmzhP8zdcfca4UEL3KOArVkD+j/63Sm0+6cCf9x1Sj1t3OhxhyyGOa9BBQ 3XPe2AmQIUFKEImjEh0SOpb+Y8jRcAJCxH60IYkEf56CJ3GE0v7mo3GLA+XqWzpxHeP7 cPhkbKf9V4NUBhd9MThUFR7Rk1IW8eaiDSD9zSUXDYGd39fw9Y2lDw9WRvazjS2NpT6H UCz8MCxde0l6GCkJLYOSFnDBKA6E+KfX/2gGsvqSpnClDJyjZ116OWeGNUXCICwLrYj2 4fcw== X-Forwarded-Encrypted: i=1; AJvYcCULI3Q0u0WJcM4I+611zUVQtnofWG+DbHpUDz/IDaOdV0j5Sk6EixaLV0oDy/Pd4HVifbmsjOOVBVUZgJY=@vger.kernel.org X-Gm-Message-State: AOJu0YxRR5f6nE/VQjth/DH3F+HcYxb6IaAAbUNwT2bGhc7VBS86GeGA ci3Gv0odCdy2BjyVX+J2EaZhPnCMICSaB8fuhmB7XZcD+swKhHRKYyxyH//WlY1PbUonIdhSPiy yHaLBH2dkEPPzoYaSXaIiGlfhI79S/E/YuQnKLFfRRiKjzEEa5nM27+nX+E5jORx6iZ4= X-Gm-Gg: AZuq6aLGurpWIjTPlufh3KL4Wof7zYfilJbfAj+DeGN+slQg62TvRfEFI/VastWc1rd waxSPse3h+s0uWguM19ai8zIkK0F6LL0pKXjnvEZ2aSqm4Oit5f7HsAhWT96HIayhG75u/oEllx S71X2BOY3ToTz7HoCtMw3B/qy0A8bRZaokx3Gu5DbsyW4EDWWegxisVXZkDtQjYl1aGLFUpvqLw g7ZMvLGTt/M5UixRDOtLLnla4qXc/S1A/PYk4b6YBmlCHK0jDvpPpaK7DHj7sX37rf6eAq/CMi8 nprxZCNUSrFDNUpi59qaqyWWe7SF6qe4BAuewqpHn0Gg1LzmGOYUvbVDPZk/3unQF6r+fldpDEf qwzT1+Shh1aqzOrFuwjY48tcoUHsc3dsglpy7dXTryKKSOoBBRcbzaqg= X-Received: by 2002:a05:620a:414c:b0:8c6:e0c5:7bc0 with SMTP id af79cd13be357-8cb8ca1557cmr1140796485a.36.1771870088174; Mon, 23 Feb 2026 10:08:08 -0800 (PST) X-Received: by 2002:a05:620a:414c:b0:8c6:e0c5:7bc0 with SMTP id af79cd13be357-8cb8ca1557cmr1140791085a.36.1771870087683; Mon, 23 Feb 2026 10:08:07 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.08.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:08:07 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 11/14] ASoC: qcom: qdapm-lpass-dai: correct the error message Date: Mon, 23 Feb 2026 18:07:37 +0000 Message-ID: <20260223180740.444311-12-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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-ORIG-GUID: 7QjruNDk9pGjZEAEv613VkNt-1ATMw_7 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfX7+x9T5zorirS iS7Yst2993XAkswokYya+aivPgSvr0b8fKVSvmXjGEt+n2r74YE5+rNJxtXxhSjj395uIb4Wy/b 9sbPr3AKwAC1jXyLQOPS3AfpbqRIUA/tTSN6JtBHBSF9efilMc8DAAXLRXn/cxH+E3eRx8lwqPT pa5UNO4QARrCXQ6GW3MJJyM0Oprp5rUVxdo5eBLMrdZG8GlPQZgfnCTJvjDso3NSf71rUZ61iTZ bC+vUE9MPDBNN3g18VXDndWy3dbgmmja4dgCAXi2eDXTNjU5OSEFRJjZB9ztmj1ES1JxTbzOTSG bL4UzpZtswUcRZd+cglL7dqsi0XzNOf/ecxWSQv0TkcKu1oF1BGtHjMz68EtkXSO3Mq8fE09XPn ENmS9yySt5w9WCgWRJxZJZJbhZA8blw93Z/Umaxi72fft/HmgtG3LFxRBvweDqNts2bUWWAG33H S+DjOyrqVYX+BQCibLQ== X-Proofpoint-GUID: 7QjruNDk9pGjZEAEv613VkNt-1ATMw_7 X-Authority-Analysis: v=2.4 cv=WqQm8Nfv c=1 sm=1 tr=0 ts=699c9788 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=QkacBUY9L2qTTJrEq-kA:9 a=IoWCM6iH3mJn3m4BftBB: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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 adultscore=0 priorityscore=1501 spamscore=0 impostorscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 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 Fri Apr 17 04:49:52 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 1804833FE33 for ; Mon, 23 Feb 2026 18:08:11 +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=1771870092; cv=none; b=L2Buv1ErpOwARuv+xcL7Ep+XaQtGSdvDbQ6dWYY2gjo9Ql9cRjiJWY+s3QcFMWVOFF0JESVhPba2CxJ47TiIIx0x2rsXtjKeDub/QS2mCNOJwwJlPrgWelHluKXT/mSmA886ZetUq77IUg7hBSbrSJMiXvRtaB73y3JMcGwtYH0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870092; c=relaxed/simple; bh=of9TZhkCmOwqi8Av+ZalSsyqicycETefd2AuDqb8z5o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iFSPfhumi1Lg+mI7yKq/r6t5OQC5ryVg1IW1ZYeMCp3abuMe4jGuilLbFJjS5J7r8ma4HxYpYAb2ZIgOHEjNcF/C+7ygSpaIHaw46HZ0YMbz2nUIm3z3u03YLnJ1fmE5D+safnlKhknuQGl3YwSDcTWDFRIG75RCg9RGzoLesSQ= 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=LMn/BEuo; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=B7PFlQ0H; 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="LMn/BEuo"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="B7PFlQ0H" 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 61NC2lgb3151897 for ; Mon, 23 Feb 2026 18:08:10 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=Fo61YxjbYF7 2rFe/cKgeODqKXT2h3ZvNykR8OD9jyxM=; b=LMn/BEuoelk5HFYK0HYIghsC3MI uZfD3nom29430XxF7Sm1zNTXvu6kMrsdKKgN9n2RnwyY8mk3AAA/fHBCCRFzFbmY fNUhXQ5e4s/hG9oc+80p7q0ym3dS39ccegvVcbq5eaJaB01XU6JKSCkt1mZ8ADhp 2htBu0cwDsqSHL9PJPdfpHb0Khal4N2pwzVN5JGi9Fu/Gyrd3N98XKS6FVKJ3wHn 3hUgfjMT7XPswFVZSeDT+vyrGfA4dRKWAj5tpzQ6PNoq9YjGPJTIEpRfS8AzBsOG OGT0L0zq3ALk96RCRcKe+AsFAim7NWDNUWOPgNA18Wsyr3Gt2Tgb3e1IWAA== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgpj895pt-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:08:09 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8c71156fe09so3997259385a.0 for ; Mon, 23 Feb 2026 10:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870089; x=1772474889; 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=Fo61YxjbYF72rFe/cKgeODqKXT2h3ZvNykR8OD9jyxM=; b=B7PFlQ0HBb6gQjQikXN0qCdKy0Y2WgwSNBVJYdfYULJKBTOawzZ+t5qZcDXx786bD3 N35Ndk3yF096E+6gE4IrRhD+T9jgEMhMU64xH8Lpw9Ep9FgJ/IJBNk+RKcQ4qVdamIXP VmmQ6Cpw0TmWdt9VcxnaiJ6T8wlmNf2VjG9IZlyL+oYi+uKRTIpCtRGGHZTNbYccWfNV ZlHX3ZK1jHV8DnoM4alLTCSQjmP2rUCPKUjdOxSGFbVhkMj8M+sjGfFgy+6Rzr+G9NYR tXuA6qgQv6mPbasA3XUiv/3lwvP9DQv391k8s+JS3fxjanlpe2rjvEp1bcEgKFQJSf/3 9RsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870089; x=1772474889; 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=Fo61YxjbYF72rFe/cKgeODqKXT2h3ZvNykR8OD9jyxM=; b=vvCA9rVtkq8L5XNmBDcg5gbyrPZMdqP6GXCKAcLN3U2dWrz12rPPe7xF7dCIHYlFis XKj2BLCTgor0H1Iz/qtdwMEeo+r3jrm2/zbdIc9YQ0fN/l5ijXOSvyWKVRQzUFkfP+Dn fOSAIZvLSlms4R7cQ3OfsNMy2YyugIpfi6QO55ukS1pvFZHbZJVHZzLpzfajYevwSj53 ZDU1DX1XoNAsD+RRCIVShFaPrTjegy4DfLAKqbroF6JYN2r+80MNskb0CaKBBbWGt04+ ashN9CF5Q7CU2D1jW3NVU3cD3H28y+ttmhZK1Syrb8QyAXg8PfRuVemSvFSjSaKlLgHa +a5w== X-Forwarded-Encrypted: i=1; AJvYcCVsWVr9MuYYYJVJULXExBKwsi2/CZdsdYLBJ/zN35q193T5Ty1dFeHGj1lEpbu9hmxwZPjWAqc/n2VMreU=@vger.kernel.org X-Gm-Message-State: AOJu0Yz9n7soicmXHD34opOF2GvmDws1hVKTSKMPWeKLKE8o4sil3qVf W1QOsqd1YejysOGjArotTo/p3S1IkQU+Ev1eTghmgdCyQut/jukDQcHTw02MpY5IyWZKfbyujt8 jNv1btIcPb4ebfeddSBTNlesS0CoveppR9jEmdK8HEimQNcoMu4xnpAeQYgAM4WSWzD4= X-Gm-Gg: AZuq6aJJMDQ1i8UD7J8D7XWO9uYMH8AbQ/jna80q7i3C05UntiwxE20s27njfyiMwow q09zbp1pnVITHJ96uN7eeK0mY8SFKHcvkTAV+psZ5KiUR9a7bBFmzLP7SKFMW1dSNJWJeIxcigb UeSEquAdjNWIkgQPfCXL++eKz/ftUwRFazG0dIEsfQIWe0o3GWVoL/azVyEAT/xz0jB7llfAeE2 EROR0WHsNufW1gaQFMXGd1WZb0lImS9Q/KXOybJtdWjUa2MPKVVmLCcTqlgKG1X4bhmqA/+x4K3 xVfyfLJmrgYz/udBJtG9kC4ZVPxtccgXG23pt62vMXpOENguBTKrID7RaEOaMZgdTjZP+pD3jcz oU9epRQSE8Vlo45rUHdIJqODVvN9CrGTlGKbCeH+y916XUT6nj30nj6U= X-Received: by 2002:a05:620a:1a07:b0:8c5:4e48:c908 with SMTP id af79cd13be357-8cb8ca02f8cmr1203872185a.27.1771870089286; Mon, 23 Feb 2026 10:08:09 -0800 (PST) X-Received: by 2002:a05:620a:1a07:b0:8c5:4e48:c908 with SMTP id af79cd13be357-8cb8ca02f8cmr1203866485a.27.1771870088753; Mon, 23 Feb 2026 10:08:08 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:08:08 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 12/14] ASoC: qcom: q6apm-lpass-dai: move graph start to trigger Date: Mon, 23 Feb 2026 18:07:38 +0000 Message-ID: <20260223180740.444311-13-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfXzVqUmGgCVju4 NTIUjMXzEVGTF6OyG/wieOBJoyWkGuEM+zsgoLf391/luIcZswS8ioKOpzKykDWXShlFLgbN82n EkrlfdN/v1UkrUJpTK0OcKdnSOdhi1TfRm4YC3BtGVv22ez+pE4gEpQgD/DJWOVejmDfAQlnHvl N0FJ8wzbo1POMRqMthxPOu1AoqLEcbTpwu8yyipWP0HZw63LMaa3YtacNRsLPzQdkibUDqpLw/4 Xra02EPvsu0ENoP3tZduaKXvg50vi17n3BN5X3CzOs/t5K31JcaDCycBOEHQj6TqH16rYod9ei2 hK1HRDl6DUZQHhODnGKFHKMgZDUazzrYivSxThoXm3Me2gqOudO2gJi11CLNK4rEepEB6K5v/Ro fwoiUmVpSMdJtajRJKDDoj++RiJ6e5TdICK5duYPhzC5SJihocxuah1L2Ni1FyPQcFhyzVsWLtP TqZyxHg38MeFLLRFTrQ== X-Proofpoint-GUID: Fp63ir2O637lj0s-2kp4FLX8O_cQjt1w X-Authority-Analysis: v=2.4 cv=Z5Lh3XRA c=1 sm=1 tr=0 ts=699c9789 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=6WiqhGXfW3rOkMpHEiIA:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-ORIG-GUID: Fp63ir2O637lj0s-2kp4FLX8O_cQjt1w 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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 bulkscore=0 adultscore=0 impostorscore=0 priorityscore=1501 phishscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 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 help cope situation where pipewire is not = happy if display port is not connected during start. 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 Fri Apr 17 04:49:52 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 852A134251F for ; Mon, 23 Feb 2026 18:08:12 +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=1771870094; cv=none; b=RJaSUAHEFsLfTVsb7+S69v6pN3zWOoPYD70aa25tbR0Hec+XBwhrydgdawgBVl4G8lnz+yCMCo+CNzsaqY/ccKpqnKtg2frRqxdpfQOdH8PuFabPf97zcVbLT1EpBplXNCQ+jxvGkn+LN3jrQsWlqOaS/xLCrOzEAVhYQWx20Pc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870094; c=relaxed/simple; bh=NVZa3idAxwPxHPw+u7Mq1/ZN1mwjSvFYiQs8fkW3ql4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X/5bUmGP0qKqYdSbGTBZ6kLeQmU6Vlbjes0R8PzPMofIzKJL+1SUyM8ZByUfsW2USUAo1UB5b9SBVHY0D49ewIMvS+OUz2TRbTZ0m5LMA0TMvF6WpnGhdkAgIwRyh6Ue6Hbtk18KFeJGU3A6dg6H0Fn/RvqZjGUfpSJfHWkk53c= 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=Se69yvdF; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=WTf7uKgS; 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="Se69yvdF"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="WTf7uKgS" 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 61NGRJ2t1640611 for ; Mon, 23 Feb 2026 18:08:11 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=n6CVcQhd946 ciLSkWGVm71la6+p58QFjgnyvS3NZYhA=; b=Se69yvdFbUZOcHhJlaeb4AIgSA/ D2rqqOwcDpIRcdCvC+JZurO7nNpAmlAMa1t2HnFOPkZ6gf+gVCI1U4C6ljkToFrT Fgbn8/8cm6nJB2L+s2AOf5yE60DbOCNn5lz4AAmrKow0jVokeF5SLdKHhQPN8oTC 87yklamFVs71y4Rf0tDv0J2oulNOLLFSAlGSxChBXpvc8jmBKLFNA/TSFsdEk4F1 kN3YnEPZSspcHI8YbBJNqvu8QOG5K+s9xcsMmlAjhMd68oz81EJvqA1OU8UbXx1a vMg/lMD7seIgz28xWdYOnjtaCZLG350rQILcaLPOqWKnIgaLMg0ZZBON3aA== 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 4cgte8rb4r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:08:11 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8cb4d191ef1so671838585a.0 for ; Mon, 23 Feb 2026 10:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870091; x=1772474891; 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=n6CVcQhd946ciLSkWGVm71la6+p58QFjgnyvS3NZYhA=; b=WTf7uKgSR7fip+D+Hyh8ITnpXh2sBhnum4vU89hhNMbygyWAlQo9+66+pHHkQr9EZC aM15b84BTeKmSteuL7cfMmsQKxp6oXAFg39fKc605uV0qTkt04PknHuFx6kwvdgGgj/T 0KTslzr1NnYWneANeck15oSZIdd+6I29GygAvCqkazb8HwAJFWRSnEp1hWREN87+jDee UvF+gJpMDhzLW16l0CkE7gFrpgyupBl2KklsoXGwzwqemzEr6zsvLKwdqOZ7kDwDOrNk fQ6dKbbzq4nWRGYDLaUVVfXKxUuUZVBXG3cHuqTBnVMk4b1HQDwr/fU7tmmLRiSB3x4x TuBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870091; x=1772474891; 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=n6CVcQhd946ciLSkWGVm71la6+p58QFjgnyvS3NZYhA=; b=q230g9bDvr1cniZCfQW5fSKSFsBMfbwALnpcDk9xEczk4M8gTSS8hIzk8CieRrJDOl OaffPm/nl7sqWFE3zSgJLutVP/rPiX6N552Z0xY7mQP2ddyUa7AoT4ybZINC5osIfdjO /Q41+NsFZQEXWqBSpi7DjJEwNdIU29LHEBdUlQEMowm8DXyUS2hjYTPiT5sbp47adz6M VVVcswxWuCe04ADAAqE7Oo3A1EfVS/hHK3zADMVFIzrCh6kkpGLVBhaVss2wDErXf8Gs BFTEHfCVqCAry3hhdsGn6ryD546lCkewDpqDG4eB3GRZmUHkDsaYjru94F+QTcfbU1cg pPRw== X-Forwarded-Encrypted: i=1; AJvYcCXzexEREKQze3I7byh5LkpA0URee/mxdbduLS/rQfuWteURagFP+XBgwqoSX017j2RUazGK+evqaqc1udQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy6uVcCQH4eGLlf2cM9JK0bWJv9tg8a437sUz7RN9yi4OPOIl6b 91E0OT9hRzrbM/cNdzmNFrBnrXS+q6NP6wirl4jTjAoiV2XO5umKVV2pdmugTJHOp6afIUHdVas GSFlaX9q5AetnYs3Vy/fpmqej2hPqc+LPyXr7XJ6Yvl4pU1RiT7TiDdrDpStfsc4T9ds= X-Gm-Gg: AZuq6aLTg0Cd7QhldECl1Wi+PztPw/sBbymdoghPdhbnqku4+wDGZRexmKpZkrOJuGb fKqhfvxAU01WUo+yLeORWnF9Kq/ZgJm5c0QxdY3jwJehtmw4WPC9+AEP3vP8mbT/RNTmAmHq3DL C0kmkhrHYvhyaom3Kt2WH7g4W5j16VD5AhsTaO9dnOjlHQDgnXgQd6oPs1UdqZlM1O58E/19Knh rNS3BCl6jpWykyLeW3zMWBA1W3+f/INiLOMhG6Qt4Zb0IexI5YU1lkD/0Ph0Ie+DSoihmEosuk6 KyY2xsdDtnxsxifqCo+IlGjWoD9me6SyYjQT1YWP1LMPhEFMhcbck+0QW/lZsFuwGbR9iHO2rs8 UItdYmDXfdwIW5vNu1EQ/t/tqZzB4SvMvGPiICgEDJOT8cagrlHpKy9c= X-Received: by 2002:a05:620a:4801:b0:88f:e620:21cd with SMTP id af79cd13be357-8cb8ca8078amr1189374085a.62.1771870090619; Mon, 23 Feb 2026 10:08:10 -0800 (PST) X-Received: by 2002:a05:620a:4801:b0:88f:e620:21cd with SMTP id af79cd13be357-8cb8ca8078amr1189368385a.62.1771870090046; Mon, 23 Feb 2026 10:08:10 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.08.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:08:09 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 13/14] ASoC: qcom: qdsp6: remove search for module iid in hot path Date: Mon, 23 Feb 2026 18:07:39 +0000 Message-ID: <20260223180740.444311-14-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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-ORIG-GUID: iAmYFGh8WSYWMQlkRImT0YIGfP8g6Umm X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfX2AlBAehNc2tK C2hskmUBgXFDsBy+bHeRXcZLI6bXjAnVYG0ZPfhO4YBK4vAYTa62XPzia5FNnWVfXOP/m43zkjK MCBzCfjwAFZeOxrBtyvWyQCBjB1J1rPeL4j1W1CteocA2hiRAFphB7vkcphzPV6X1Lc5/dklLRU VuxM0WyEb8TC/+Fp2N/kknv6UDHVQuTFIt/vW0uq4Fkr+jksJK1ER6fZogjC0cqrYw4uhvMV/5w S5rqSDYFLtq+MT9noM4FNYqg/dFPTSdCO/Lj1BRQtbMNrUkGs8B6p5fpRRDrdaHWZVnoQ8aVj7g iE+EhQfBSHG0BbdkiWuA6jfvmwPXTpeL+Hk5tBxF6V7Us6+Ghpm4xirDFUmvIo+W2K3fDNc7Fea Ds6ArXqZKpq+CwoTJGzyAntylfq+rEnqZ9AavOBK8x4NME8WQFMeFJFZ9El0JawpT+BdJN9nx+j Kvm65Qjg6okXrfqvETg== X-Proofpoint-GUID: iAmYFGh8WSYWMQlkRImT0YIGfP8g6Umm X-Authority-Analysis: v=2.4 cv=WqQm8Nfv c=1 sm=1 tr=0 ts=699c978b cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=Ll4dbTg5roZnn8cDlSAA:9 a=IoWCM6iH3mJn3m4BftBB: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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 adultscore=0 priorityscore=1501 spamscore=0 impostorscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 Content-Type: text/plain; charset="utf-8" Remove searching for Shared Memory module instance id on every read/write call, this is 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 4d2fa6a5e065..5a3d50277e9b 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 5cf538397841..7c646ffcf956 100644 --- a/sound/soc/qcom/qdsp6/q6apm.h +++ b/sound/soc/qcom/qdsp6/q6apm.h @@ -99,6 +99,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; @@ -113,7 +114,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 Fri Apr 17 04:49:52 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 B8CDD344054 for ; Mon, 23 Feb 2026 18:08:13 +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=1771870095; cv=none; b=lHbAwM2c9ES0/I+wJyp5UODVcV47kLIoAIrIRHv9ZJx4cxgVwx2AznqXZom8y1Lz4Q3MJej+aihu9QVVja0ELTL+YT/cZ2QSIcmTBHDzNTbnUbf/LET5NDh7FuRikyDjtekEetOx9fDjeL4pOLgj8es2pNVBuFyJhVCI1RqSTs8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771870095; c=relaxed/simple; bh=mx1nflNoTneloyc5cY9vB1R6QXyfYtUnUF+zVRce8x4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FQFb747/7UarB8y3LZ0kFOVtuIDQEEoSk+q25J5TMcfzfCCyndkHlbOMKy7WbmlKM/ggBh6BBA+xIJ+yJvib0B9fDmE41qgXI6RkZuUTFK/T/cWBMNottL6QieWEpwZDMcdmLhwGWRKV1Bv5lH49sGt1kiCmP2K+80XOpm/Gq+o= 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=NJwkZlcm; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=XSM3DQMW; 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="NJwkZlcm"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XSM3DQMW" 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 61NAX3TE3698602 for ; Mon, 23 Feb 2026 18:08:12 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=w5PgChRSa27 S5NdDI2MfbtYRTyOKtViaohlPvoKOirw=; b=NJwkZlcmXZlyC9VkFhDx4FTc8Za TS66d9s8qBpMsQHVlrNPdFf4GzjrovXnKD8INGA2hcyc/skk8eJYF0rapbaA+m1r oiga2YZELcQ7UaGrZYbUEFLcfj+Ndyxa7IVoa+4w62963pUf1jboKCqM+L7ZJEWF K/k1+i4U18xrxJ3hl9+uZpg4K5P2e0U2TfXnPhXlTrrhdIQGHbgPgn+OKgnqQ5QT 6fsLxY9ad2Nj44BbX8kCHrbKLniUWgQcp0R4KxFFv+zeYHP+fJaQ+cDhaiEhLDK0 aORk5UQjQ9tbqdPderRqFzpOTl6uhKMJRthG6ZP+/MwigUEc+oOZXJJ23AA== 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 4cgn819ej1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 18:08:12 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-8cb4817f3c8so3913638285a.3 for ; Mon, 23 Feb 2026 10:08:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771870092; x=1772474892; 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=w5PgChRSa27S5NdDI2MfbtYRTyOKtViaohlPvoKOirw=; b=XSM3DQMWh9AdYq6SdHfPZHDbBz17qMAOSM+M3nKmEhsCW7O/xxy2IEqEDyMO0al3Xa 27m1b+3zTpny63d+89PICCUimRkCUwIsHbWIVJYM7cQRXgUsgogPTINsSyfki0ZwuBwU kZm3YDpcx4yKoB3G+BDi9s85QVpwk2BhhHzLDA5Kz0/3HUIegKXDyebG/wsrnc19e4C5 lON5hpjCG3TXTk+Y1xTrpo7eM5wchEnI51UquDzJ8dnmPrNKhrhQmUIKsOiXEmE9ru6h nsIIbxv99Uh+feIirmtsSy9q3b+H/h/lOtZMmLns9o4Zz/oLUsnzd2R0lT6Jc33AE5Io tCkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771870092; x=1772474892; 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=w5PgChRSa27S5NdDI2MfbtYRTyOKtViaohlPvoKOirw=; b=UjWM7TQqzQ6qC2IBry2fxqNtwY9NLHu15gdVjwTVxU3pptLl8iIa82icDZKSY/2lPO G9aol9kdoB644c+CLtf87dSYP59kaUT7VF1k/DHSRYJlhQ1alOe0A7w1SWtQ3hrXMUj5 9SBKeNLOVzE/8CRpu5gkU7y8NWJQtvbBZSVCKGn2zdXMohGE5bG45cybPvIYE4Fo16W4 DQ5gbjfQh40y2MhZpjGFT1Le6fQZtG/wmtNoaJqcQbOLEghpuVU7WPfT30RpZIu/sB/T uPdzySnZq0CvRiavMqDIHtoBixk7b7CSeHTuaCxLRBabcy1semyOKaG4El56x6mmU/yN aarQ== X-Forwarded-Encrypted: i=1; AJvYcCUIzwZQzfFDOz/8KJg3LCC4yx8nZuj/iah+uppLQB7jAr6uYTm+73+ymj4pvoNFmQAZiJhq8bl4UXzaEVI=@vger.kernel.org X-Gm-Message-State: AOJu0YxWeDFawGCo29FdkxfqnXy+uN8bEzoQgEyM+aVgOjXOdfGiuQNv Qnq0xoftZo2eef2zSgJ3iSejsY9HePcdivvY/f1GRz8n5fDaI+AkIs/vx1ONyyYynTBFKvwWMeD kfwedGdcYskZcSFsPyV9meOzjWm+I/ScXeA8+EUcr50s7bDs+1zmtyDgu5YbO2YYi664= X-Gm-Gg: AZuq6aJu7MZRNxsmAUK7XtownbcGOlfB3v/PvXhiesmvtGeflk/dZiuNTbgC/tzuwBz e8MhNmnRqE9AGdxHTpXO39wMEXwhN8WpqpwlTj4zqCD/ccfQbGhjqJ+poSDryq7NWy4VWbgq1dj HH3+JiH7q3TqdYttv1H8JYvrgJ25hnF00y7DethuGQc0Uq9bCkQPu5HHHYFIaC0UGAaoUkgTTf1 ZzBoI5pfJWOs/vYvxQCCrSHJSD8GpCa/UxpvlLkvx0n3Vwz/CMv6EVF/SYX50Me7+ONTmBtalgb QEdpQoP2NtRkDBVYh0vubwpdiWXTJyPt3bnzZnu5FX9AXmzWC2kc0WURKnMKzFGcq+DbpYzdZ4o 8OyT+Y5k1p+5Jmce7UiZBostEjEacbkzO5dM+aMxh+FTzp0ZvcbtlGOM= X-Received: by 2002:a05:620a:45a3:b0:8c9:ea05:d15a with SMTP id af79cd13be357-8cb8c93d2damr1219852485a.0.1771870091803; Mon, 23 Feb 2026 10:08:11 -0800 (PST) X-Received: by 2002:a05:620a:45a3:b0:8c9:ea05:d15a with SMTP id af79cd13be357-8cb8c93d2damr1219844785a.0.1771870091244; Mon, 23 Feb 2026 10:08:11 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d401aasm20458574f8f.23.2026.02.23.10.08.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 10:08:10 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, srini@kernel.org, Srinivas Kandagatla Subject: [PATCH v2 14/14] ASoC: qcom: q6apm: Add support for early buffer mapping on DSP Date: Mon, 23 Feb 2026 18:07:40 +0000 Message-ID: <20260223180740.444311-15-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260223180740.444311-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260223180740.444311-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: 46OJLlvFzzJ-sgopI7Smi7tQXZvcMh6o X-Proofpoint-ORIG-GUID: 46OJLlvFzzJ-sgopI7Smi7tQXZvcMh6o X-Authority-Analysis: v=2.4 cv=CbsFJbrl c=1 sm=1 tr=0 ts=699c978c cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=Lmls0Cg-LgRrrh2KKlkA:9 a=bTQJ7kPSJx9SKPbeHEYW:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIzMDE1NiBTYWx0ZWRfXzpFXPxSuRqhJ pg3xixEk9J3Z4zDy2sPsaiEosfoqSDPudKKqbuCxCoy9PVsKR9+cclZTBynFdbpnDFgRJUwpxuK U2QXLc3S13Xyj0B77mZCRVUvcQ4+e1CWzvDgXsaoQ+6K43PoBYew/vPq/oEaTNccUNkmnhbYQEo BHprU82gJAHhkIZro+lBVByP/kNZQmbgwlUWgaFy2Q50Pxs6cpAaa7E1VUnCmW9pbGymZfLUoq4 PNlsbXOhIe/5sSmjd8icG9owybQMKFugQC8fZM1jWRRf/gIZXIlkwIfZbeqWMhwB7WHnauyCEKb Cwf0jknCGuUe9TOp9+G0o6wlbp1IMug8pCxXgplf5Udb1YWMBYs+XFpml+kVlnUEShDe4QgIOaF i8tnUr8wOt7ZP9hS2Sbv2Ciu89Ds7KXPie04BcgLkc0WeNiKLtF9WgU98pMBustm+lkybBRPsRa KUUT8kor03XCO0RnA1g== 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-23_04,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 phishscore=0 spamscore=0 malwarescore=0 clxscore=1015 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230156 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. Add new 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 | 161 +++++++++++++++++++++--------- sound/soc/qcom/qdsp6/q6apm.h | 15 ++- 5 files changed, 211 insertions(+), 129 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 5a3d50277e9b..26868078c68d 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,16 +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: @@ -778,7 +808,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; @@ -795,6 +827,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: @@ -809,10 +842,40 @@ 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); + + dev_err(dev, "Memory Map region %x\n", rsp->mem_map_handle); + 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); + + dev_err(dev, "Memory Map region %x\n", rsp->mem_map_handle); + wake_up(&apm->wait); + break; default: break; } diff --git a/sound/soc/qcom/qdsp6/q6apm.h b/sound/soc/qcom/qdsp6/q6apm.h index 7c646ffcf956..f7291b6b0755 100644 --- a/sound/soc/qcom/qdsp6/q6apm.h +++ b/sound/soc/qcom/qdsp6/q6apm.h @@ -134,11 +134,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