From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794403696; b=EDTMm4JuZUuBnlsP1CeEOkT6GliIF8VmeyNSIxqDzcWWglNOTUIJiFWqmFTJGT/c4QHD 6d8VxtIBGGpqjThrAd12jUvaGGr5hBA2+6U2cMGZRj7qBnNERzBh5U76HD7AaK24AyRVI JKJg2o8eJEPxgeFEHyRRvnE9Q2LTyRi0UMcIzQy0gjffj627N11s74MuSu9XhQ1sLXlEj ZotJc2lJ3jstYexixK4wpxT+DjMxCctRhboYV8bdZNbZAtAyo4PdOtCB6tKDbeMuoQ9fw 6JqI7zg/J5yZfLZVP7bJocSnI9OCuH+PcGH1sZl/g2QZtw6aYu6KXtJv7UEihot3jdw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794403696; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Date:From: To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID:X-Authority-Analysis: X-Proofpoint-Spam-Info:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=D8tiVvDZECe3f0eKJKeC5Qfbzxcy8k/h5VkY0prNfso=; b=CQAnFxQV6fFK0OJhkSEwoWQ07R9KTGYq7juccZzCu9JyyQZfy2qCllZ7Vf+W7uhDmS45 L9FaLjPcTcKzMMhwtscVIlCVslEBxMV9d9wIO4iSaJZC3w1+bbKl9Gp9PpFmZfsjnGqNF aL5yWWI0ouCLT9VSACFPBXkIC6pSvzI9BnIrOaqM6qn36WIUHdSZClnGO4ciify6m1VUB lRNBE1H/ne/BC/3Jf96zrjv2sBQW3wTrw0KkzvaQCr1nVy1P+iNFwH/u/iLK4uFHQintD u5pNe4YmeqdtRqCwu8+c2YiSsKjZKWcPQd+zPDCWqcKY/ozLV23ioozUxe3Chr/U+0w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=cA1nNL6B; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b="AReZ/EYK"; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1598606A32D for ; Wed, 11 Nov 2026 13:28:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C1598606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=cA1nNL6B; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=AReZ/EYK Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6ABCZNBZ3292404 for ; Wed, 11 Nov 2026 13:28:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=D8tiVvDZECe3f0eKJKeC5Qfb zxcy8k/h5VkY0prNfso=; b=cA1nNL6BQlNjeEQ+n8jZZ5Gc/RZbeheDna8SfpuD 2Q/U0dVRQ5f8ipS0A6O7B1e4vXrO5gXRimO/BHETxq5TXkB6Y2LyJchGOcQcRg4/ 8/1s7TEA3R12HQ83LshibgQHYs0BTyi1oWKgYgvSi8vUuF+T3A2R+GDwt4Fc7eGq YNxhAvRKSzsZKuhzsd040ReluQ+jSjsnwc1SN+4q0CqeorpNIr0MBT0wmyCRzHE3 HNYvqzfb1GaXpeBuo8Mrme1XWbCwZK4/sRYtf+8/II2UDEekd78zmPaEAFOuAv7e xalaa+VE2aPalUnORiTbC1rjFfDBJ0esXnn/b14+SZTx7Q== Received: from mail-dl1-f71.google.com (mail-dl1-f71.google.com [74.125.82.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hvdnp2nn1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 11 Nov 2026 13:28:15 +0000 (GMT) Received: by mail-dl1-f71.google.com with SMTP id a92af1059eb24-1b3b5b49cabso2854103c88.0 for ; Wed, 11 Nov 2026 05:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1794403694; x=1795008494; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=D8tiVvDZECe3f0eKJKeC5Qfbzxcy8k/h5VkY0prNfso=; b=AReZ/EYKRJ49uZ3iSJImf63HRUs/AnlYniXLTTWBe/c2Kq51F+cZ3LXdQ/XmrmZnu/ cAe2E0J++IlHs/xwSeGu4+sRmGE60/LwLUL+l/x9H9GgeF4YHbN44oocMnBCi4xu6DGd vbS2sPvj+3uFUQFSSf8+yShwiUnsDl1mnBmkfOn61aarxemgsgYGQJXYYg0VTrfH98eY xRol9kkzLtSdYMxKcVsqusK/kkHAZCUtDynCJuRQzdi+/+9u1F468KLs6BgCWG1mzR4A nIetysNqvlZTrv/hmqpiiWr8rR6G6bTs3rxQik5JrnmDmyAUhtplHgS+axbr1sGiSnRv HyJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794403694; x=1795008494; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=D8tiVvDZECe3f0eKJKeC5Qfbzxcy8k/h5VkY0prNfso=; b=kcEnZnrxCEjC94qqItN+EXGmPZkJ/LW5s28xb6MMw9zlxchUczfqX/ubJiObK9QhVU VPI+waRKVcBWXQLyktV/qwiVG+AVhkFkpWf79AYPzaybIdQaZV+o57AKMR8zGihWO/j6 kRvez9+Yf2K9mJ+EfAAWA7zq/DdJ3h/hhdrRy8bBFf7fxu4qAb+3+0EWwJ1iFsqCN7wa mODIERdguCGXMfrtL7yTFzDriomRu/+wAt8BvN4YdXcYoQD9UthWgJ+Lps5Dv+yiybUP XSvRxddbXjFM9GL9MjO8WE3Y5d1hfqVFf5WkmlXceOFihFW/JOL4533CRNaPYwR0fdz2 ntQg== X-Forwarded-Encrypted: i=1; AL+hErHSm6zC5xghVjfsUWlclPQYZRr/YhuJ8sZwo8wi85PXcxdVefrPN3zTcPmqVJu3GEyMm8YrtEhudj/0Q7E=@vger.kernel.org X-Gm-Message-State: APuU4Z/J7sl2nSF7VXM7tsg3PZ5XHeWqjiOUiT1AlyZ3K2UfXtfMTJQz q+Gsrv4LUL2dUocFcHGc2Wdnu4GsnmDWZUzZkA1/f3aAbk4mBgAIDXdAC49rBR8dHB53Gym8vj1 KQUm6q3T+bFLm6a2OtBKA85l1OaaoArnKH7tR8MpWATT24nXYMkFdOxgOvWVSWUjQRGs= X-Gm-Gg: AYBFou0XftOj+TKgBdfPloyJTiXp+tQYtWKnA6jumhYyOx1SuU/n8dvUWg3mrTJH/0K uO6Pz81Y9h94kA/hVcW4YFkoaI2CnaNmIdStDv1N8VLUwvWTpyg7SoW763XOg5gTVSbGvJqmxeX 3mL6/w+jduCYQACEJMDxkaV40fjmf7caSavWBajlGGQB2hv5JMDCReO6J90lVjH/j97kHl5u4uw N+smu0Dx+Nwp6vionqoREBQSj94TZyVbaPoJzOcuMQZgy8dD8pPjJEgmJzSfqmXgBkFkRaU1KdV LQEFlFkNnJ/mWwA2HZuSIXm2thpYLx6oBlNYPSjBoyahV1+XOqVI+LSrvaATp+i2MhiYq29/Zad +2SonVN3mBrhoIZ8DjyChiPOnDpECu6/edG5kZ5Q8hqDMrXi93PIKihB9V2OyxMj4L19GcpM2PA yfQMEOq0aAx8kN2SQ= X-Received: by 2002:a05:7023:a47:10b0:1b3:b67e:9fcf with SMTP id a92af1059eb24-1b3c03108bcmr2262523c88.17.1794403694228; Wed, 11 Nov 2026 05:28:14 -0800 (PST) X-Received: by 2002:a05:7023:a47:10b0:1b3:b67e:9fcf with SMTP id a92af1059eb24-1b3c03108bcmr2262488c88.17.1794403693529; Wed, 11 Nov 2026 05:28:13 -0800 (PST) Received: from QCOM-aGQu4IUr3Y (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b3b5b2fc09sm33075620c88.10.2026.11.11.05.28.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2026 05:28:13 -0800 (PST) Date: Wed, 11 Nov 2026 21:28:06 +0800 From: Shawn Guo To: Mark Brown , Srinivas Kandagatla Cc: Liam Girdwood , Shenghao Ding , Kevin Lu , Baojun Xu , Sen Wang , Jaroslav Kysela , Takashi Iwai , Mohammad Rafi Shaik , Zhangfei Gao , Bartosz Golaszewski , linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ASoC: codec: pcm1681: Acquire sck when bound to a card Message-ID: References: <20261021031228.2074402-1-shengchao.guo@oss.qualcomm.com> <179390052368.3073895.16132231139898724200.b4-review@b4> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTExMDA1MyBTYWx0ZWRfXyP2eJkC3AAz0 j0NMvwKfr2LMUod91rytZO2kY7ywKdOIH3ozek4MTS0cwZUcTpL0vJtgtFGSItYHJzmZKxYip6n wPfhIgEPYX8GrW94b32Jk3fetiDavnzU6CJWx0h3nOQgWoUCrxm/3NQzpWgEXwxSVNPZ3pZFxcC Ra9SthCmGU0XfoVQ4ESLjzDyefePXdpo/nGr3ySvZRAf1OyKMJLGZ8AJt6CxFFh9D874eJ/bFpl VX1PVP+80HsFxe5m/OOHA72sl7BDnPbuPRjs9g85aBymYmvgHKrumPt0L0mGQmosMM9sVqd1rT1 5I/VYUHwm2U1u6RbB9uQ030lyImaBDDTfQJN/9S3eGog3USGOZXDlJENQH5Y8CG1HWY/L5DvxVg AFqiqi0x8EvAwynyao5E63ctKQyD0zTqyyh8s/xXheTH0nvuh7mFmOQcE58Vt6I5QhjaeF2oTbH tuuqEgGp08x2i5VcMyw== X-Proofpoint-GUID: OZlLEyJgnUlNExA1nRJQq0mLveMzjGYa X-Proofpoint-ORIG-GUID: OZlLEyJgnUlNExA1nRJQq0mLveMzjGYa X-Authority-Analysis: v=2.4 cv=NK1AaE6g c=1 sm=1 tr=0 ts=6af46d6f cx=c_pps a=JYo30EpNSr/tUYqK9jHPoA==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=kj9zAlcOel0A:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=mtvGxJwcMCaXl6bCzmMA:9 a=CjuIK1q_8ugA:10 a=Fk4IpSoW4aLDllm1B1p-:22 X-Proofpoint-Spam-Info: AW1haW4tMjYxMTExMDA1MyBTYWx0ZWRfX9XjJhH8LMUoH IN4oFSH5tncE3j08BIsj6seHRnz2RZlZLaxa6SGFwsuS3X4+v31kPRSQsG1WV+33db1v5wErJWa O5l0LG1cVYTjl3PerRsLvxi3UslAlXI= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-11_02,2026-11-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611110053 On Mon, Nov 09, 2026 at 04:24:37PM +0800, Shawn Guo wrote: > + Srini > > On Thu, Nov 05, 2026 at 05:42:03PM +0000, Mark Brown wrote: > > > The sck clock is taken once at i2c probe and held for the lifetime of > > > the device. On Qualcomm boards it is an LPASS clock exported by the > > > q6prm clock controller, which lives on the DSP and is unregistered and > > > registered anew whenever the ADSP is stopped and restarted. fw_devlink > > > cannot tie pcm1681 to that provider, since the provider node only gets > > > a device once the DSP is up, so it falls back to the remoteproc device, > > > which stays bound across a DSP restart. pcm1681 is therefore never > > > unbound and keeps a clk handle to the dead provider. > > > > This seems like something that ought to be dealt with on the Qualcomm > > or fw_devlink side TBH, registering the clocks and returning -EBUSY on > > attempts to use them would be less disruptive to other components in the > > system. I don't understand what fw_devlink would be doing with > > reparenting clocks... > > Thanks for the review, Mark! I agree this belongs in the Qualcomm clock > provider, not in pcm1681, so I'll drop this patch. > > Sorry, my wording about fw_devlink was misleading. No clock gets > reparented. My point was only that pcm1681 is never unbound when the DSP > restarts. The q6prm clock-controller device only exists while the DSP is > up. So fw_devlink links pcm1681 to the remoteproc device instead, which > stays bound across the restart. > > Today the clocks can't stay registered across a DSP restart. When the DSP > stops, the GPR bus unregisters the q6prm device and its clock-controller > child, and that unregisters the clocks. The clk core then switches them > to clk_nodrv_ops, which return -ENXIO. That's where the "Failed to enable > sck: -6" in my report comes from. The consumer's struct clk handle can't > be reconnected after that. > > So I'd like to change q6prm along the lines you suggested: > > - Keep the clocks registered, on a device that is not removed when > the DSP stops. > - While the DSP is down, make prepare/enable return -EBUSY. > - When the DSP comes back, re-send the requests for clocks that are still > enabled, at their last set rate. This also fixes the rate being reset > to the 19.2 MHz default. > > The part I'm unsure about is which device should own the clocks: > > a) A platform device that q6prm creates on its first probe and keeps > until the module is unloaded. This needs no DT change. > > b) The ADSP remoteproc device, which already survives restarts. > It's cleaner, but probably needs a binding change, since the clock > controller node is a child of qcom,q6prm today. > > Srini, Mark, do you prefer a), b), or something else? I'm happy to report that we can go for b) without DT binding changes. Shawn