From mboxrd@z Thu Jan 1 00:00:00 1970 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 9ECBB427A1A for ; Tue, 14 Jul 2026 08:44:02 +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=1784018646; cv=none; b=raCOVzl7EEpXL+Iu9ALLtjjWO08M7A1zgkOfM5GQFSWPkVCbjVjQLl5lQbg6NTWf/sMiCmaBBSm1et5N68hE980TlxXyuMbXZ1Dsto0pzAXh9PDUOiCxCWreD9idAF+pmXZtnltoQdiOEk0yPlwO1E2wNru6HpG3tY/Pddl5RRM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784018646; c=relaxed/simple; bh=Z94W1/W7TzLbivinV9rurg1VRUmupKdUn2Ra61GL0wA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Qu1QOHk64wlyED4j4xHxpN2+hGDzbdYk83M4Nx6b6ohQfTEhfwnAraSpqB8EYeSmokUmpKbb72gmy0J3100+dre91XS6nBwUJVko0TN/93Rin7mXXbCdcjT47U62FcWM2RhPVvaG0pe0WMsxOg3D5jc2WplEVvRebBjP04mWh2I= 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=oPWz/jeU; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=UgadcJZq; 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="oPWz/jeU"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UgadcJZq" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66E6SiO73862207 for ; Tue, 14 Jul 2026 08:44:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= LW/CEzEGzNAEwypyCM6YJOofetx3Ogz57FDUQUJrgtA=; b=oPWz/jeUsdMn6FCg PjfHIMu6f4PBmZud+RGwDpd3jwhR9MoL+HFZZpbuCtauxonF3MRx6S6YsT9+cFVl P7okO5l/F4L6jzNhMfe0zbdjLT4ptqCXeiHwuZsONGw6DTyFiFpP5/dThjAWoPWB kGgw8uUp90PKbbk2s8WN6jnEHxxsjrr80OdIYss/dR5RRNf2b1JzCGO0DpIzBq5m 89Hq4taMnOnePeVBtlmTe8E9IrAJOPjl+HQ4BhLfqiC2gSsi1h6eSSolo/IkEg0i jIWLsO9Ak4x0+XISL+C5uMh8rAdxxz2IPS2mVtslPbGaSB5AemEXUQGyoCefGv56 /J7IYg== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fd44j2w4v-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 14 Jul 2026 08:44:00 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2ce8a76df2dso72758595ad.2 for ; Tue, 14 Jul 2026 01:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784018639; x=1784623439; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=LW/CEzEGzNAEwypyCM6YJOofetx3Ogz57FDUQUJrgtA=; b=UgadcJZqqu8fYR9JleJ7QYpusp1y9tsjgr5Est/qHWbEh9x5l7orJtOk3DLhyd/8hQ oVhSdDpG4kVWd62tAOmF8sKX1OwfgKsTv3MUXvGGTs39F5KXSWgaJkH2L2ox8I4SPz7q jaxXXsmKic5yfpb1DClOeMiYOigYA7CXhXRruiiQY9sfYqhL8NjB9uhHt4KEzRrzv8xw 456+pTtgjPqd2XDBZ1U6CzDRvJkr8MiZJBu9SBCsTzyahJ4QUs29s8lG+2O0epUVDUzz kG1DIlsE7fG9gcJKcMkz4cX2Pw6LJoX2vHzRJN0WoHjvO+jkO62tRrAjyMiYK2RfX3vg +59A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784018639; x=1784623439; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=LW/CEzEGzNAEwypyCM6YJOofetx3Ogz57FDUQUJrgtA=; b=O4FaD3yxaFSYk8pkV9p5hpN0PB3xdaSWh2bWcYZeusBFeGXAbLCPh0Jpn04hJymYdW p+qrxID+xNcJ3Z5Ax8oNIydwiadY2chJOJVpZmbmGoth+TuwS4Wl8/tO/+xZIenSVIJE Wc98T6ql+EngjZ5TMi0jA5k/s/WUPcOnWbQW/uFyBlmFf0UB2p/CgvKMHSic2wqW4pl5 qOHILVpM7ZddaWjEhTWIw4VQilHdmyS4xJlmJc+1vc/X/2CrPKgR9mIiJDQ6JrrlS+Ch PwpMaQb7ppNM/HCtwmwo7ve2Uv0Ymtc9hKlihZqvs0OhVT/vwcKzsatUf2NFe7y4fmCz GUPQ== X-Forwarded-Encrypted: i=1; AHgh+RoiyPBPcuQ6CWlWViy6PeBdSQMaZ/3ysQU1/RKJ4W96zW5/JFvMgKHNDJn/qrgxBDMKDC8wphYhomD+q5o=@vger.kernel.org X-Gm-Message-State: AOJu0YwOHM+cgaicsLbleMvrzotYBW9T4biLnM77iBtwOJ3RcnqIOnU0 GWg0AmA3JApbKzuwIM7rz2CqhXE/jmVxErL4kh3GOdlE2R4qFaZJhuTjBjk/cMJp3921+eBfOwj gT9F2C8WH1tqzLCuT56w10Gly21BNS/mDp+mFkp5kOSszPxOZcClpAu08x+wfLNSbu0A= X-Gm-Gg: AfdE7clYKhK8N6OqfmTmYOYF8rEJ6hlvLQHr7Qrkx09AwVfNmbgMIL4o8gqo0p6weEs HzfVYSXF/vv2snneQ66RE0KhVot+tZhVQ6rlGpgQXR3iggCOntI0JmbtDHq8OmGdwHcRQpWCIS8 7ni+Raw5oko1W9JpGonlrgKapgz1wXcLMaWktuCrh5yw5Vc7vmSondwiMHrluybE5/jcJCdypTF CtKw4h7VnyrkksE5ddhgIcUNMrBm9AjROMhqXO2BfqRFFMrXGEBfM2adwNmjGyKKT/DrTZ/quL/ HrV0OX5NO4rMTuYx9OwhSvRS3mxaLifMqc4W+aBf3s1C+9bR13K6WhHySInY6FibdKh8AmjZkKG nvbqhVcWwRiYYT7Dl0gdAErdE7agZ7vFJv5mDr4ZUU1su X-Received: by 2002:a17:903:234f:b0:2c2:bd7f:ccd4 with SMTP id d9443c01a7336-2cef12055f9mr16470995ad.21.1784018639430; Tue, 14 Jul 2026 01:43:59 -0700 (PDT) X-Received: by 2002:a17:903:234f:b0:2c2:bd7f:ccd4 with SMTP id d9443c01a7336-2cef12055f9mr16470495ad.21.1784018638978; Tue, 14 Jul 2026 01:43:58 -0700 (PDT) Received: from [10.219.49.235] ([202.46.23.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ccc9bf737bsm111470935ad.19.2026.07.14.01.43.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jul 2026 01:43:58 -0700 (PDT) Message-ID: Date: Tue, 14 Jul 2026 14:13:51 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/5] ASoC: qcom: q6prm: add support for LPASS LPR resource voting To: Srinivas Kandagatla , Bjorn Andersson , Bartosz Golaszewski , Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Mark Brown , Srinivas Kandagatla , Jaroslav Kysela , Takashi Iwai Cc: Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org References: <20260713184549.929569-1-prasad.kumpatla@oss.qualcomm.com> <20260713184549.929569-4-prasad.kumpatla@oss.qualcomm.com> <046bb977-dad6-4bd0-b1c2-4321c58d3f27@oss.qualcomm.com> Content-Language: en-US From: Prasad Kumpatla In-Reply-To: <046bb977-dad6-4bd0-b1c2-4321c58d3f27@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE0MDA5MSBTYWx0ZWRfX4evm4YegmHkJ /AUlMFthsvZ1yayAhOakJwfxYY9qpFxWrbY2GqjYoouqUwkZT17NTNn/D58qnpClLPlzW5GPQQ6 TfGno5EAi4WNeti4yGxYfI3domFAx0Y= X-Authority-Analysis: v=2.4 cv=N4UZ0W9B c=1 sm=1 tr=0 ts=6a55f6d0 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=j4ogTh8yFefVWWEFDRgCtg==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=XFR1filUoCuqy7zT_QkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-GUID: 5R9A8I9kF8TmQgwdoiMjIz5Ird0Yc1wa X-Proofpoint-ORIG-GUID: 5R9A8I9kF8TmQgwdoiMjIz5Ird0Yc1wa X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE0MDA5MSBTYWx0ZWRfXx44arwewDI/U iPxa3g+NbhamA+nEakxQl1jeV2oDAVC5BaXRWBnt9AEtI/n1VadWTg04BBzP2eU3q/QJjLiXJy/ uo2cSK8/NvxMNUTWmokm7VC0PMqeSIOnAHopjJesTvoO6k8RSHoQUMso/2E39KWnKhUyV1q15fc iRSRWqcbFjtL2etIPJP0XF5t99kFCC/bBPm4/UoFRnUa7kQ+1sCeWWzioIFoGhjQmcwFNtz7U7h tHrtvdqoRsvxJyd3Ti/hlA/uESNQpb7zGpo35BJ/J4DGyBB12jA61bX7E8/dvFT1US7wQbLZunS 3LXlbDVcoFu6URqe+DY9B4qZ895jzOB8+nA0aJnzlrj4ogZxWG/Tcdh39/I1IwjNls8QQOAR8I8 vOQhfSvafMyOGdcAJN+RilTMh7Z5FO9ggiBecMEUgAkCGqSZMj/DnGMLrhN3AKZZzfCDu75LED2 YMYcz5QPBREuzNk1Igg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-14_02,2026-07-10_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 phishscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607140091 On 7/14/2026 1:13 PM, Srinivas Kandagatla wrote: > On 7/13/26 7:45 PM, Prasad Kumpatla wrote: >> Add support for issuing LPASS low-power resource (LPR) votes through >> the PRM interface. >> >> Some platforms (e.g. Hawi) require the LPASS to be kept active via LPR >> resource voting instead of the existing hardware core vote mechanism. >> Handle this by introducing support for PARAM_ID_RSC_CPU_LPR when the >> LPR vote clock ID is requested. >> >> For LPR requests, use the appropriate parameter ID and payload format >> to disable CPU subsystem sleep, ensuring that the LPASS register space >> remains accessible. >> >> Also add the corresponding clock mapping for LPASS_HW_LPR_VOTE and make >> the q6dsp clock ID range consistent with the dt-bindings by deriving >> it from Q6AFE_MAX_CLK_ID. >> >> Signed-off-by: Prasad Kumpatla >> --- >> sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c | 2 +- >> sound/soc/qcom/qdsp6/q6prm-clocks.c | 2 ++ >> sound/soc/qcom/qdsp6/q6prm.c | 17 +++++++++++++---- >> sound/soc/qcom/qdsp6/q6prm.h | 1 + >> 4 files changed, 17 insertions(+), 5 deletions(-) >> >> diff --git a/sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c b/sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c >> index 03838582a..79527a367 100644 >> --- a/sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c >> +++ b/sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c >> @@ -12,7 +12,7 @@ >> #include >> #include "q6dsp-lpass-clocks.h" >> >> -#define Q6DSP_MAX_CLK_ID 104 >> +#define Q6DSP_MAX_CLK_ID Q6AFE_MAX_CLK_ID >> #define Q6DSP_LPASS_CLK_ROOT_DEFAULT 0 >> >> >> diff --git a/sound/soc/qcom/qdsp6/q6prm-clocks.c b/sound/soc/qcom/qdsp6/q6prm-clocks.c >> index 4c574b48a..2b2b3872e 100644 >> --- a/sound/soc/qcom/qdsp6/q6prm-clocks.c >> +++ b/sound/soc/qcom/qdsp6/q6prm-clocks.c >> @@ -63,6 +63,8 @@ static const struct q6dsp_clk_init q6prm_clks[] = { >> "LPASS_HW_MACRO"), >> Q6DSP_VOTE_CLK(LPASS_HW_DCODEC_VOTE, Q6PRM_HW_CORE_ID_DCODEC, >> "LPASS_HW_DCODEC"), >> + Q6DSP_VOTE_CLK(LPASS_HW_LPR_VOTE, Q6PRM_HW_LPR_VOTE, >> + "LPASS_HW_LPR_VOTE"), >> }; >> >> static const struct q6dsp_clk_desc q6dsp_clk_q6prm __maybe_unused = { >> diff --git a/sound/soc/qcom/qdsp6/q6prm.c b/sound/soc/qcom/qdsp6/q6prm.c >> index 04892fb44..7a7a1d3d5 100644 >> --- a/sound/soc/qcom/qdsp6/q6prm.c >> +++ b/sound/soc/qcom/qdsp6/q6prm.c >> @@ -31,10 +31,16 @@ struct q6prm { >> #define PARAM_ID_RSC_HW_CORE 0x08001032 >> #define PARAM_ID_RSC_LPASS_CORE 0x0800102B >> #define PARAM_ID_RSC_AUDIO_HW_CLK 0x0800102C >> +#define PARAM_ID_RSC_CPU_LPR 0x08001A6E >> + >> +#define LPR_CPU_SS_SLEEP_DISABLED 0x1 >> >> struct prm_cmd_request_hw_core { >> struct apm_module_param_data param_data; >> - uint32_t hw_clk_id; >> + union { >> + u32 hw_clk_id; >> + u32 lpr_state; >> + }; >> } __packed; >> >> struct prm_cmd_request_rsc { >> @@ -62,6 +68,7 @@ static int q6prm_set_hw_core_req(struct device *dev, uint32_t hw_block_id, bool >> struct prm_cmd_request_hw_core *req; >> gpr_device_t *gdev = prm->gdev; >> uint32_t opcode, rsp_opcode; >> + bool lpr_req = (hw_block_id == Q6PRM_HW_LPR_VOTE); >> >> if (enable) { >> opcode = PRM_CMD_REQUEST_HW_RSC; >> @@ -82,10 +89,13 @@ static int q6prm_set_hw_core_req(struct device *dev, uint32_t hw_block_id, bool >> >> param_data->module_instance_id = GPR_PRM_MODULE_IID; >> param_data->error_code = 0; >> - param_data->param_id = PARAM_ID_RSC_HW_CORE; >> + param_data->param_id = lpr_req ? PARAM_ID_RSC_CPU_LPR : PARAM_ID_RSC_HW_CORE; >> param_data->param_size = sizeof(*req) - APM_MODULE_PARAM_DATA_SIZE; >> >> - req->hw_clk_id = hw_block_id; >> + if (lpr_req) >> + req->lpr_state = LPR_CPU_SS_SLEEP_DISABLED; > this does not make sense, this should be set based on enable flag, here > you are disabling the LPR for both enable and disable request. Hi Srini, The intent here is slightly different from a typical enable/disable state variable. For PARAM_ID_RSC_CPU_LPR, the payload field (lpr_state) identifies the low-power resource being controlled, and the DSP API defines a single valid value: LPR_CPU_SS_SLEEP_DISABLED(0x1). The actual operation is encoded by the PRM command: PRM_CMD_REQUEST_HW_RSC + LPR_CPU_SS_SLEEP_DISABLED  -  Requests the resource and prevents the subsystem from entering the corresponding low-power state. PRM_CMD_RELEASE_HW_RSC + LPR_CPU_SS_SLEEP_DISABLED    - Releases the resource, allowing the subsystem to enter that low-power state again. In other words, the payload does not represent the desired runtime state and is therefore not toggled based on the enable flag. Instead, the request/release opcode determines whether the low-power state is being blocked or re-enabled, while lpr_state remains LPR_CPU_SS_SLEEP_DISABLED for both operations. Hope this clarifies why the payload remains unchanged across request and release paths. > > >> + else >> + req->hw_clk_id = hw_block_id; >> >> return q6prm_send_cmd_sync(prm, pkt, rsp_opcode); >> } >> @@ -94,7 +104,6 @@ int q6prm_vote_lpass_core_hw(struct device *dev, uint32_t hw_block_id, >> const char *client_name, uint32_t *client_handle) >> { >> return q6prm_set_hw_core_req(dev, hw_block_id, true); >> - > unnecessary change. Agreed, the whitespace change is unrelated and will be dropped in the next revision. Thanks, Prasad > >> } >> EXPORT_SYMBOL_GPL(q6prm_vote_lpass_core_hw); >> >> diff --git a/sound/soc/qcom/qdsp6/q6prm.h b/sound/soc/qcom/qdsp6/q6prm.h >> index a988a3208..bd5ee0c40 100644 >> --- a/sound/soc/qcom/qdsp6/q6prm.h >> +++ b/sound/soc/qcom/qdsp6/q6prm.h >> @@ -87,6 +87,7 @@ >> #define Q6PRM_LPASS_CLK_ROOT_DEFAULT 0 >> #define Q6PRM_HW_CORE_ID_LPASS 1 >> #define Q6PRM_HW_CORE_ID_DCODEC 2 >> +#define Q6PRM_HW_LPR_VOTE 3 >> >> int q6prm_set_lpass_clock(struct device *dev, int clk_id, int clk_attr, >> int clk_root, unsigned int freq);