From nobody Sun Feb 8 18:42:43 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 A7F101EDA26 for ; Wed, 15 Oct 2025 13:18:10 +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=1760534294; cv=none; b=WZNEff9KaRi71yfNE6OcLXCc838axLQG8Hyz/epOOS5LhAa52qi9+3KefdwKh12g8WvmK9cnOYaJaPK+RUdsOQctSJFUXqxtgUwblpo7ZwbeahzSf5n+gB9CFVSrp0buHBPY4af3bOQYdX/21WInvm8W5OJ2DBgfKTXkUQirVik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534294; c=relaxed/simple; bh=HfYmjuwrOg7v2qvvURtfwZZNDS6Z63hBaD8sZwee7fY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HbNhc0LjV5KLP9pSONymmklXHL8w38hfrL5KAysKOF+FLNFMdkrieZ1NsYjvp+ebtvKQG5IOevWDrrpjja4B4FZwo8kmB1s5251Xtc+uk4m/3qLsD13CsR2ysUKbqQUoqekClQANTmp6cdnnnZvaG2Aj8OEX9KDeI95CkH5bs5A= 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=WX0EQMAt; 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="WX0EQMAt" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59FB0rZa014785 for ; Wed, 15 Oct 2025 13:18: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=ocdibrsg4QK 6oNvgystrIsFuQNDpepXOkPernNyibCM=; b=WX0EQMAtstiub/cyNMRVC4ElcP5 B66aQcPojC3LngkU1/COz1+/Dv/QF0ojC/00YhNnMiS8EknscHQf4j6MO136PawD 8LKK2R6PqfBiADK4ghBUGcPouLrvSUXS44IzDi6h23beg1TIolAQxdPsW5LxQptj ayeHrXCTGNAz9nmNGa6eOngLyY0/MCaHT7/lPY8RCg1JLRNYQje7x+Qo6MXCOJ2Q B4ThcuiRwaCKPu1Ob7UROSEjLeqIAW5jQgNgqVEQOv+jDYfIWedsiaR2JyUJkjZb 8taVvBj5aLtfTJVS6QzP5JDousnpoKp18aNKk6OoqKm5EWHh6l9xvZDR58A== 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 49qfbj4hbm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Oct 2025 13:18:09 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-88ec911196aso115788785a.3 for ; Wed, 15 Oct 2025 06:18:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760534288; x=1761139088; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ocdibrsg4QK6oNvgystrIsFuQNDpepXOkPernNyibCM=; b=kkIPDqYmAPvOPzv6NREZlFo3W7zFHJS0yoeJSp4gdPPMPsdB5x0OdOs9sdn2BUeORl qYLDIUe5zt1IGMKeS5mcKR5r0m6bsbxwDFNd2pf846fwfnXWE7dIQrOeQ8dV4pcTOrHc uTeDzuk73QDK7R4pN21Tori+qz9epBmZQJ1phF8ECnpBNKA3x9sbexGJTV6gsEJskCAY d892Om1lrKwEfUGM6QoU67jYSEsDy8hi+uChzPPoZYKqKlzzT7Kxfb4E6eLfXB8lqInr QloOlnEy5ropXy3LQpKBO1TG/C4rubVcqarPbDuo+ecJ1IfgIVFPorxDBPw/x43pAwTp l7zw== X-Forwarded-Encrypted: i=1; AJvYcCXFsNp3G7CaFH36kwxTnq674IgdPvU7AaR4LJucysYAsYeDRIN9hdirVUB52DIRcuR7OI32zHtWKttS9Sk=@vger.kernel.org X-Gm-Message-State: AOJu0YwegC9Ai1mNqQAAJDcGb6u2gWFa5KM5ELSGN8p4LoFAgCJNV0Bx HdtG5VCj21vMj19MxjAmVnRBDWZTZY8DEkofumwrnWw6ulHcAX/ZtU66WufPsx/x8MZeVklP1Xn NV+9SSx5vQTWcUj/yUXHl33jqdHRFfZLD38SFv+0ex66UWx+65pEnILCNueuXui5DwmM= X-Gm-Gg: ASbGncuAIr/rDgVBloNvgne5GOStnGMHPgnay9jWNh7ASa9s0V6yrqQkOONqGI2oggU bEelIb7i0q4djBnm0kloBy5K4kMxH5ZniVX4058TLObqWR7fNmUrsvHFG+3X4S+4l5DR1Kfzfev M24T3MjWzZKR2wj3elVVimoxQNW+Dg2stU0Gg31yPcLzLU/Dwv760iQ3YH5H68CfY2Ua+LBGCnV Ts2us1Lh0DlpiGdpstthag8cWMRtLu8/NRMoFWCjS0cyQ+NOlnLQpV52JMil6mht1HpOMBuJZqP LpXxbRppZWCSMJ5KASHRMUro7NY+QYKmGogAn/c2p5Lc3y4EaNQotg== X-Received: by 2002:a05:622a:1116:b0:4e7:2644:f3cd with SMTP id d75a77b69052e-4e72644f434mr135028011cf.70.1760534288433; Wed, 15 Oct 2025 06:18:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzw5RKXMUAYsikIggquflBgezust1UvJBHDF7SI2jiFbC8VMnSSIP38h2hOOqJ/sUiesXeqQ== X-Received: by 2002:a05:622a:1116:b0:4e7:2644:f3cd with SMTP id d75a77b69052e-4e72644f434mr135027391cf.70.1760534287838; Wed, 15 Oct 2025 06:18:07 -0700 (PDT) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fc155143fsm262081245e9.11.2025.10.15.06.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 06:18:07 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: perex@perex.cz, tiwai@suse.com, srini@kernel.org, alexey.klimov@linaro.org, linux-sound@vger.kernel.org, m.facchin@arduino.cc, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla , Stable@vger.kernel.org Subject: [PATCH 1/9] ASoC: qcom: q6apm-dai: set flags to reflect correct operation of appl_ptr Date: Wed, 15 Oct 2025 14:17:31 +0100 Message-ID: <20251015131740.340258-2-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015131740.340258-1-srinivas.kandagatla@oss.qualcomm.com> References: <20251015131740.340258-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: AW1haW4tMjUxMDExMDAxOCBTYWx0ZWRfX0WPxv5UvzIaA WXE38945yn6L/kuzjHmOTOx3nXrA3Mw66+yIZBJAQu8w8cLcDVJCesEjDm3Cv3L7eDc6E1NHc/q GqLONlptT+Gi512AnwyOGms974OgZySoyqLbJZzggTCNLz8q8vOnfPrGqBniW7axB2IuG1Q2y2d BaxtQjDOzz/nqojZnNvMrm3HntRjNi4Ec36kpkeTvRY90fgs42/J3W8kVwaMHlCuxlxT4URRq4L pFaQYmR4/wjKV9WAitZ7M4SrlPxVN3dHkql0ESHAG/MV09s1oMOe+/FD+llavF2h4NN6bIt72NB gltkPe29f9/HhVl6nP3eSe3bgYM6hw6edmaqkwhehe0SyXfFmHKGyDl6IZQQ9NOuWpmRKKvxUHV 0PrijmMuAsbtKMFoC6D3/Wz3/svuNw== X-Proofpoint-ORIG-GUID: JQxbP1L3uSr78of3fWFgMMscq7AEBdTE X-Authority-Analysis: v=2.4 cv=bodBxUai c=1 sm=1 tr=0 ts=68ef9f11 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=-7q2M0jigxX2LbQM1jMA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-GUID: JQxbP1L3uSr78of3fWFgMMscq7AEBdTE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-15_05,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510110018 Content-Type: text/plain; charset="utf-8" Driver does not expect the appl_ptr to move backward and requires explict sync. Make sure that the userspace does not do appl_ptr rewinds by specifying the correct flags in pcm_info. Without this patch, the result could be a forever loop as current logic ass= umes that appl_ptr can only move forward. Fixes: 3d4a4411aa8b ("ASoC: q6apm-dai: schedule all available frames to avo= id dsp under-runs") Cc: Signed-off-by: Srinivas Kandagatla Tested-by: Alexey Klimov # RB5, RB3 --- sound/soc/qcom/qdsp6/q6apm-dai.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-= dai.c index 4ecaff45c518..786ab3222515 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -86,6 +86,7 @@ static const struct snd_pcm_hardware q6apm_dai_hardware_c= apture =3D { .info =3D (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BLOCK_TRA= NSFER | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME | + SNDRV_PCM_INFO_NO_REWINDS | SNDRV_PCM_INFO_SYNC_APPLPTR | SNDRV_PCM_INFO_BATCH), .formats =3D (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24= _LE), .rates =3D SNDRV_PCM_RATE_8000_48000, @@ -105,6 +106,7 @@ static const struct snd_pcm_hardware q6apm_dai_hardware= _playback =3D { .info =3D (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BLOCK_TRA= NSFER | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME | + SNDRV_PCM_INFO_NO_REWINDS | SNDRV_PCM_INFO_SYNC_APPLPTR | SNDRV_PCM_INFO_BATCH), .formats =3D (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24= _LE), .rates =3D SNDRV_PCM_RATE_8000_192000, --=20 2.51.0 From nobody Sun Feb 8 18:42:43 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 C57941F1537 for ; Wed, 15 Oct 2025 13:18: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=1760534293; cv=none; b=AwnKHjuDVlgVdLYiZXLYxDg4gw8bwty3tDty/e7MyqzAdRBkuPklTmj2+wBO8nd736YDWZQ7brM0CejfwN7YDuW29+9WSZXIv/0A8PJkm/o2rVYN4EQkoi0Ffd9A0w1wP1mwuxbeRXuYHpvP+KyvjNqcKPgXDD7AifpEAPw6zvg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534293; c=relaxed/simple; bh=vZ/RyRZG/SlbF7P/WnS78eUkc8xlz11H4I4OUiw1Xeo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nWFu7oxw6/mouSib9+DjL5o45GuefzFSfZy3omljB5WhfDeznECL1IOISRmsUUhezh1n36I/fvBC55K8tXNZ0EIK1OGRtJAlb2+b2Y93OuxraKN93iHydcFB99bi4cBwIm6eizKrXriKTssXjCGnwt0m6snedFXiZ/S+IvcTq5U= 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=SY27D/q7; 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="SY27D/q7" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59FAKbWP016165 for ; Wed, 15 Oct 2025 13:18: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=1cUb4FoZv4E 2KpTwpsL1Qi55vPJoClmNMvvhIsU2zWg=; b=SY27D/q7Tkw0/ujcXTJXGzt2sUP FS64aI8m7A42kZZsmUc3IdSSYZyTi7oRojnF6hBXThCJMqvM7grwF6/tsAPo3UmP qzP8/BSMQ7hXACnxsYxoxnX9PXeR2LrqYv0Z9Xeqyv4g1ZCnuzwnOHjU3qsOXyb0 Vkqk0Ka7Td7Db2xWKtSZwv2RSaWzYoJru0q1H6u2bdqFOijVbk2EMzrt4CX4s0Ok Tq0PIzlFgwZ/ZitsqPhYvvs33Cl8+r50H/tJABKayCizm1eyL1DpWWc9jq3bdu20 zy6W0GZwRK/xIwdjHbFB4grjRipi/JrhoaXKJcKwxqrRQ+SsKHkUCX3vhDA== 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 49qfm5mkw6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Oct 2025 13:18:10 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8635d47553dso2553955085a.0 for ; Wed, 15 Oct 2025 06:18:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760534289; x=1761139089; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1cUb4FoZv4E2KpTwpsL1Qi55vPJoClmNMvvhIsU2zWg=; b=xHrqRnbiVjzf6tewsrIlouMson7MaZ/Txw6hnol0CsMS2GA6zt+OYFaFlopBpMvUek eKs+Bsa36XUz0tZ1MYBNySRgAlgzDp5PN9V2f6/SdJ9D9m5M7QMqETs0asQwqVeuQedv YhzPHKZnpiQR8Bi0aq6Ku5Dq6fwR6kMG2WDb5gJs32ek7A2i4Fysf4bNG0dp27ADF5ME cDExvTFo1eGEQdnE83fVP4gq2dKsEaFX/j6xSlmTRN9LSEnxEFBYbR6z5K72TFF3ZZnp +3J6IDMMvVr35wkXeu2MIf7W7CAyTEAyK4BytIulaqFpjdHp2h3SU2GD4MOe9uYgFG6r ehBA== X-Forwarded-Encrypted: i=1; AJvYcCVJPvjxpo1QJZ+I/Gn1zvCrpD3DYGVE3pZkCtGsqcwA9O7mve/8Bi6CiKIiOnqOUwS4ugHWeUJ/DqPnW7s=@vger.kernel.org X-Gm-Message-State: AOJu0YyVHndMEpH31JTXBujzBJTULYheaTRMHh8UxYOxKwYNvALl5UDp Bis8GlUDuz9sstUfJarAjiKZm5ys3p9kcOrz9Y7haehY4wLwI8Lkztpu2zoot+r8oppfd///q2N zyOF0mT1nsXotTAexDdFiYbFoWKxCMB8YpmDbzX92qJrTpfHWJ5PZXW5LJYQ1XIojrF0= X-Gm-Gg: ASbGnctOy2x6W5naE8cKuXF5YT/D1qYIi4mfWZofuL/ExuvxKmKbJPC9nzs4A34ggZ7 OxbAyCAFaMZ8Pifd+3c3lsANAF6NmHYnGNrsjxnNE6QxjwgOIrilhdVxDn8Tq4syeV3qzEGQowm QT5Yh4kOYjFSSMUzXa4iG3612HVGLz5rr0WHEdp5R/f9v2c7s1ECHvLWFwfcmC1UF2w7gSfRfNk QQ0jsqZJ8pSu3yVuHBJkFyNiH20iZJM1RPv72A648abq9BtFXGO3pfilBxCS5Cyamyk01N7QW2Q H39qiZhTYS3IJUlVrb0Y520avfp+A5hadYDBDdqb3cUxGKmEpdZSOQ== X-Received: by 2002:a05:622a:4c1b:b0:4b5:e7c3:1dee with SMTP id d75a77b69052e-4e6ead54342mr390090101cf.47.1760534289359; Wed, 15 Oct 2025 06:18:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6c3G91brdZkpPUjrur01pEn1Xk3q4nJeLRsNBiynm9tkfya6SGJvXyEwQXuksUqgpd7mVMQ== X-Received: by 2002:a05:622a:4c1b:b0:4b5:e7c3:1dee with SMTP id d75a77b69052e-4e6ead54342mr390089561cf.47.1760534288837; Wed, 15 Oct 2025 06:18:08 -0700 (PDT) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fc155143fsm262081245e9.11.2025.10.15.06.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 06:18:08 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: perex@perex.cz, tiwai@suse.com, srini@kernel.org, alexey.klimov@linaro.org, linux-sound@vger.kernel.org, m.facchin@arduino.cc, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla , Stable@vger.kernel.org Subject: [PATCH 2/9] ASoC: qcom: q6adm: the the copp device only during last instance Date: Wed, 15 Oct 2025 14:17:32 +0100 Message-ID: <20251015131740.340258-3-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015131740.340258-1-srinivas.kandagatla@oss.qualcomm.com> References: <20251015131740.340258-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: 5hlBIpoVaCyL0KJvtRPsepQ5LpfPreaJ X-Proofpoint-ORIG-GUID: 5hlBIpoVaCyL0KJvtRPsepQ5LpfPreaJ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDExMDAyMCBTYWx0ZWRfXy5fqG4lYyTtC TNvKw6hawBQzMKDxzOvnDVRLEMKZOk2UOWW5QRnPc5z57cRIIk2GjB5hnIp1gvND7IfK+v3hNpz iKBVKiBW2xVMIN2IBp/EjxUJK2dIOhDspAM1fKOGP0OCC2a36X+9G3obvG2IzODkaX7REB3dPkj kcCZ6I7GKB0IMuppzPVjGvlk7W0SlQy4bIc5oGW53jROoiUhhDjk7AMuZX4n6ZkFAYYv+QAe9WX F2MrqxDRHJJDooFfiuhB1iGKNuFtTU/uS9mu3JR5lLCeivutGZVdpLjn01FyFADtfGoISk+q0VX ActTXGcW2ObkceV2/omZeDKOdgDWh10PAiLD0C76RYFFJi6kEy0A3ZaWDjutYn+gWg94goUyX9H 3ssGtPPmXgh53fT9ZuRJQbOLFPcl2w== X-Authority-Analysis: v=2.4 cv=V71wEOni c=1 sm=1 tr=0 ts=68ef9f12 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=LQLTnAVHjxzgEifUwDEA:9 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-15_05,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 spamscore=0 adultscore=0 suspectscore=0 impostorscore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510110020 Content-Type: text/plain; charset="utf-8" A matching Common object post processing instance is normally resused across multiple streams. However currently we close this on DSP eventhough there is a refcount on this copp object, this can result in below error. q6routing ab00000.remoteproc:glink-edge:apr:service@8:routing: Found Matchi= ng Copp 0x0 qcom-q6adm aprsvc:service:4:8: cmd =3D 0x10325 return error =3D 0x2 q6routing ab00000.remoteproc:glink-edge:apr:service@8:routing: DSP returned= error[2] q6routing ab00000.remoteproc:glink-edge:apr:service@8:routing: Found Matchi= ng Copp 0x0 qcom-q6adm aprsvc:service:4:8: cmd =3D 0x10325 return error =3D 0x2 q6routing ab00000.remoteproc:glink-edge:apr:service@8:routing: DSP returned= error[2] qcom-q6adm aprsvc:service:4:8: cmd =3D 0x10327 return error =3D 0x2 qcom-q6adm aprsvc:service:4:8: DSP returned error[2] qcom-q6adm aprsvc:service:4:8: Failed to close copp -22 qcom-q6adm aprsvc:service:4:8: cmd =3D 0x10327 return error =3D 0x2 qcom-q6adm aprsvc:service:4:8: DSP returned error[2] qcom-q6adm aprsvc:service:4:8: Failed to close copp -22 Fix this by addressing moving the adm_close to copp_kref destructor callback. Fixes: 7b20b2be51e1 ("ASoC: qdsp6: q6adm: Add q6adm driver") Cc: Reported-by: Martino Facchin Signed-off-by: Srinivas Kandagatla Tested-by: Alexey Klimov # RB5, RB3 --- sound/soc/qcom/qdsp6/q6adm.c | 146 +++++++++++++++++------------------ 1 file changed, 71 insertions(+), 75 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6adm.c b/sound/soc/qcom/qdsp6/q6adm.c index 1530e98df165..75a029a696ac 100644 --- a/sound/soc/qcom/qdsp6/q6adm.c +++ b/sound/soc/qcom/qdsp6/q6adm.c @@ -109,11 +109,75 @@ static struct q6copp *q6adm_find_copp(struct q6adm *a= dm, int port_idx, =20 } =20 +static int q6adm_apr_send_copp_pkt(struct q6adm *adm, struct q6copp *copp, + struct apr_pkt *pkt, uint32_t rsp_opcode) +{ + struct device *dev =3D adm->dev; + uint32_t opcode =3D pkt->hdr.opcode; + int ret; + + mutex_lock(&adm->lock); + copp->result.opcode =3D 0; + copp->result.status =3D 0; + ret =3D apr_send_pkt(adm->apr, pkt); + if (ret < 0) { + dev_err(dev, "Failed to send APR packet\n"); + ret =3D -EINVAL; + goto err; + } + + /* Wait for the callback with copp id */ + if (rsp_opcode) + ret =3D wait_event_timeout(copp->wait, + (copp->result.opcode =3D=3D opcode) || + (copp->result.opcode =3D=3D rsp_opcode), + msecs_to_jiffies(TIMEOUT_MS)); + else + ret =3D wait_event_timeout(copp->wait, + (copp->result.opcode =3D=3D opcode), + msecs_to_jiffies(TIMEOUT_MS)); + + if (!ret) { + dev_err(dev, "ADM copp cmd timedout\n"); + ret =3D -ETIMEDOUT; + } else if (copp->result.status > 0) { + dev_err(dev, "DSP returned error[%d]\n", + copp->result.status); + ret =3D -EINVAL; + } + +err: + mutex_unlock(&adm->lock); + return ret; +} + +static int q6adm_device_close(struct q6adm *adm, struct q6copp *copp, + int port_id, int copp_idx) +{ + struct apr_pkt close; + + close.hdr.hdr_field =3D APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, + APR_HDR_LEN(APR_HDR_SIZE), + APR_PKT_VER); + close.hdr.pkt_size =3D sizeof(close); + close.hdr.src_port =3D port_id; + close.hdr.dest_port =3D copp->id; + close.hdr.token =3D port_id << 16 | copp_idx; + close.hdr.opcode =3D ADM_CMD_DEVICE_CLOSE_V5; + + return q6adm_apr_send_copp_pkt(adm, copp, &close, 0); +} + static void q6adm_free_copp(struct kref *ref) { struct q6copp *c =3D container_of(ref, struct q6copp, refcount); struct q6adm *adm =3D c->adm; unsigned long flags; + int ret; + + ret =3D q6adm_device_close(adm, c, c->afe_port, c->copp_idx); + if (ret < 0) + dev_err(adm->dev, "Failed to close copp %d\n", ret); =20 spin_lock_irqsave(&adm->copps_list_lock, flags); clear_bit(c->copp_idx, &adm->copp_bitmap[c->afe_port]); @@ -155,13 +219,13 @@ static int q6adm_callback(struct apr_device *adev, st= ruct apr_resp_pkt *data) switch (result->opcode) { case ADM_CMD_DEVICE_OPEN_V5: case ADM_CMD_DEVICE_CLOSE_V5: - copp =3D q6adm_find_copp(adm, port_idx, copp_idx); - if (!copp) - return 0; - - copp->result =3D *result; - wake_up(&copp->wait); - kref_put(&copp->refcount, q6adm_free_copp); + list_for_each_entry(copp, &adm->copps_list, node) { + if ((port_idx =3D=3D copp->afe_port) && (copp_idx =3D=3D copp->copp_id= x)) { + copp->result =3D *result; + wake_up(&copp->wait); + break; + } + } break; case ADM_CMD_MATRIX_MAP_ROUTINGS_V5: adm->result =3D *result; @@ -234,65 +298,6 @@ static struct q6copp *q6adm_alloc_copp(struct q6adm *a= dm, int port_idx) return c; } =20 -static int q6adm_apr_send_copp_pkt(struct q6adm *adm, struct q6copp *copp, - struct apr_pkt *pkt, uint32_t rsp_opcode) -{ - struct device *dev =3D adm->dev; - uint32_t opcode =3D pkt->hdr.opcode; - int ret; - - mutex_lock(&adm->lock); - copp->result.opcode =3D 0; - copp->result.status =3D 0; - ret =3D apr_send_pkt(adm->apr, pkt); - if (ret < 0) { - dev_err(dev, "Failed to send APR packet\n"); - ret =3D -EINVAL; - goto err; - } - - /* Wait for the callback with copp id */ - if (rsp_opcode) - ret =3D wait_event_timeout(copp->wait, - (copp->result.opcode =3D=3D opcode) || - (copp->result.opcode =3D=3D rsp_opcode), - msecs_to_jiffies(TIMEOUT_MS)); - else - ret =3D wait_event_timeout(copp->wait, - (copp->result.opcode =3D=3D opcode), - msecs_to_jiffies(TIMEOUT_MS)); - - if (!ret) { - dev_err(dev, "ADM copp cmd timedout\n"); - ret =3D -ETIMEDOUT; - } else if (copp->result.status > 0) { - dev_err(dev, "DSP returned error[%d]\n", - copp->result.status); - ret =3D -EINVAL; - } - -err: - mutex_unlock(&adm->lock); - return ret; -} - -static int q6adm_device_close(struct q6adm *adm, struct q6copp *copp, - int port_id, int copp_idx) -{ - struct apr_pkt close; - - close.hdr.hdr_field =3D APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, - APR_HDR_LEN(APR_HDR_SIZE), - APR_PKT_VER); - close.hdr.pkt_size =3D sizeof(close); - close.hdr.src_port =3D port_id; - close.hdr.dest_port =3D copp->id; - close.hdr.token =3D port_id << 16 | copp_idx; - close.hdr.opcode =3D ADM_CMD_DEVICE_CLOSE_V5; - - return q6adm_apr_send_copp_pkt(adm, copp, &close, 0); -} - static struct q6copp *q6adm_find_matching_copp(struct q6adm *adm, int port_id, int topology, int mode, int rate, @@ -567,15 +572,6 @@ EXPORT_SYMBOL_GPL(q6adm_matrix_map); */ int q6adm_close(struct device *dev, struct q6copp *copp) { - struct q6adm *adm =3D dev_get_drvdata(dev->parent); - int ret =3D 0; - - ret =3D q6adm_device_close(adm, copp, copp->afe_port, copp->copp_idx); - if (ret < 0) { - dev_err(adm->dev, "Failed to close copp %d\n", ret); - return ret; - } - kref_put(&copp->refcount, q6adm_free_copp); =20 return 0; --=20 2.51.0 From nobody Sun Feb 8 18:42:43 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82A781F418F for ; Wed, 15 Oct 2025 13:18:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534294; cv=none; b=OSQMbMNk3P+5r3xyIIdMCa7PD4+x9qHhbRXmmJ04Bsi77HdWCzn+6lgPG5n39tDQSZKiTSvM/2HhwMGK3nXBzyPJmLYn8dqMCUjkJBEMndrL4NcemPbo+uSQ4yMinSCqx19OgONfTMSEBijipqeNWsiHXKQL19aSuhr8zRGATxM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534294; c=relaxed/simple; bh=L098FDafS8pm9ObOLw9+1ZKs3tCLohX1/Ibu253xq/o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aDv7vxoaJcDGd4S/ujt3CXouclFILWbF5Z7rKZzO858w27+jc17mzpALRx9/iqbsIEhkw2EaodIb3XC7FVNd8YMVkvgxAdS/aYzjIOU4RdrE7yNx9bYqgXTbX2jO6L53PBWtCz8cLwyetkiuMM6kcyFxA68c/SuXGgpFvU+gejc= 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=lVA/PdEc; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="lVA/PdEc" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59FAVLt5004003 for ; Wed, 15 Oct 2025 13:18: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=nnMgSGQvZWa 892OSdBf3qcySVN9QLFS9/sViBiMJgyA=; b=lVA/PdEcyNkWadMnx9OhqO4b34k jBIKkQ0EmtxqrF02yhgh0lchJncIrev97kamcBArfQlzTTSTa7DyglY4McI+hL9r AHRBKdOTnIrGEdMB9q3vznQtJsH/NJmlx3bBfvyrsFu8RV3Wv/6dGZBnN2QbI6ql Fsmd6ZNaA3Rt2IRrJn3eqam5CZ/vaad/vQDlurKHBU7KzgYwl+M36qaq04Ek9ZQM 742QX6cBjfAdtAmAYCDC2dTAr4zwH/Tl7bAk2/Q9ibmlBnTFNWO3GoRHIoIkdkmJ JUyCIt0VLDmvHkAkZzZmLogQyrJFt951G0r2KyvmmPtc+lYOvMcZt4vbMqA== Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49s6mwptcj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Oct 2025 13:18:11 +0000 (GMT) Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-876ee102b44so32371566d6.1 for ; Wed, 15 Oct 2025 06:18:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760534290; x=1761139090; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nnMgSGQvZWa892OSdBf3qcySVN9QLFS9/sViBiMJgyA=; b=D0aqU8K/BKX5RX6BBV2WUrvv5O3A3SesfxXhxbJMptY/MXvcZJYIiOunlzksK1fGmi kEvq6SdDXdQPNL3OIpI8F+EIDNYhI+VIDJeRmf4adavqDMGXE/PSTo2E2VFCDrMWxTGH R13PIuqqZKQe1JBZZZDDoDxOF2SxMmi1qSFeiFj1yBuHTkd2phOgzs9Y5wr1JdtexMs/ 9rxtrydjW5jmCrRSHscFqPi5rS0rFarjFaFsQXEbZ/1jJzR8Q4HBdCVUOv6vOlaBYdji J8mf/FxQAd+hujiXVRDg31QNJOA+eL2MQL8E7XC6kV32Wl1JeKg3LoYiAhGu+4Q98ZYb Q7HQ== X-Forwarded-Encrypted: i=1; AJvYcCVMnOkG6QvddExQRuyZPRlfrhUKGLUs3tZamp4w8r2pxuLZTJk6tSb8FgyASwaBIrTA5+DLY4c7kI4yrQQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyjnL4sTWgPpFsmnypwWmKCBdbL5J8eWlXsI2NE4mWKuMTPJoP5 3+JMvBvMAzrEfhky9qx/Z8Dr+kxaLaxnzuFR7lkWl0No7uVqvrgfGuKsK1izaRN2H8j3EpJ3x1w ybx85BF8WsJC0QFVJFccaUSxXOzz+p4PrwNQ5i6sN8SisQkCYEADJIypevF8pv0JFkDY= X-Gm-Gg: ASbGncs7NiLZwv9UxqL1f2x5u2WvPgBav8EKkCQ4DtWVfp1K6s9ApRBWVYDR2a6l9yH 6FRb1IuhJ4qxo5OSiU7xnVED4bs7qAYz6+VxWyTV/0z03TRv57UHVC2jzBU3fLBfBYj2w3i2ws5 j9NazwH1zIdP78OEnmCIni+Y89JkwXb7F9CGeb+KTtzz/qYkmCYmFVFh8HSOYCiA+cutHm0hVTE VxZr6UQHAynABDLs0oZxrr7hlZQiFX9pIW9Syg3mpLp3RrtnnRIH5VEUOyOo1MVBRdngelB2dSw 8teAhX0tk5xe6tf6GboktAi2ivDQc7MFldb4v2Rf4Bo4uAUcGyreHw== X-Received: by 2002:ac8:7e89:0:b0:4d0:fbd5:4cd7 with SMTP id d75a77b69052e-4e890df9b42mr974761cf.16.1760534290529; Wed, 15 Oct 2025 06:18:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQPK/8F9/L9WtmiMGFpf77cZuz+9kWatOyQjFPz0hd1jWTnhTVvG4UfIIpB1jflL+E3HXJNw== X-Received: by 2002:ac8:7e89:0:b0:4d0:fbd5:4cd7 with SMTP id d75a77b69052e-4e890df9b42mr974021cf.16.1760534289820; Wed, 15 Oct 2025 06:18:09 -0700 (PDT) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fc155143fsm262081245e9.11.2025.10.15.06.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 06:18:09 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: perex@perex.cz, tiwai@suse.com, srini@kernel.org, alexey.klimov@linaro.org, linux-sound@vger.kernel.org, m.facchin@arduino.cc, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla , Stable@vger.kernel.org Subject: [PATCH 3/9] ASoC: qcom: qdsp6: q6asm-dai: set 10 ms period and buffer alignment. Date: Wed, 15 Oct 2025 14:17:33 +0100 Message-ID: <20251015131740.340258-4-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015131740.340258-1-srinivas.kandagatla@oss.qualcomm.com> References: <20251015131740.340258-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: AW1haW4tMjUxMDEzMDA4MyBTYWx0ZWRfX602tnYQ/yJzk dix1ZvOJU5qvgEjIJaUSuHSGE1KH7qWSqT10YgLuB1NPUokqek01yfu5j8CRhab8njHsdYuqMSr q7hJF2JeWCOEh4vDIfk078yYXXdJxQytxXsruV1A3qPGforCzPYJo6EIM/fzSa7eMiR/LrLeyy0 H+7mugmeMrjziJC8Rlk1JAszJ734nV0cs7MfdW88EhObysqfMhy862LEKk89xV5txqWVvNmIjbk jLy1xG+CNtL6vGDwFpmluy+4dwAwjxnVBoDailXm/ZwcgToyuAS+ylOkRVgOh3AzloV9b75aj4R PlioA24DTIS52vyQ+5/MHbCZlNb7/f420BDOFWp3Mq3ejVcgxfxH30vdsDm4c/a84UHogOawY2W ec8GEvz/6/sPqGSbPd1QiIZKac5e5A== X-Authority-Analysis: v=2.4 cv=Fr4IPmrq c=1 sm=1 tr=0 ts=68ef9f13 cx=c_pps a=wEM5vcRIz55oU/E2lInRtA==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=Ubk33e6zxpvlPXQfVdEA:9 a=OIgjcC2v60KrkQgK7BGD:22 X-Proofpoint-GUID: a4UYvXDnuvV_U3rvioz5ewdEQNrvXuuR X-Proofpoint-ORIG-GUID: a4UYvXDnuvV_U3rvioz5ewdEQNrvXuuR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-15_05,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510130083 Content-Type: text/plain; charset="utf-8" DSP expects the periods to be aligned to fragment sizes, currently setting up to hw constriants on periods bytes is not going to work correctly as we can endup with periods sizes aligned to 32 bytes however not aligned to fragment size. Update the constriants to use fragment size, and also set at step of 10ms for period size to accommodate DSP requirements of 10ms latency. Fixes: 2a9e92d371db ("ASoC: qdsp6: q6asm: Add q6asm dai driver") Cc: Signed-off-by: Srinivas Kandagatla Tested-by: Alexey Klimov # RB5, RB3 --- sound/soc/qcom/qdsp6/q6asm-dai.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-= dai.c index b616ce316d2f..e8129510a734 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -403,13 +403,13 @@ static int q6asm_dai_open(struct snd_soc_component *c= omponent, } =20 ret =3D snd_pcm_hw_constraint_step(runtime, 0, - SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32); + SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 480); if (ret < 0) { dev_err(dev, "constraint for period bytes step ret =3D %d\n", ret); } ret =3D snd_pcm_hw_constraint_step(runtime, 0, - SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 32); + SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 480); if (ret < 0) { dev_err(dev, "constraint for buffer bytes step ret =3D %d\n", ret); --=20 2.51.0 From nobody Sun Feb 8 18:42:43 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 828C720766E for ; Wed, 15 Oct 2025 13:18:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534296; cv=none; b=dPeu1Tspjy1lNhscCU9xiVJCW10fEkgRo1eA1qyCkhe3x269cajTk74HwUIYxSmkQxu+lSTqIFKrPoPwte4w6w4kH/hpeZ2IW4WNTxoWVEYuOIB96pEhpnxIXWVEfCUQ8H3/km8Q/l7hCam22irTDAed3q3QCB8HRkZHka/aV4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534296; c=relaxed/simple; bh=FciMJV9TB+OlUWS0wBBXljHH3OORGyEACeJ2UfDr5yA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=db//EZvrULSdQHdoh1uZp0ctBRhkhixMuZeSwR+7BFQWi35FqhCHNnh9EbTfSCPBxpf4O1W2P/O1YhHHarMfZLwYJO1tdXRT3qiEN6Kt3RUOGrFeFeV9gvhmsKnVPUmUSKvpJXP7y8Q5TZio9no61F+3XeZHnLKOBXk/m1lCIdw= 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=TfVNaGvx; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="TfVNaGvx" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59FAwR74009231 for ; Wed, 15 Oct 2025 13:18: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=qHkE+bKT/J8 nbQ5S5gGHutvtvukdRZt0lHpKcZkg+54=; b=TfVNaGvxxRSKVcbpPC/Wp1JJJec YlsdhhhsEh5aeuH/7/kzZN0kVr9ULIK3W0b3ZuqtLUY+wazTc3YN6YtUTFITAP55 c5Bl9XBUJ3Mb2xX+E0tj2YKVMAypXQ6+6J6Gaj0Hnzy3I2sFRDJns1D+nWa/h7XQ qRUKvF8YMkI3j/eKwidoNIc2ZkhCDdBvuCREBIzUxR3wLafIMmCyuOEOGQEhP/bt F+4uxX/hpKRld93fh4EfiNd8coNXHUZci/HtUzLhrGKip02u16sJqrkP5o/yOAxT 1AN2wy1nfOCFLR6avE8THRn23OvklOjPMwq4T77rzG0Xr1DqTNirboY/2MQ== 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 49qg0c4ebp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Oct 2025 13:18:12 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-85dd8633b1bso359615885a.1 for ; Wed, 15 Oct 2025 06:18:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760534291; x=1761139091; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qHkE+bKT/J8nbQ5S5gGHutvtvukdRZt0lHpKcZkg+54=; b=wb9WZoWJDL7eEOk4xVWsl2d2PbrseLTSKa3ynBkrum3Qd8Cr9/4XQvrvh2oMbOKDah ysFeiZXxnDAogiCOI/Z8MnbFTHlT7TWTLBPB3vKBa9OsoB2LOmMIeb8Mz8stOc9h53Qe 3s4VLlnvJgL/vOaLQjWA/zfkwvD5VRvKBVYob0ZPozOgP3PLHk1tDcxgVhQBOF1iwH2a Ib2qoAkkcABNBpWyIlB/z+Rp1Rt8RpnHmyFpH9r5lPzCa4/DZCfk20UnYtwofz1K/nCY tXQAItaenJjzeKOmeQtdzCW3Mz2PpRV5XBuV7zywsOZn/uRgBDmGvGMbhsP2K7qjAjkx EhoQ== X-Forwarded-Encrypted: i=1; AJvYcCUVU58RhaTLre0rKX47sTg+M4xxavVh5REGttcFKBEQVJTrVcvuYGQ6vIMXaAZC72VPDayE4S1bWKcdP48=@vger.kernel.org X-Gm-Message-State: AOJu0YyfnM7jzg170J84ZvgqXPElmbUJlsGzxUi5ASmAFF/Ja3iWmcIZ Tkz+OYB8kL26vkAmXIiaPNBNIXSCrovO9oSCiV5l4s/xHuKXNwe0/uEyWNi3tf4adFOR4aeZABV xoqH0EM00UvPQiT/acT5xrGzPRvWBS8puRKbDGyx+2JUifljpa3jyfkP3pZSwjik1FuQ= X-Gm-Gg: ASbGnctXQ97Qx2Q6WdWYiiJk/frsxD+XDtoBoKHd+FDI1rtGg0EjGTOksfcihdKFiSL 7aKLVy7GwfcWzBnnJbMZ5krRoL4/Q1P1m7XSZMhBhAbbxPAYQ/R6FeepNW5i0yUhb9Vf0mMD9Bc /1vo00rjkQcrTyGxY5Iwgq5JksNgtUzwAzZ6avmKxJ4YTSV5i9aP990MB0K6eivsYB7cNdMdTVK 5roIF1m0SebdNX+mWLh528FIY72JZ0Gm7NTkHVmOLVJ2N+fQPeifxofkJqn2yX94Z53FNEsqXyO HueNobxBOhBE9iJ6Ol05/dyp6bFd6KrTglMpKN5qcYiQKDJBD8ZCpg== X-Received: by 2002:ac8:5a45:0:b0:4e6:eaa9:8a2a with SMTP id d75a77b69052e-4e890defe64mr794861cf.15.1760534291269; Wed, 15 Oct 2025 06:18:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYMWisWH0+ZGB14jA4jsreCXonf5bTEm2tvxmjYdPJwPg9hoSqnxhGbMTLY6h3qG2Avbm8MQ== X-Received: by 2002:ac8:5a45:0:b0:4e6:eaa9:8a2a with SMTP id d75a77b69052e-4e890defe64mr794491cf.15.1760534290799; Wed, 15 Oct 2025 06:18:10 -0700 (PDT) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fc155143fsm262081245e9.11.2025.10.15.06.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 06:18:10 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: perex@perex.cz, tiwai@suse.com, srini@kernel.org, alexey.klimov@linaro.org, linux-sound@vger.kernel.org, m.facchin@arduino.cc, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla , Stable@vger.kernel.org Subject: [PATCH 4/9] ASoC: qcom: q6asm-dai: perform correct state check before closing Date: Wed, 15 Oct 2025 14:17:34 +0100 Message-ID: <20251015131740.340258-5-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015131740.340258-1-srinivas.kandagatla@oss.qualcomm.com> References: <20251015131740.340258-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: PGdcu2AiBm8zpVQwp0-ww8koVcMhxq0D X-Proofpoint-ORIG-GUID: PGdcu2AiBm8zpVQwp0-ww8koVcMhxq0D X-Authority-Analysis: v=2.4 cv=eaIwvrEH c=1 sm=1 tr=0 ts=68ef9f14 cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=MOmvoJmQv4oe-d1MVI8A:9 a=bTQJ7kPSJx9SKPbeHEYW:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDExMDAyMiBTYWx0ZWRfX90/2Hamhvukr 9kXKuONBjfphIV3pLINlS6n7931hfr1I0LsTv8+hEDhUOuFQF2KfriWpDwXE+N8UL4FmSzzNX7m AMA/oNnpZQQPPiMh3nTvLJviAL68FaDPMMZCXurRbklxwxVZxYJgFAagzthrNWtALM+IQCI/7xd 6Mrf3RqIfMSDvkJX3DqcVyA8uAMeBGNl65bae/D8Wd/ZB0576MJhcvO6YEnyno/mM1jt7luW5Hn PfAwt/DKQA1xlpYBWMqJHi34bI2tdqBk8eVfhY4Yk0zRJbsT51j+v88JfOYqheTDsFK/Qjyqq7L nUT0tvdcsHSvy/ehJWVxhFiK5YWd9SYtnk6O+sANUEmRCa4Fm++u6x+iTZsnSwMuspjr6xgSRVu 60A/urW8Mnr49DnR3PPqkEvjnbeX/A== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-15_05,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 spamscore=0 impostorscore=0 phishscore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510110022 Content-Type: text/plain; charset="utf-8" Do not stop a q6asm stream if its not started, this can result in unnecessary dsp command which will timeout anyway something like below: q6asm-dai ab00000.remoteproc:glink-edge:apr:service@7:dais: CMD 10bcd timeo= ut Fix this by correctly checking the state. Fixes: 2a9e92d371db ("ASoC: qdsp6: q6asm: Add q6asm dai driver") Cc: Signed-off-by: Srinivas Kandagatla Tested-by: Alexey Klimov # RB5, RB3 --- sound/soc/qcom/qdsp6/q6asm-dai.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-= dai.c index e8129510a734..0eae8c6e42b8 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -233,13 +233,14 @@ static int q6asm_dai_prepare(struct snd_soc_component= *component, prtd->pcm_count =3D snd_pcm_lib_period_bytes(substream); prtd->pcm_irq_pos =3D 0; /* rate and channels are sent to audio driver */ - if (prtd->state) { + if (prtd->state =3D=3D Q6ASM_STREAM_RUNNING) { /* clear the previous setup if any */ q6asm_cmd(prtd->audio_client, prtd->stream_id, CMD_CLOSE); q6asm_unmap_memory_regions(substream->stream, prtd->audio_client); q6routing_stream_close(soc_prtd->dai_link->id, substream->stream); + prtd->state =3D Q6ASM_STREAM_STOPPED; } =20 ret =3D q6asm_map_memory_regions(substream->stream, prtd->audio_client, --=20 2.51.0 From nobody Sun Feb 8 18:42:43 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E82BC1DB54C for ; Wed, 15 Oct 2025 13:18:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534297; cv=none; b=RJBWEwohGS4cmQrI2yNHr2Upv7QpNtDrGrjQ5iyOOJ4MnMpkg3N6zfAcL/Bdw/Tfeur78lH2g/K/EhnTcuEhGvQCbsA/Ix1EUINMn8DF+WeJydMB5KFGRjZCGQa4sl4U05ASVWvxxREI62A/WiygemvKhn7TdoaaxtSMLafQnrk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534297; c=relaxed/simple; bh=WgksRNnJLD6BqxUz9vyEhSOn1ol4D8nCWHkD1yAbE7A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l6uU9UjoFDTpOsxLdmzMXKxHa5WGpQLAm47nYv1XE5EafSbqUctavmcT8ljgiGZ0GzWcUnnuPIH4M3TE/4txoDwPnatOLWfeXpiKgzbP6f8LAEpLsb1VfHvU2Kg1WBkRczp7IYxvP9TXhVPfdWmRg+WPCx8qCJBBZmL7CM0R5wQ= 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=mHotCi92; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="mHotCi92" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59FAbr3P004089 for ; Wed, 15 Oct 2025 13:18:14 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=zlyb2ILEilB Be+0NeB1eqEutKyYbzy1mNlFgAEnueiM=; b=mHotCi92zo5HlrF8sjm2M+zlov3 +GAmrSaRqX0Y7OZNSJK2VkFOPBl05IvyywGfNPM1b2NJq2VyzmzFzFXygJsmmqPP UrhXQDhnPV/EOI4nosDwKDIT98hdR5DXr/scSJDmZ1y23C0c1boLLSSWGD9BcyLm d8i2zvuOmQ56sOt/lmVSc9CRioKNi9IKqkJZ2cXu5GCCTqitx+FJal+FzBqZAO3n iT1j5cU7XgJnb+o8E1lXJQ1Yhcu2HKFopSgEhfsiA4oEWH35bLVZPdwRy+EE4hoE 3rydXYHleeHwzOZfv/hJdgEg6FHmLetz6FCtPEc0CPjATA7jz21ekFlJR7w== 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 49s6mwptcp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Oct 2025 13:18:14 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8635d475527so4065028485a.0 for ; Wed, 15 Oct 2025 06:18:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760534293; x=1761139093; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zlyb2ILEilBBe+0NeB1eqEutKyYbzy1mNlFgAEnueiM=; b=LXm8CiQ9OBeladUyHt2ojygai0INcnlRMDhjhJnsLiqLk4zCvILeZMtfLdKg2rHk/h I/aa9BAhiGlgbSVJdieliKTVl/GuZrLCIqu5/8Uwb/HzMxb/sfVm0oYfcdfheuIsM0QH 5GpAACIo7AQ7NEUcILlt5mL/PDF4mAKJYNc40bIu9SjbBLxyWXt1Rw6lUnafu3z8uNhA mnE8AiR7ATXxb3698nQTOaFZ36TmvqHRuczZtvpDm5rHQHwiaKF2YoNCGUrjdJ07LuBo 8t2d39FOg00e5AfiR0f6zxanZpMEk6xmyGhEE2SoR/qdG5+ecsL92HXFjnuJqI/BSXK3 TQ8A== X-Forwarded-Encrypted: i=1; AJvYcCUvp/u01Xn8a2GzatMuso/ryxK23VIL/SYucFl9thAqWPGZFH4zxWXe+hqEHfCl4srkLVA9eKn7mRw4F/E=@vger.kernel.org X-Gm-Message-State: AOJu0YxTDoC3NjeMqTopgO54Oxc9+r9B66oRHYoQaeQvcILlJuLZuzVo 6nT11JP2sfIYyXobnLAlVIq2kLFzeyMWh1nQqL+jev6F+TRWccn566OFqIGWNsVnzV9HjcN8nkt t85TsVp9CHH5R1btUP67Lk0X8RgVj3O7RCIE6+JI7zXwU+p184MhFi2OKsSVNU6WgRUE= X-Gm-Gg: ASbGncv6PEhOhfq1xmWyDn39rQbiQUXsZcc7xSD/mypZjYXFAD4olc6ixCPag7ycv7e 4atdP8uE1MR7ch8+YVKR36NNrzcRW/lq8nuJjQbZNjiLSKAuHh7Ao8rHuHJC6VhAdbppOqjRgNV Pd7iuzV24tkUeofYcaqbz4BQcN9P3LAKWIxCjmBAMj8QbTfKI2cg6DR1moSLTurOh1GRnPK7q6s jE1uOukls0Lia55xhiwD6GAwxRsNPt/s6ujBxqswhnPv56kaTqf5NTcjwJxWQQY8yArq8P1Qcfh IahYf5FsNPs/JYMC0lPzyqaYu04ewXkpiHPFEpgv3phRg0jFBr1Rqg== X-Received: by 2002:ac8:5d0e:0:b0:4e8:8de5:fbb2 with SMTP id d75a77b69052e-4e88de600b0mr9882121cf.70.1760534292381; Wed, 15 Oct 2025 06:18:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGifIQbCESc9SGhY2SMFQxwvgmX8sW9h2/sx0PYFUmxrzn6ej7nKB9DswF8DGHPCO6IAfidCg== X-Received: by 2002:ac8:5d0e:0:b0:4e8:8de5:fbb2 with SMTP id d75a77b69052e-4e88de600b0mr9881381cf.70.1760534291735; Wed, 15 Oct 2025 06:18:11 -0700 (PDT) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fc155143fsm262081245e9.11.2025.10.15.06.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 06:18:11 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: perex@perex.cz, tiwai@suse.com, srini@kernel.org, alexey.klimov@linaro.org, linux-sound@vger.kernel.org, m.facchin@arduino.cc, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 5/9] ASoC: qcom: q6asm: handle the responses after closing Date: Wed, 15 Oct 2025 14:17:35 +0100 Message-ID: <20251015131740.340258-6-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015131740.340258-1-srinivas.kandagatla@oss.qualcomm.com> References: <20251015131740.340258-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: AW1haW4tMjUxMDEzMDA4MyBTYWx0ZWRfX2oyzUc36Vnn+ aCeEsyz1k6bZCObzgAUgT/UXCj4EZk1GSJqc8bZi3jFkUvxtCqUt1z9VlGSGw4+S90elwsms5uO 95qHicZ1gNkLwI9dmpW8qgH+5tyhbOPgr/0hNPu8Ynndij00HJu2dMOHt0A4bLiWa4C7jzo9sNi 60VOmX8UOk20xjXShm1GFCGBiQKw4OzydwD+5PsEo8hbVm+ayKvD6mjuHytQm0WpQ61sGrPA7tG pxrC5YwJpGIaaHLuzl9RIAfx3SUHrkC+CyXcL7WNMf9iD+2msg2uOt9fwhB+VlsY7YpuXA4ufb3 DzMCTzb2qDfG9gNr2mxT9Yrzpqejwm04RbpgoLrMAdqXBs+L8o0yAk1/5son+AZfAvYzvsFxSbB dXbgn3VNcd2qYiZigFMhuVZfB8Uteg== X-Authority-Analysis: v=2.4 cv=Fr4IPmrq c=1 sm=1 tr=0 ts=68ef9f16 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=yqanLTD2VdNSX0FXSJEA:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-GUID: MdpZhlV9Eiv-WvR3ereXyAXslzRGbH5q X-Proofpoint-ORIG-GUID: MdpZhlV9Eiv-WvR3ereXyAXslzRGbH5q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-15_05,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510130083 Content-Type: text/plain; charset="utf-8" For record path, multiple read requests are queued to dsp in advance. However when data stream is closed, the pending read requests are rejected by the dsp and a response is sent to the driver, this case is not handled in the driver resulting in errors like below q6asm-dai ab00000.remoteproc:glink-edge:apr:service@7:dais: command[0x10dac= ] not expecting rsp q6asm-dai ab00000.remoteproc:glink-edge:apr:service@7:dais: command[0x10dac= ] not expecting rsp q6asm-dai ab00000.remoteproc:glink-edge:apr:service@7:dais: command[0x10dac= ] not expecting rsp This is same for both write and eos. Fix this by allowing ASM_DATA_CMD_READ_V2, ASM_DATA_CMD_EOS and ASM_DATA_CMD_WRITE_V2 as expected response. Reported-by: Martino Facchin Signed-off-by: Srinivas Kandagatla Tested-by: Alexey Klimov # RB5, RB3 --- sound/soc/qcom/qdsp6/q6asm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c index 06a802f9dba5..371389c8fa7a 100644 --- a/sound/soc/qcom/qdsp6/q6asm.c +++ b/sound/soc/qcom/qdsp6/q6asm.c @@ -638,6 +638,7 @@ static int32_t q6asm_stream_callback(struct apr_device = *adev, client_event =3D ASM_CLIENT_EVENT_CMD_OUT_FLUSH_DONE; break; case ASM_STREAM_CMD_OPEN_WRITE_V3: + case ASM_DATA_CMD_WRITE_V2: case ASM_STREAM_CMD_OPEN_READ_V3: case ASM_STREAM_CMD_OPEN_READWRITE_V2: case ASM_STREAM_CMD_SET_ENCDEC_PARAM: @@ -654,6 +655,10 @@ static int32_t q6asm_stream_callback(struct apr_device= *adev, goto done; } break; + case ASM_DATA_CMD_EOS: + case ASM_DATA_CMD_READ_V2: + /* response as result of close stream */ + break; default: dev_err(ac->dev, "command[0x%x] not expecting rsp\n", result->opcode); --=20 2.51.0 From nobody Sun Feb 8 18:42:43 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52E36222590 for ; Wed, 15 Oct 2025 13:18:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534297; cv=none; b=Z4gPapRwjjve2SEnVxxF0JfX7xmQmosS+MFcNAz2P+xhM0HZcurb/K8RXlIuJDhxuyDp+iGFIsCkx7zjIR5qE07oLo5FlB40WeG4VPdFOqmF+XWqj152eTxmeoXeTfPPuT5TMsfj07hXlEKT7JT8MkQI+NaJ2ES6kcHvxZuSLHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534297; c=relaxed/simple; bh=RaVk0a+RKh623rS5/Uu99Y1+eyNUkoTQ9NsmASmdwOA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AKfOCAsnBmgTQ9ESRIPaEeffuGUTkhg4BfkwqtooPqALXBQBm6Hyi4PibVcMvxVKJghdZKr+ZIKwjesSTL7+psnMQDZH9qB5HKHy2uRQC9P08Pxth6sFLDCD1gbULITJ5BYKXJu4SCiGXx/N720KRTTVDS2Xcs6NmqBxvlX8p+M= 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=bm5IWV7r; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="bm5IWV7r" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59FB0wFt004010 for ; Wed, 15 Oct 2025 13:18:14 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=+L0jJtoK/YM Dp/hnku7MkJnePyDIy9j+UHZwg2sZ714=; b=bm5IWV7rgHR33XD91P6tyFRTg1v NJlyYg/RGsTjFrmP0uQTA4B6+VWj4KORzSqnT2yl8tO91paVED6NUt+EDCjqZX9P Qpk+tKHRGZD/UraNctATuIGBj0JX/BSv8uT4Ov13iW+Wfi0M62Cl2IVZRCPf3JxI 4vqpMA5Ern2sf0OIMwf748Jf1fBZ7iy78OMQVIS5hHEtmO391mk9tKaQovMFODnP hHgWMocnIV4HWx4LzP3uSsj/PTVf9s1VGwyQ7Ti9q+tKS8nlTfdl/fILIKIk3fso YBgqcmb39CTDdrJ9VZJxSStbg/1E+d/StLwHZmhMi/IY1xn+QRQgUMhLJ1w== 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 49qgdg4c6g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Oct 2025 13:18:14 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-85dd8633b1bso359631085a.1 for ; Wed, 15 Oct 2025 06:18:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760534293; x=1761139093; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+L0jJtoK/YMDp/hnku7MkJnePyDIy9j+UHZwg2sZ714=; b=vwtIOChzu1Pw6vpr+FegDPSj9xFeVbkkpdcprExAMq4akHQpi2NRVoBWD2xKf6zakx 9rM6Ft7LisVU5jthjKOrtDHMV4KZD5IwafykH+ylxkHDJ6CPwIDAExmaBHCg6RAjK4K4 HD3iAGaCGSsh3pBERFOyDtl4uB8rABRZ16UFjgvbMf1rL0elaTmdbur5HapPJeFjX/P5 BOIsg1CQpc09CTViqPZNsMZCqvtWI1THRgObwzWhtIdahtyL86xyN/qF1iiRcyo7QRsf shAttsyQ7JDbTS9h06jrPWXuLCSLfnJ7bObUcZP6bLwvVJ2/MUNHPr4NvQg13A35dtNT ZNXA== X-Forwarded-Encrypted: i=1; AJvYcCVRP1Bu7247jD3cXbWKPxtpbrJFlMxltToVVh5N00AO4Wf4z1NsOpaPqvfdTgg+LnbH+HBH6YyQ4CwkzUs=@vger.kernel.org X-Gm-Message-State: AOJu0Yxh4J2YoEY9BSFzRENR+e0CjcVQV5uxAZKVj0+4N2VZ2cG1C8FU 38AZF8eaYNYPGHRQIxS2lT4iVC1s5kWKfHdTKVMRiaPj4fyArgctZfKaC5DVnfjslAidLV5UC5J OALfDocpsgFRDfIdBaeSCekWn4X9G0GY1gDkElZEACXpAH84ppqRQyqnTWC0hr/BnueY= X-Gm-Gg: ASbGncs40HACBJaCHklS5ykPYjcPQZt6nRlM/H5ksiavgGqNjP1O+0JfMlrrmoP5YE9 uFNSDyy38cfIxlfaA4R8pCjmFMI0VZdsyPS0tfzfKWEDSbQzkX5ByJpl5MgpK1nPmKop6ui4ONj SX956Lqp4kwB8RiGspeX5L1HFuhEVZZjLjXsb3XYcUKKRoL+0g9B+3cuofC2JDmVX4k8jAlSjhC R982pnb3bI5bN4OMIOgITOPVuXWK0DVOMBXr+7YrnMB0lSSzHSKyKdeh9R7aVWPrg3zsYWBW5J+ jiGIjEUCcf3T7uC4PBZTsbI0GAKjFvO0wLzshkqKbwMlyKDbZBNALg== X-Received: by 2002:a05:622a:1a8b:b0:4de:658d:fab7 with SMTP id d75a77b69052e-4e891017285mr311881cf.37.1760534293070; Wed, 15 Oct 2025 06:18:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXeHar+d1cgZyQoMv6oo1Pxrlg77uwmTnzfkBkItZ7BMtTpXrnLve600DqPbbmLhFLqpZxQw== X-Received: by 2002:a05:622a:1a8b:b0:4de:658d:fab7 with SMTP id d75a77b69052e-4e891017285mr311431cf.37.1760534292641; Wed, 15 Oct 2025 06:18:12 -0700 (PDT) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fc155143fsm262081245e9.11.2025.10.15.06.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 06:18:12 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: perex@perex.cz, tiwai@suse.com, srini@kernel.org, alexey.klimov@linaro.org, linux-sound@vger.kernel.org, m.facchin@arduino.cc, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 6/9] ASoC: qcom: q6asm-dai: schedule all available frames to avoid dsp under-runs Date: Wed, 15 Oct 2025 14:17:36 +0100 Message-ID: <20251015131740.340258-7-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015131740.340258-1-srinivas.kandagatla@oss.qualcomm.com> References: <20251015131740.340258-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: AW1haW4tMjUxMDExMDAyNSBTYWx0ZWRfX4VO0eQRzoPBT Ru5qjdPMAbWsslRQ1yEINpDW+AdqcAQbx1qk60LKZ6nIa/cDeM2t2dza9Qd+LU6VrT3ix16SzJK kLfFe9SVwhpDP27zpI79I91aY2gYfEgVQo9Q5pQIFM8la4yj6c2IMapp//qppCnHGBY+3AbEzJU 5Pb0cjzHVjpW319hvlC29oyH0SMJhTNAPVuFR6YyPSvKXkj9Ny5NYgRlafMWl2qm/kgqCOURfoq LP6/v2J4fjG03eaxd9+J7a9GyJQV/kR2b9MckKyIAwI6UcUiCgD4KTJXCd5Sz6RFzHfw1ran76d P1AjH0nK8VeKCzqzEvVF25VEi+EcOMDzguHb0vwEKXta2tWevc5rMaGCrXufHYkvksCXvhusshQ BYjnr9ji7FnyKC3qL72D+19Vn9C+GQ== X-Proofpoint-GUID: ltWayNmvHQlAT09Ki0fbi3FslC-7hZPg X-Proofpoint-ORIG-GUID: ltWayNmvHQlAT09Ki0fbi3FslC-7hZPg X-Authority-Analysis: v=2.4 cv=J4ynLQnS c=1 sm=1 tr=0 ts=68ef9f16 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=mP2nE0ReLvtCR7eOSfoA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-15_05,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 bulkscore=0 suspectscore=0 clxscore=1015 phishscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510110025 Content-Type: text/plain; charset="utf-8" With the existing code, we are only setting up one period at a time, in a ping-pong buffer style. This triggers lot of underruns in the dsp leading to jitter noise during audio playback. Fix this by scheduling all available periods, this will ensure that the dsp has enough buffer feed and ultimatley fixing the underruns and audio distor= tion. Signed-off-by: Srinivas Kandagatla Tested-by: Alexey Klimov # RB5, RB3 --- sound/soc/qcom/qdsp6/q6asm-dai.c | 34 +++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-= dai.c index 0eae8c6e42b8..db2ea8973ac9 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -64,6 +64,7 @@ struct q6asm_dai_rtd { uint64_t bytes_received; uint64_t copied_total; uint16_t bits_per_sample; + snd_pcm_uframes_t queue_ptr; uint16_t source; /* Encoding source bit mask */ struct audio_client *audio_client; uint32_t next_track_stream_id; @@ -85,6 +86,7 @@ struct q6asm_dai_data { static const struct snd_pcm_hardware q6asm_dai_hardware_capture =3D { .info =3D (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BATCH | SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_NO_REWINDS | SNDRV_PCM_INFO_SYNC_APPLPTR | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME), @@ -108,6 +110,7 @@ static const struct snd_pcm_hardware q6asm_dai_hardware= _playback =3D { .info =3D (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BATCH | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_NO_REWINDS | SNDRV_PCM_INFO_SYNC_APPLPTR | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME), .formats =3D (SNDRV_PCM_FMTBIT_S16_LE | @@ -182,9 +185,6 @@ static void event_handler(uint32_t opcode, uint32_t tok= en, =20 switch (opcode) { case ASM_CLIENT_EVENT_CMD_RUN_DONE: - if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK) - q6asm_write_async(prtd->audio_client, prtd->stream_id, - prtd->pcm_count, 0, 0, 0); break; case ASM_CLIENT_EVENT_CMD_EOS_DONE: prtd->state =3D Q6ASM_STREAM_STOPPED; @@ -192,10 +192,6 @@ static void event_handler(uint32_t opcode, uint32_t to= ken, case ASM_CLIENT_EVENT_DATA_WRITE_DONE: { prtd->pcm_irq_pos +=3D prtd->pcm_count; snd_pcm_period_elapsed(substream); - if (prtd->state =3D=3D Q6ASM_STREAM_RUNNING) - q6asm_write_async(prtd->audio_client, prtd->stream_id, - prtd->pcm_count, 0, 0, 0); - break; } case ASM_CLIENT_EVENT_DATA_READ_DONE: @@ -311,6 +307,29 @@ static int q6asm_dai_prepare(struct snd_soc_component = *component, return ret; } =20 +static int q6asm_dai_ack(struct snd_soc_component *component, struct snd_p= cm_substream *substream) +{ + struct snd_pcm_runtime *runtime =3D substream->runtime; + struct q6asm_dai_rtd *prtd =3D runtime->private_data; + int i, ret =3D 0, avail_periods; + + if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK && prtd->state =3D= =3D Q6ASM_STREAM_RUNNING) { + avail_periods =3D (runtime->control->appl_ptr - prtd->queue_ptr)/runtime= ->period_size; + for (i =3D 0; i < avail_periods; i++) { + ret =3D q6asm_write_async(prtd->audio_client, prtd->stream_id, + prtd->pcm_count, 0, 0, 0); + + if (ret < 0) { + dev_err(component->dev, "Error queuing playback buffer %d\n", ret); + return ret; + } + prtd->queue_ptr +=3D runtime->period_size; + } + } + + return ret; +} + static int q6asm_dai_trigger(struct snd_soc_component *component, struct snd_pcm_substream *substream, int cmd) { @@ -1215,6 +1234,7 @@ static const struct snd_soc_component_driver q6asm_fe= _dai_component =3D { .close =3D q6asm_dai_close, .prepare =3D q6asm_dai_prepare, .trigger =3D q6asm_dai_trigger, + .ack =3D q6asm_dai_ack, .pointer =3D q6asm_dai_pointer, .pcm_construct =3D q6asm_dai_pcm_new, .compress_ops =3D &q6asm_dai_compress_ops, --=20 2.51.0 From nobody Sun Feb 8 18:42:43 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DCC4225A3D for ; Wed, 15 Oct 2025 13:18:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534298; cv=none; b=J+hhjxcI37znhGeQWgrfP9ZA7LHcaYA4N8oawo3VI4x2Gi+iHaA1URPZLt9DW/a2R1uoDNLIgUOgtibMMzcQosvCTyVIrlaPqZKSYIhdaddns3ixaBTOADm+HsbHAafhi9uwfMMzhZaVO0jjKvH3tsDY3Pn1FwHDW1oxf4CLgRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534298; c=relaxed/simple; bh=gw6jOBRXvp96kuxuVwkfEFK7rpHtMnm9kKwZNmCz2N4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YxbrOeuJ3ERjqUt8WksELAi5VSiS123RNGHPkWMZuvjhCJX2lHoSMeFdHJf8NV6zQPvbi5OHJuBbQkVH1aM/uy0WPm5dW2A14Zwi4+18ooPfCHMG7kB+Cr8jdsiCt9BxKeEMCVziOGv72pYVljQCSMq0IsQBXVCJly+3wOTiGXw= 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=azpZgUyh; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="azpZgUyh" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59FBV0xs024770 for ; Wed, 15 Oct 2025 13:18:15 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=C9C2sc2A6OP brM7m6MIVjYsiz10pmNe9evy2xuv6tEM=; b=azpZgUyhP+hcg5yBdlxmqdcyX3x ompOsmYcvwietzbHAu0Or419FspEZmUtfJFlV8XGPbj3FetpE4mLgVZKh0zB6wa3 FtqOEtOnibt0R2Zw32NCD/P/rTXz8nEKwzVQkMkzpHr9KMGrPBgnZjcvNoXOltXq IiFlEGz6GOiRTI6ygSYeIZzTIYRNYCMD8+ncPN/m3g8/xnWO7GL0MjNfpbi1Ijf3 /sxOkYzfAFv18ZO22zcfeygpw2FuYX/MoBAfXX8xwVsH+3+Y4s3vepMNL+wN7fE5 sFYjDXpuOFghaJeNcfW25VB5qkqnaRAvhP7XV2E/n+w5G6SB5tFlFZtKI+g== 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 49qff0vfyv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Oct 2025 13:18:15 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8645d397860so1595285a.2 for ; Wed, 15 Oct 2025 06:18:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760534294; x=1761139094; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C9C2sc2A6OPbrM7m6MIVjYsiz10pmNe9evy2xuv6tEM=; b=B/HtCVCuu3e0vH7JI+76K21GU3Y1nvAHpbKzMyqVaPtHISIVjE6cIKPSeUrzgJLSPL e8XqNbDva81MXkmDt1DS33a7nZFkoEuj7Z50JbEKUbavUhtk+fjtD2sdS04Ph8KNsDyp tpbKGM1tq5oJtbIXjoIIVLeVpF4qRKw4Mn1fwQ7bJ+7Zscgza+PkUP0wRP+SetF8Fv97 qbLhIwRC33eKvMCmJsKK3/shXBq0Ah2a9lNJiT2WbxBi/60rD631GOn85rWlr0rZPe0q C/BImLq5/6gUfxnOdhBuob+t/WzeHMxPVPpOGG5yag9Y5PoXwVq+7iwHphGN16KHPlTX RSJw== X-Forwarded-Encrypted: i=1; AJvYcCVHbI2o2DsiEmPBUX4MvZtHKDmB/fn4aoo95SfIOP6HqdzIGpKTAiaGGbGJo/cCIeN8WLIIXiurCUWuB/Q=@vger.kernel.org X-Gm-Message-State: AOJu0YxMeBdmIyImL7r11XEwbR9Mu3pPUR05iYfHrgg4fZ6Q5c3K216t 3yhKGdQwv1S24JZp21P6+ViJzpBU9Ly46oWAbKkE2tTaj7a/7RlXLLF55fyer9qNhpLzk8fjsdL RvdhfqnVefU5a7Dh7gRZvvOambwFiTdU8Tm98qSnZoeuwz8ZEMVMhkn7AqTyE8a7ajik= X-Gm-Gg: ASbGnctIfQqh/rD1o/kU5QKGDt7+Q8tqMoM84nM9vrMm9cR+b9VJlGKlGXOxqGknctT LF6lVOa+F2EHvsrSkjtgqH1OiwnPYcCeMJzHdPM7w++XRdXHTtaLv1tm+GpXQvOtMZCci+3SdiC +dkFMS4xb+NEpboF9ylTqAT67jtNGb3y1xIRKrm5ePgupRgVONFQkToAniBbcBSoiTkH4TYnRW/ NZNeQFS77rZYxT63rhCehm/AOgXdcAXYQdLKPr8Gm7EUU8RfrMgvT8n4s95vJKSO2RFNl1NGfu3 +PszfCtnlo+lnTAOCkuNFkgZk4WF7x5mz5vdVVK2b1CJLesx8Lx2pQ== X-Received: by 2002:a05:622a:18a9:b0:4e8:8c91:1d0b with SMTP id d75a77b69052e-4e88c9129c8mr11072211cf.61.1760534294202; Wed, 15 Oct 2025 06:18:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0CMlu9MhDFwvPcSu58T/hp5Z9HiQvZdCOtofLyrFvYZAEP6D+IxtDxCV4LRU3c7gZPSgu+g== X-Received: by 2002:a05:622a:18a9:b0:4e8:8c91:1d0b with SMTP id d75a77b69052e-4e88c9129c8mr11071621cf.61.1760534293674; Wed, 15 Oct 2025 06:18:13 -0700 (PDT) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fc155143fsm262081245e9.11.2025.10.15.06.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 06:18:13 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: perex@perex.cz, tiwai@suse.com, srini@kernel.org, alexey.klimov@linaro.org, linux-sound@vger.kernel.org, m.facchin@arduino.cc, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 7/9] ASoC: qcom: q6asm: add q6asm_get_hw_pointer Date: Wed, 15 Oct 2025 14:17:37 +0100 Message-ID: <20251015131740.340258-8-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015131740.340258-1-srinivas.kandagatla@oss.qualcomm.com> References: <20251015131740.340258-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: AW1haW4tMjUxMDExMDAxOCBTYWx0ZWRfXyBw8mKqEI17I PnIQ03o9j5wBpY+dNJqoJpd3wqEyf1byn2SdXHfZuA2yIBLybDkFBkDD8YjgwKLEUVGx5I/xpY3 YENszdrN4LwN/J4se8KHNA6z70lBosL75i9KOjprRmp7LY3bngwQo7aDuGEgO3svLU2KACLu/1h Ctg9QTmld8lC/YGZAaMayLjPeLNEbGnOcNzrT7l+WSRiX7FSTwqyFQcTgljGZpZm/o8zrSuugex 6jnZzkFlBF4qrjYM28Nb9dc4jjPmMR9y7pyCY9xYdVmiNp4iaaLqqxeVREX7c9CwELnBE3JfNoV zYYBrGtQSIfK8BkIPX3z3oBbvGZE9RIL84AsrTO+w== X-Proofpoint-GUID: f2EPjqsbLiXka6AoIrWimhru4H0njS-4 X-Authority-Analysis: v=2.4 cv=PriergM3 c=1 sm=1 tr=0 ts=68ef9f17 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=Xpi1c-eeJLz4SkQ0e-MA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-ORIG-GUID: f2EPjqsbLiXka6AoIrWimhru4H0njS-4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-15_05,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510110018 Content-Type: text/plain; charset="utf-8" Currently we are performing an extra layer of calculation on the hw_ptr, which is always prone to errors. Move this to common dsp layer for better accuracy. Signed-off-by: Srinivas Kandagatla Tested-by: Alexey Klimov # RB5, RB3 --- sound/soc/qcom/qdsp6/q6asm.c | 12 ++++++++++++ sound/soc/qcom/qdsp6/q6asm.h | 1 + 2 files changed, 13 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c index 371389c8fa7a..643ca944b1b5 100644 --- a/sound/soc/qcom/qdsp6/q6asm.c +++ b/sound/soc/qcom/qdsp6/q6asm.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -248,6 +249,7 @@ struct audio_port_data { uint32_t num_periods; uint32_t dsp_buf; uint32_t mem_map_handle; + atomic_t hw_ptr; }; =20 struct q6asm { @@ -598,6 +600,14 @@ static struct audio_client *q6asm_get_audio_client(str= uct q6asm *a, return ac; } =20 +int q6asm_get_hw_pointer(struct audio_client *ac, unsigned int dir) +{ + struct audio_port_data *data =3D &ac->port[dir]; + + return (int)atomic_read(&data->hw_ptr); +} +EXPORT_SYMBOL_GPL(q6asm_get_hw_pointer); + static int32_t q6asm_stream_callback(struct apr_device *adev, struct apr_resp_pkt *data, int session_id) @@ -703,6 +713,7 @@ static int32_t q6asm_stream_callback(struct apr_device = *adev, goto done; } spin_unlock_irqrestore(&ac->lock, flags); + atomic_set(&port->hw_ptr, token + 1); } break; case ASM_DATA_EVENT_READ_DONE_V2: @@ -721,6 +732,7 @@ static int32_t q6asm_stream_callback(struct apr_device = *adev, } =20 phys =3D port->buf[hdr->token].phys; + atomic_set(&port->hw_ptr, hdr->token + 1); =20 if (upper_32_bits(phys) !=3D done->buf_addr_msw || lower_32_bits(phys) !=3D done->buf_addr_lsw) { diff --git a/sound/soc/qcom/qdsp6/q6asm.h b/sound/soc/qcom/qdsp6/q6asm.h index 519e1b3a3f7c..6fafda5bd849 100644 --- a/sound/soc/qcom/qdsp6/q6asm.h +++ b/sound/soc/qcom/qdsp6/q6asm.h @@ -148,4 +148,5 @@ int q6asm_map_memory_regions(unsigned int dir, phys_addr_t phys, size_t period_sz, unsigned int periods); int q6asm_unmap_memory_regions(unsigned int dir, struct audio_client *ac); +int q6asm_get_hw_pointer(struct audio_client *ac, unsigned int dir); #endif /* __Q6_ASM_H__ */ --=20 2.51.0 From nobody Sun Feb 8 18:42:43 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C0A023957D for ; Wed, 15 Oct 2025 13:18:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534300; cv=none; b=L+gDH0vkHzUCJu0B8BmlqdboALhGGeQAtGdrhIuuZV8FIdu1/lQTjNRED6JuFmz1DfMHZqW3eiSXoWMxY6qmkMPGgw5NjGxi1PqtBso0nGb46jSzf3+1CPkqndG+TwACrhT73TjRIn9SQE0A+oAToeFMw7yTpd0RNAB83AiVczE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534300; c=relaxed/simple; bh=PF8KzK7QUo1Pnp8R3uu5jVDc2qztm42DD2eaGLKLB8E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cr82fCTf5Y+hkqUk59G6V0s2YyUMJCnCPF+bV3kZ/nkG3PXkDwuJS+X2fJzTUMhIw2NtGjLy+dofAgDi9qIIXcG3kVpH2dWbSJI7LyABZHhjnWL17P15ToyrLA+9VX1YL3SSpZEEFwSRGU2iBaZiCHJ5suVK3kqTE33o3Ay078M= 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=eaMNKWYk; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="eaMNKWYk" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59FAjK83005021 for ; Wed, 15 Oct 2025 13:18:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=siHiEg0ChON De0CD1JcwzaBFof10K1E7cJD3IESL4/Q=; b=eaMNKWYkF6I6aWt8cgRya5gIy2K dFimXc2SE5MVoyTR2l8BY38gxHp9zfJc+UiWumO4VAWx4CTfWP4ZFuj1vfzJSMro HddfFiZTaXjeMtF45/Wm9krg1/V7IN3soUhUxHA2WF/WXz0pjoZQ8dlTeQ1nzK+s fCSgxTucz32XqVrm+gNpNHgEBHQS/fZMSfwlxoqhEXZdzYjanMWhiu1RxdMC2MNr EoRBvatUFFxVRx+Q6/YdvE+prw5ps7N3Ngxb73TM3UWIJQ0W3b9P7CiLs8rvTP+r kWGAK0xxJBt2DZGJuTIA/dX/6/Gv9xkQ3Jose3l8vaJgy2KQVrQlbi23iJA== 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 49qgdg4c6r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Oct 2025 13:18:17 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-88ef355f7a3so65453885a.3 for ; Wed, 15 Oct 2025 06:18:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760534296; x=1761139096; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=siHiEg0ChONDe0CD1JcwzaBFof10K1E7cJD3IESL4/Q=; b=HckuMhdznYIn+t6h8SjgVSFZLKUE2Y+Eg7RfZOMeA4jJfT+oRdETAJDz0NgzIBaXkN CdBbjb6mGCZ+NtEB6QvUDeRWg8RCUmWcTCy3pZseC95op3hSlFTwkRFuJMY3l3QL3FpG QXlIuDhBzK5ztrWkL4CC0cqQ9QxrRJXMb3/ZhKrnOPsYIz4T3qh5hMYVKrPAHrRfnTTx zjivkWvV3yy6mJ1JTQN2qSMYs9QckFppx0mTaVpyKupVubNtuB8aRApXK3kgyRGIUajQ XoFM71ZIt9NI2zNbU8qHpHkbQFi92EuJcw87kyXSx+IAVSj3HkA0PvfOaZuS1d5RU1hA DJlQ== X-Forwarded-Encrypted: i=1; AJvYcCVxP0HZCeHfm7I6e17InxazV4I43StXwfD56dD0aQ9yHtoGis3d7RcXOIdO5crRNGWQWpe/wgCBjxAUsQs=@vger.kernel.org X-Gm-Message-State: AOJu0YweAMEhbrryAHvgO0oygDEPBzjbDVsYQ0VW8wcoIEM1aQgZfSlg ClOyEyUM1GHPTmPqPyw5ufjTGYLU/gaNujz+1CezOK08hkvkZ0gJhTq2UtAEV627tOshPDtRPyd sHzMiC1tJ8e+WosxPscQrUyBBkZRlt2AjjFQaqDO8i91AJwSd84EOkIUKr5ZOT0t2q4w= X-Gm-Gg: ASbGncsxz7uAnN7C+DKioo+QHorA0tGUwfquCtuNQ2FLlWOQaL//tNcDwDXgBzmnx3c 6KjcurI5d5y9+aYad/fVsZmrpCnJTG4tBOhCkI8S/hA5VgggEl3hBwqIBOZ77dwAsC4x+oOnjIC FONP/wLi35WUTH8xPxOsJSMonBGd0hI0p0GTovXhFGGIHRcOQv/qVWEA+FiPrwEB59IkUPUlC6N L8P2MudWwp63nW7LSSUmceKJLLLudOJK0eCTZ55xf4Upv2pQiFFhneqVUzAvSWlLpk1X/U98iVU DdStOPi7O+UQ5NMchcpi7uKskgBpLjD0wtC/5kv7ys3N7SXfztU1FA== X-Received: by 2002:a05:622a:30f:b0:4e7:222e:6725 with SMTP id d75a77b69052e-4e7222e7357mr143718111cf.8.1760534295405; Wed, 15 Oct 2025 06:18:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0npG9+1zbTGtTaMbasPsz8fCXlWoscmPo0jpNvyvC4yD+pVmLW3dGwrcnf6T/u6dz3SeqvA== X-Received: by 2002:a05:622a:30f:b0:4e7:222e:6725 with SMTP id d75a77b69052e-4e7222e7357mr143717161cf.8.1760534294610; Wed, 15 Oct 2025 06:18:14 -0700 (PDT) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fc155143fsm262081245e9.11.2025.10.15.06.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 06:18:14 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: perex@perex.cz, tiwai@suse.com, srini@kernel.org, alexey.klimov@linaro.org, linux-sound@vger.kernel.org, m.facchin@arduino.cc, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 8/9] ASoC: qcom: q6asm-dai: use q6asm_get_hw_pointer Date: Wed, 15 Oct 2025 14:17:38 +0100 Message-ID: <20251015131740.340258-9-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015131740.340258-1-srinivas.kandagatla@oss.qualcomm.com> References: <20251015131740.340258-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: AW1haW4tMjUxMDExMDAyNSBTYWx0ZWRfXxm6XqwRaScMV e9PfEEnMPZBT6i/MsQEexr8WqnL84m9Nc2BCdcr/lmkooqfQWZHg54ILoVBzkHYN9fZndsYxo7a pdqCoG8UH/8kNyvxjlrRiwWbw4yfJVsH5ZO/wllOEjXey4Btj5mVVg2T9BGNP4466hTGx35GgwN s0/rEQVGovfPGBYTRA1xnmz8B/lcR+4zva0iT/jq0AD++tEdEBZtu0nfXOtQCwOzjaw8pymyRSq rTyl13NmjkG88hhVvsjwkEP//AVdBZ3nl5yIsMaq5LxUpeSaRzxMJdAnyl7t81sJB0fC3vpGNPX +yNoGCl+lGkDuAU0AePceL8IR/zlTHJiKuibypzH/Cp9E7M4BaHs3K+CDRwkTo4qy+Yn6nRgucD AbEHCI4iQxxLn3eur/kCjJcfe0JfkQ== X-Proofpoint-GUID: Ov8y9rJ69gvIYnxA6jz_ZzXUX0y5od-h X-Proofpoint-ORIG-GUID: Ov8y9rJ69gvIYnxA6jz_ZzXUX0y5od-h X-Authority-Analysis: v=2.4 cv=J4ynLQnS c=1 sm=1 tr=0 ts=68ef9f19 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=ngjuI6RAwNlUvKc_ZX4A:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-15_05,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 bulkscore=0 suspectscore=0 clxscore=1015 phishscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510110025 Content-Type: text/plain; charset="utf-8" make use of q6asm_get_hw_pointer to get the current hardware read/write pointer and remove any additional code that does calculate this manually. Signed-off-by: Srinivas Kandagatla Tested-by: Alexey Klimov # RB5, RB3 --- sound/soc/qcom/qdsp6/q6asm-dai.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-= dai.c index db2ea8973ac9..c2a33d6a0827 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -58,7 +58,6 @@ struct q6asm_dai_rtd { phys_addr_t phys; unsigned int pcm_size; unsigned int pcm_count; - unsigned int pcm_irq_pos; /* IRQ position */ unsigned int periods; uint64_t bytes_sent; uint64_t bytes_received; @@ -190,12 +189,10 @@ static void event_handler(uint32_t opcode, uint32_t t= oken, prtd->state =3D Q6ASM_STREAM_STOPPED; break; case ASM_CLIENT_EVENT_DATA_WRITE_DONE: { - prtd->pcm_irq_pos +=3D prtd->pcm_count; snd_pcm_period_elapsed(substream); break; } case ASM_CLIENT_EVENT_DATA_READ_DONE: - prtd->pcm_irq_pos +=3D prtd->pcm_count; snd_pcm_period_elapsed(substream); if (prtd->state =3D=3D Q6ASM_STREAM_RUNNING) q6asm_read(prtd->audio_client, prtd->stream_id); @@ -227,7 +224,6 @@ static int q6asm_dai_prepare(struct snd_soc_component *= component, } =20 prtd->pcm_count =3D snd_pcm_lib_period_bytes(substream); - prtd->pcm_irq_pos =3D 0; /* rate and channels are sent to audio driver */ if (prtd->state =3D=3D Q6ASM_STREAM_RUNNING) { /* clear the previous setup if any */ @@ -479,11 +475,13 @@ static snd_pcm_uframes_t q6asm_dai_pointer(struct snd= _soc_component *component, =20 struct snd_pcm_runtime *runtime =3D substream->runtime; struct q6asm_dai_rtd *prtd =3D runtime->private_data; + snd_pcm_uframes_t ptr; =20 - if (prtd->pcm_irq_pos >=3D prtd->pcm_size) - prtd->pcm_irq_pos =3D 0; + ptr =3D q6asm_get_hw_pointer(prtd->audio_client, substream->stream) * run= time->period_size; + if (ptr) + return ptr - 1; =20 - return bytes_to_frames(runtime, (prtd->pcm_irq_pos)); + return 0; } =20 static int q6asm_dai_hw_params(struct snd_soc_component *component, --=20 2.51.0 From nobody Sun Feb 8 18:42:43 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 6466323B628 for ; Wed, 15 Oct 2025 13:18:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534300; cv=none; b=CaCTxqxdiHe6mVlERbD7R+ea944W5QzIPOkUq9F5kN705c4eVRyV28qA5PhhVQGONYApwmcgwyhVbkd4jDMCJxlQB9+G87j6/7bMyVwhtaon5KyCOu3RoanpnpLrixePJkfOp3S9KudZuqtPPObtU3f0uEjOAa3dvr2tJhRAQsw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760534300; c=relaxed/simple; bh=mHHpksYNvrqCcT9vbu6eHsvNp/9SL9pX3pbcMgnpkWg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LrSqlN1F4K/oF8dhNQz4eOBawLEv94rTO2TTM+DXh1TDB808ea6rScpPpU7ZzqbKHs0vjLF91vtx1ZkSPb8RmyZpbDkv7DbvsatMNAQEvzd/llOPZcfqoZH+MyeJbgyilvZ9CUGIJM3AY4POXidfuT3DXS3Wiv1jXmBCPILV7Kg= 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=YzZAZ7p9; 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="YzZAZ7p9" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59FAUo3u003404 for ; Wed, 15 Oct 2025 13:18:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=ZT+0rRtvs50 XRBp1BW4ZCSU4gfhMJjkd8JcHG8nO/pw=; b=YzZAZ7p9QgHqm37k8KIqAqn99ws ySimm3XR00UldujnpgUieFIeadi8MbVcERYqYbiERmT1EXkjUn+deWrNFLyQKHND nG6ilvXE2r7v0JN/vtPunzzS30Cp1PI8QsbI5D66n0REfwR9RF31gQIArYbVlLl8 +1oUiPPMZYv7AbJ/jNC8JZRHMuUhn1jS983oE6ImW7zIqFeUU0tBauD+NC4Mpj2p 1HJrHuQICf94amjB3/7Mie/8m1YfQfJOTMO5euyNEjQ6dtNaA1c5x8+8jShSk1tf pSOAcgH6Vwm0CIx5+WEp8FxW/eiilXWWMz78oBV2lzLtwcA0xSag01yCwKA== 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 49sua8k3vb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 15 Oct 2025 13:18:17 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8217df6d44cso2711389985a.2 for ; Wed, 15 Oct 2025 06:18:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760534296; x=1761139096; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZT+0rRtvs50XRBp1BW4ZCSU4gfhMJjkd8JcHG8nO/pw=; b=syqIXoJVOBkFyu/bENZQu5zpwYw9riYyqXcWJJIJzchMO5e39JfuEJTlYkmyC96kBE K4vrg7uIYnV9NbL6Rb/8iWNroSy2Q7oxQlhGosv1qo3rriVFkPZjiyv3KKpd2nNbbWMt hD21+n2ldjm3RY3QddIhAAU7L3fTN5Qv8Pgc0J5rmEuimY3V7UcU2EB4gyL4iQH5ohax mbvKoBVmn6xSt+ve7ZwOYtzgR+kZwztsu1gGojaZaXNA2As6I87fTzRQemtUfJDlRBuV l+0EELweaZ9Nd5yIZD5IA3jZ0nlhQU6oukL7M223Wf1xPpjAWXuFc4bf22Sif8yJKDNK /EMw== X-Forwarded-Encrypted: i=1; AJvYcCWZivU2CnrQJfPOuOY7kVxrsXqdKhb4BsXpXs2n8fM+D+Bg1P9Eix6rsVRzMVt1bEBXuzLmKeHEBLJKpFw=@vger.kernel.org X-Gm-Message-State: AOJu0Yy6g+wfwJeiyAZZ3MwtBNK0fpE18AegJKaXOX4M3cDMjjmvcu0m rz6/Q+7yLPJdPel7OBwbU1WqP1fW3ZE/yt+dvGXpFMCM7BFSNdTOvVqtwBB5slH/CUDpYmnmtuo +MPneiC/vrTzNk17cIjKss9jG5T/Hqp1BixfQCaSwHXXdgQADWs1VWLh5OK/U/gcIBjg= X-Gm-Gg: ASbGncskG3GgWLbFd7xqQ8tpnp0s+k6EjgZA2tmzzJYmaPvEWS9PvuuOdlh9bWaJ9Y5 dt8gPrEPsBWEZ/SKDVh2VD/igBNRB5kWvcTeymFr3q0rVc94dgZ1kopoIXflJUZCrbpqlxF6eSR EPWNB+3njExIZfqZubKOJK7mOmQ8jyTuY7v679Xu+F0TIXXCrrPZRrJkHlrRW85yF9aRYhSP1U2 v0ICodc1w4dBHvKthP3HNTdg+Kj/TywPjqIIn8b10r6WEyMIHl3rHjWuCFbLdoK/KrzmY1RUY8t CzRjqKufOQA5FZpeGtHrQbGctmcj86FxzyfqY2nascKvrD2hC2Mc1g== X-Received: by 2002:a05:622a:1a9e:b0:4e7:1f73:b40a with SMTP id d75a77b69052e-4e71f73b42emr156480171cf.1.1760534296161; Wed, 15 Oct 2025 06:18:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtim+HkRY58yGLvCgiO1qtGySVPyoWgNetwZg54hH/ZzI/xMzFzmKFFqAAZCU5tJGw/TQxUA== X-Received: by 2002:a05:622a:1a9e:b0:4e7:1f73:b40a with SMTP id d75a77b69052e-4e71f73b42emr156479521cf.1.1760534295614; Wed, 15 Oct 2025 06:18:15 -0700 (PDT) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46fc155143fsm262081245e9.11.2025.10.15.06.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 06:18:15 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: perex@perex.cz, tiwai@suse.com, srini@kernel.org, alexey.klimov@linaro.org, linux-sound@vger.kernel.org, m.facchin@arduino.cc, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 9/9] ASoC: qcom: q6asm: set runtime correctly for each stream Date: Wed, 15 Oct 2025 14:17:39 +0100 Message-ID: <20251015131740.340258-10-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015131740.340258-1-srinivas.kandagatla@oss.qualcomm.com> References: <20251015131740.340258-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: TDaXXCtFmV6JkFV9XfSpwrrcaCd_LUUQ X-Authority-Analysis: v=2.4 cv=e5MLiKp/ c=1 sm=1 tr=0 ts=68ef9f19 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=KIUBPGGZ3vVIRF5Z0fMA:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE0MDEzNCBTYWx0ZWRfX/iPHXour4mb6 heOcZc0+AxKUisT/bNG8Yb71VNp01vXBzIAEqv5suV2bJGkwjHRW/b9fDlii5jAnd/pruxV7mIv CWZJeztn9hcqeXhgc5FkHlxaB8S1rNRfwXNR66vRmuVn9+S5EIUZoBGRmxcOdze9fS4CSQcHc6t u0BcBiqbNqHNhiP/utDNt46+BAJ8v+jRUFRtEMWlZ8+DZop6lnQXpO77VaW76uWH6oEGbP2xO9d lT9O2YR2KfQyphGuGPoGbIkupEzR61aClBVub7VcxxRuVWsXj4rGpY64rMNcnfxJgns5pKSf2d3 x/cLnL1UWydWT0HE1W4NBzYkc+ZRI53BcybwuHcFRkFDXyYQAUN+7mC3+0VrbCiChnV13vmN7yc 92UlKiBRiDg7zOj0VGGNv5tlVd4QpA== X-Proofpoint-ORIG-GUID: TDaXXCtFmV6JkFV9XfSpwrrcaCd_LUUQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-15_05,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 spamscore=0 adultscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510140134 Content-Type: text/plain; charset="utf-8" Both capture and playback can have different runtimes, so set them accordingly. Signed-off-by: Srinivas Kandagatla Tested-by: Alexey Klimov # RB5, RB3 --- sound/soc/qcom/qdsp6/q6asm-dai.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-= dai.c index c2a33d6a0827..97256313c01a 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -433,10 +433,13 @@ static int q6asm_dai_open(struct snd_soc_component *c= omponent, =20 runtime->private_data =3D prtd; =20 - snd_soc_set_runtime_hwparams(substream, &q6asm_dai_hardware_playback); - - runtime->dma_bytes =3D q6asm_dai_hardware_playback.buffer_bytes_max; - + if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK) { + snd_soc_set_runtime_hwparams(substream, &q6asm_dai_hardware_playback); + runtime->dma_bytes =3D q6asm_dai_hardware_playback.buffer_bytes_max; + } else { + snd_soc_set_runtime_hwparams(substream, &q6asm_dai_hardware_capture); + runtime->dma_bytes =3D q6asm_dai_hardware_capture.buffer_bytes_max; + } =20 if (pdata->sid < 0) prtd->phys =3D substream->dma_buffer.addr; --=20 2.51.0