From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796015724; b=l3ZiMAdLvtHe+sVLM+rSzBKQWRTkhYdfdqpafYDfZ6CleEwYlq/uyjVTGN0nFR+WZMOH p4IEVC+kbw2o6P5fF7UU0Ym8h1UgiWXHiYgNthrHG3odFX0FFzt4BYF+l0W+xLZlv+kge mwM6rsdqcVIyyYZwaViy3CyYalKKm/TErahFBFlxGVpOHnix9ZkrCfPxmBkHAblYzmlE7 9FTuNK8IDzGI0BcFuMkhOWT5VUWPqRdtH99Cf7//443FJHWXBl4nvbwvHPCPdvkaJe3zL 1GGmD+DPEuBbHBgeNb2ibrwYzlQZoqU1DSOtsDzJy/myWNYrtDU+x0fW7l65P/lDjmw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796015724; 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-Spam-Info:X-Proofpoint-ORIG-GUID:X-Proofpoint-GUID: X-Authority-Analysis:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=wgNWcnsTNS7yp04NsKrVwuipzzkN8zlmoXEbsOOet0w=; b=UK+1woYkBo6/OdA2nZMTFLqZWAEdmCeWoenWwEpE6xqXBrTJA+HbR4JLxIgUTl/j74pp 8+g+sr5lrnjLNoNm+gN5jYAOmaGbbvtkLuktM5aYhF64Di9BmDdFu6ixYuGyWvXmv3sHh SPIwHvfzju766fRnq6U/z5bCdaSQbOVG4ucB7WZ6mtz/4hcqSCxF12kzZDa4/kOBRwXlq pIZIPHOIHbLhVifE2tYax7XGBumsJmx+vBHH80dMhaUJeYYGFl+PT++QGTu55YyDPxMZX rgJzQANLITyt4tAqdhZhnBDzM0H/GEUqJUBDveaZxb0SKCQT8ku3YyFJQAuvryXZYwQ== 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=IhHGOS3A; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=edgDHN12; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 96247606A325 for ; Mon, 30 Nov 2026 05:15:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 96247606A325 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=IhHGOS3A; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=edgDHN12 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AU0l2iU2796319 for ; Mon, 30 Nov 2026 05:15:22 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=wgNWcnsTNS7yp04NsKrVwuip zzkN8zlmoXEbsOOet0w=; b=IhHGOS3An9xda4ZE2sDc6u+u9m7ibTzREQiyiFp7 Br0fWVrmAzKevUMz7Sq6suyzIF2Hf0+zn8zgwa0lEEBsd5ZlwYhnBh98AeD7uACH AlPEd3+EjGatCGz0c/tI7jeE100Jr2n3fCy7GOtLP4ktD032bAu8cOHVsI9FC0On QxY8sTs9R/HGtK1epXLcjMPEkRqPrLWprKlKX1YV2zM7ETFVXVBOwQM0ImB5Vcok PVu3O6WIxVXVnSuCioeiW35UKhvllvFXteKUJoo3rBfL2qQDi2PULCN6nVtTenmr rfaN29vjAw83/O3YKfz74uLnviB41qzDYVhWZ3GczMOeNQ== Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j8skyh5xk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 30 Nov 2026 05:15:22 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-3869accaac2so6422519eec.1 for ; Sun, 29 Nov 2026 21:15:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796015721; x=1796620521; 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=wgNWcnsTNS7yp04NsKrVwuipzzkN8zlmoXEbsOOet0w=; b=edgDHN12yCPrDGNt4maPgW4VyDche2HTtN+3bc/FAOel/uwFoNBTA8AmRAkCx5UoNi p+U0CFr6oPoqSjCGiMRjmo+Fl8Shhe4pG++4FtVwfbqfCS0rodVhyIS6QR7Idh28uZjp 9iCEy/slmW9xZhjPez6Uun4rM9QMn/fCPzSHvdaVfPnNoG87RhqY/FwuH/NaDgfJEHrh b447oQryxR8FEFb4cq4opRQVrQ3QJdMp5M4lLca58XIHMEbEwRS13h0xyRsZm941pZEp 4ssIe+rv37X/y1PHfWvqb02eJItbkQ5reum2FIsMiXis20TaQ5YuhoyatEaeYzoxeiJs 23GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796015721; x=1796620521; 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=wgNWcnsTNS7yp04NsKrVwuipzzkN8zlmoXEbsOOet0w=; b=mV51juIoL0tmZA0yVrDd72WfMpvP40ej80pR6EPTm9mdsFTfqCbD4YLO6ZX4SH/ExR vYBHTTcF1a6gpiHul/q5aYhpD9UpetXo9d10u0eqQwmWV4AIChQ/lWbIlpK8s6gEoNs9 f/BQpvYjIjMRY/f0h0vT31clRNCDEL6fYHBYAoPo+HsYJC2cWEbdWpkTh9UqILnk5c3B 5cDBfJiAqY9OPP1zFfhvJevit7wlilYybESKSxBNQpaQl/5iwOYajJf+bj5OOo5BJ9do T46W7I4Sr8ZATsXKBOlcbUFp61zS3zMP1k3c7k4AtOU+Z3MFqDOh6nS5NV0MfkXrBSq/ 40BA== X-Forwarded-Encrypted: i=1; AL+hErFVAAy0up/OX0oVTe7NXtKEv5i+B+qlCaIMKjA71l+WRspeZdKBvxRcLJS3h0NR8EfCNXO6IABI1k9GS8g=@vger.kernel.org X-Gm-Message-State: APuU4Z98XfuJ1kO81yGe41TlobWnNiydfjBZq7eayItfX64KlFCEKhMh ScZT75cQRTMYtsyLhaA3mZT3gXQtKXDGbataOr9141nLOPVQBfFU4Evs7Vnjbj5iNnV9a6uJPtt e+weSCZk4uYxzuQnFPB0wl3xHdKIkoPKFannimKNRKW5icKFDCKk9nZw2RkCkn4YrG6Q= X-Gm-Gg: AZFdTZc+IDA8Lfr9GwUwtOgA5+1uIn/3rYUgu/apRatniFkf2WCKmX76JIRHU38+Vvx SM1HuFcTQGazdSJQuD+jjIDsRR5ISmq9Vv1HgnCWiyGibSFzgViDEnlOMFOsCqqvZGj108sXF17 /LkYaGxKHc4JMPJcZttt8t050ijDCbHU8sfOOxKeBN7+LPIOF4qpn251LbfnD8ZmBiiS3+ZZI81 DHwwE3omZ8Igk8lc9l4iGDXC18Lie5rsdDDvKTvRJ1AXhxAPlD6kZDzQdQtQukldfEt5E8bH7p8 t6eif4y6rSgsoFU9Kwzc4w4i7SqGJLdbdeCBJSUUeHAjLqL8bwglIPTao7E+nwXICX47jAfbBH9 E3J6fQUy9nLBkLQK3ALnMUUlgawJrbsKE5DBz9w9eCKfCMGi9aqa3V9Oq7CMn369AhWIsouMLcv U2PxiATJbjKBdNtJY= X-Received: by 2002:a05:7301:6782:b0:385:2ea8:aac7 with SMTP id 5a478bee46e88-3852ea8d7d4mr44139356eec.23.1796015721235; Sun, 29 Nov 2026 21:15:21 -0800 (PST) X-Received: by 2002:a05:7301:6782:b0:385:2ea8:aac7 with SMTP id 5a478bee46e88-3852ea8d7d4mr44139338eec.23.1796015720738; Sun, 29 Nov 2026 21:15:20 -0800 (PST) Received: from QCOM-aGQu4IUr3Y (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386c7c62a91sm55740606eec.17.2026.11.29.21.15.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 21:15:20 -0800 (PST) Date: Mon, 30 Nov 2026 13:15:14 +0800 From: Shawn Guo To: Srinivas Kandagatla Cc: Srinivas Kandagatla , Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Mohit Sharma , Ajay Kumar Nandam , Prasad Kumpatla , linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] ASoC: qcom: q6dsp-lpass-clocks: Restore clocks after a DSP restart Message-ID: References: <20261115032027.414953-1-shengchao.guo@oss.qualcomm.com> <20261115032027.414953-3-shengchao.guo@oss.qualcomm.com> 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: AW1haW4tMjYxMTMwMDAyMCBTYWx0ZWRfX9jZVcwYdEzfy OkQLrVXiM5Z/3EII0xt3jey2OHAA+u5xmKdDnKtNlvMMEvRVn0AsuXlkofKQqbTjIz+XbrUZRD/ z9jRCNss08w3k/rNv1lbD9uBmvb53O9pslAJ0LrcrDDnEuQdpQoYDH2YUYeoQk1zkXSdUMplFuK LEQO3FoQKFM6H5p3LMvXUzncC0pnmcmtV5qvAuE2BVTmJKJGtTwptyOapR2H13uNC+u70VK8tOp 8bstOVRJj/ORc6S3mAG5XxU2vNYsQRKKSuiKLMEv6YEuSNMWVpf06wVs4fOoWyk1miTQlQbYnSI tpN51kgShx1QoYKw7C8CaePd3aQK0zeQU1U24si/xxOO1vC/2ZHFz57HoTAYQU/+866LLoO6NmG TBizLWJnxbUqJ0Y1AFJXTpQQcxTCSNtfnAl945JaDZ3LxMMLHZyCbcUqlhDZ5dUta8yjQEwipBZ YVZnCB/tmfbuPFP8Ylw== X-Proofpoint-Spam-Info: AW1haW4tMjYxMTMwMDAyMCBTYWx0ZWRfX2em6AuzqDdh2 0Lla8aocefCAIDC9q8+FavSkUdxCZHi0kTMoTRcbF1ABLvU3/0Qhq2aawqptjeOWGSUok4uygOh fXMYg+V5ic72yeJcSjSYclAqi5mHE38= X-Proofpoint-ORIG-GUID: JVi68V8Y7rPsZMQJTgvj31AcEOfNQ9X- X-Proofpoint-GUID: JVi68V8Y7rPsZMQJTgvj31AcEOfNQ9X- X-Authority-Analysis: v=2.4 cv=Ie4Symqa c=1 sm=1 tr=0 ts=6b0d066a cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=kj9zAlcOel0A:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=wZiRYsU8z3Rz7fHH0Z0A:9 a=CjuIK1q_8ugA:10 a=PxkB5W3o20Ba91AHUih5:22 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-30_01,2026-11-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 adultscore=0 suspectscore=0 clxscore=1015 impostorscore=0 phishscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611300020 On Sun, Nov 15, 2026 at 09:56:16AM +0000, Srinivas Kandagatla wrote: > On 11/15/26 3:20 AM, Shawn Guo wrote: > > The DSP forgets all clock requests and votes when it stops. A consumer > > that still holds a clock prepared across a DSP restart then holds a > > clock that the DSP no longer provides, and its later unprepare releases > > a request the DSP never saw. > > > > Track which clocks are prepared, and add q6dsp_clock_dsp_down() and > > q6dsp_clock_dsp_up() for the DSP service driver to call when the DSP > > goes away and comes back. dsp_down() marks the prepared clocks as lost. > > dsp_up() requests them again at their current rate, or votes for them > > again. Unpreparing a lost clock skips the release, since the DSP holds > > nothing for it. > > > > Fold the prepare/unprepare ops of rate and vote clocks into one pair, > > so both kinds share the request/release helpers used by the restore > > path. A mutex serializes prepare/unprepare against dsp_down/up. > > > > This patch does not change behaviour on its own: no driver calls the > > new functions yet. > > Looks like you are hitting the devlink issue that decides to create > provider link between remoteproc to clk consumer instead of prm clk > controller to clk consumer. Right, I see the same on here: pcm1681 has an active device link to 4c00000.remoteproc and none to the q6prm clock controller. The controller's node has no device when the remoteproc binds, so fw_devlink_pickup_dangling_consumers() moves its consumers up to the remoteproc. But fixing the supplier alone doesn't help. I hacked in the link fw_devlink should have made (clock controller -> pcm1681, fw_devlink flags). On ADSP stop the driver core unbinds pcm1681 as expected, but nothing probes it again after the ADSP comes back: fw_devlink has already consumed the fwnode link, so no new link is made to the new controller device, and nothing re-probes a consumer whose supplier was deleted and added again. The card never comes back, which is worse than today. Only with the link re-added and pcm1681 attached by hand does the card return. So a devlink fix would need to re-create links and re-probe consumers on every DSP restart, and would still tear down every codec that uses a DSP clock. Keeping the controller across the restart and restoring the clocks the DSP forgot is the smaller change, so v2 keeps that approach. I'll add the devlink analysis to the commit message of patch 3. Shawn