Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp463847lqc; Fri, 8 Mar 2024 02:46:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXA/6IY6B4rUzaP3DxJ4yHU46Gf/qxmICV0GvzyRnm5zebhAj8QeHt/vh8g8FnmDg9m1cR/+7wu7dogAcrdPj9fwm7g5/waZcPzmi6KMQ== X-Google-Smtp-Source: AGHT+IGsixuYvO9O32G3iuqUMgtukBbP/TX+6uJ6So/V1tpItlrkjzuHNUavdRK0YIZn4tIlm9Cq X-Received: by 2002:a05:6a21:1693:b0:1a1:4cd2:3e2e with SMTP id np19-20020a056a21169300b001a14cd23e2emr9904922pzb.14.1709894813983; Fri, 08 Mar 2024 02:46:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709894813; cv=pass; d=google.com; s=arc-20160816; b=eFDKZdqGllU8EDqdPKTIMe66iWhtoS/M+h8u0sFSWiW3baKpkt05renaWt6xcBoTpV n6cS1+MzPc6lmlsuCYlyht08nhPVKOwOWOLR5QuCO5bf9FSxhNVrcfedJIDSjfG03jrg 4BdVVXQFN8ii5Wu4dVoq04CR7/fzEsp6tQTr+1Uq5uHE1yQTgZkKoQpUbDYciuCMDzi9 kN4corLNDOel8V/EA73ZIPIcoOsZWlJOI9Su+kTZT7+2D8UjC+3W1qUkrgxh64QfuCIl yZgFIld0Ag4FtVloVq3JMctQuBzS1G/FWwE13HWoDGUSnZx1rX1TV3sOQhe1z6meMkuJ mSnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XbzGmI/H+M7jrcCmm5O2fs2KrZylOonYBZ9JNoiny3s=; fh=JXeAHL/pEiwIRpJuFmm5HWdAyyckOo6ArR8j/crYxoY=; b=ZXCTzUXzoa2DMkH5wDfGh8uOMoo1FSDKZ4S4TtaBjQLSTMcBZ73+P6/4VKnGOlwUsI vqr3WZlBdxLOg1bg4ScHGl6y0XRomIlUPsm3za7To3PfkLqHS0VhXxEIW06qDAObY4lJ DtBAOALMGobYsJ+/z/5+7aZ2oYrTAICfsFAGSXkDPkA2sbun666gzDs+GjvxOE5QAmkG Z5T/2oMz0we9yUVHFCe1iSKvFQYA8hMjjIYyKyjTLJK0AEjqIcOQy/8iqZMZ6p3TZaEi Q8fd9ud1TYg0xsMn+eTivxLv3/chFHPgp/5HAfi2dQd65I5NC0LLoytBkhz6Gx3Yxe+k 1txg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DGV2WEJx; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-96866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96866-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id z13-20020a630a4d000000b005dbdc9098c6si13717042pgk.445.2024.03.08.02.46.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 02:46:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DGV2WEJx; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-96866-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96866-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 41E90B22352 for ; Fri, 8 Mar 2024 10:45:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EA9156746; Fri, 8 Mar 2024 10:44:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="DGV2WEJx" 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 C76FE55C18; Fri, 8 Mar 2024 10:44:50 +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=1709894692; cv=none; b=F300FwnywXKsSqbRG6bl2d7OCQgStcoxLjfG865w7KYDbIhgKMRu7bpsgH37kS5DWyoMhMB/08Ia7NCOXsrX8cQjiI/Zos51X//y6Hx7IzIocvotBnQZ0AExMoZ7eeskHuUA+SLrdVskvU0gS6oRSLSxaS8muRRULJ6Ueh+BDt8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709894692; c=relaxed/simple; bh=PwBP36oa/1ya7DgHCgl3s8pna248l/mNWtOjYUzA5Mo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pdkUzeiTiEqu7k2hnwoN3evz0djYUqzhCZHTtuutvqrZa1ajv4igP8z/IxZj5L5P/YnbK8CK3GaF9oXAWWkfrVsnlZEMruoPEjcjdLhw5vnLDQJdKlqLMGnPlt1xWnW/9BmznrDKlt9ChfxRFqeoZyZQXZ911QEnqLjtNptXmXQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=DGV2WEJx; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 428A5jtr027172; Fri, 8 Mar 2024 10:44:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=XbzGmI/H+M7jrcCmm5O2fs2KrZylOonYBZ9JNoiny3s=; b=DG V2WEJxsPWMNs5aCf53D6RIlCFveXMD2Me/1Dg5bi6YeBZjNNpVL3zcaIpE3r6yZv 1QH1hem0bZS3RcNIoc0KLMlmy5loesI8Sd++DxDQ4TTFk67ncl5oznCUIS93dS8k AQcsDbyYXock4ECmKY/m9Qb/np/j8aCf2eNYdkjf4vZ81wBtCU5AgPwjVRK4adGT GbeEeN01mCRo9dv4+LwHzoVEo2WFLH7tqmL1TpPJ9I1Fpztffj9yNP6fsQeCmgz6 UvQUibRDiKTsZL3zi4kQSMCePW+uV7YPcYUHlyp/EWvOOyO47Ru75CW9GZTjmVG5 gqIfnotd6Jna7JFRhycw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wqyfsr79r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Mar 2024 10:44:39 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 428AicmT016118 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 8 Mar 2024 10:44:38 GMT Received: from hu-sibis-blr.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 8 Mar 2024 02:44:33 -0800 From: Sibi Sankar To: , , , , , , , CC: , , , , , , Sibi Sankar Subject: [PATCH V3 2/2] cpufreq: scmi: Enable boost support Date: Fri, 8 Mar 2024 16:14:10 +0530 Message-ID: <20240308104410.385631-3-quic_sibis@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240308104410.385631-1-quic_sibis@quicinc.com> References: <20240308104410.385631-1-quic_sibis@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: z5IqSlU8GBXzu3i9Asa1x7JbYnmalQTy X-Proofpoint-ORIG-GUID: z5IqSlU8GBXzu3i9Asa1x7JbYnmalQTy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-08_08,2024-03-06_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 suspectscore=0 bulkscore=0 adultscore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403080085 The X1E80100 SoC hosts a number of cpu boost frequencies, so let's enable boost support if the freq_table has any opps marked as turbo in it. Signed-off-by: Sibi Sankar --- v3: * Don't set per-policy boost flags from the cpufreq driver. [Viresh] drivers/cpufreq/scmi-cpufreq.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index 0b483bd0d3ca..3b4f6bfb2f4c 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -30,6 +30,7 @@ struct scmi_data { static struct scmi_protocol_handle *ph; static const struct scmi_perf_proto_ops *perf_ops; +static struct cpufreq_driver scmi_cpufreq_driver; static unsigned int scmi_cpufreq_get_rate(unsigned int cpu) { @@ -167,6 +168,12 @@ scmi_get_rate_limit(u32 domain, bool has_fast_switch) return rate_limit; } +static struct freq_attr *scmi_cpufreq_hw_attr[] = { + &cpufreq_freq_attr_scaling_available_freqs, + NULL, + NULL, +}; + static int scmi_cpufreq_init(struct cpufreq_policy *policy) { int ret, nr_opp, domain; @@ -276,6 +283,17 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) policy->transition_delay_us = scmi_get_rate_limit(domain, policy->fast_switch_possible); + if (policy_has_boost_freq(policy)) { + ret = cpufreq_enable_boost_support(); + if (ret) { + dev_warn(cpu_dev, "failed to enable boost: %d\n", ret); + goto out_free_opp; + } else { + scmi_cpufreq_hw_attr[1] = &cpufreq_freq_attr_scaling_boost_freqs; + scmi_cpufreq_driver.boost_enabled = true; + } + } + return 0; out_free_opp: @@ -334,7 +352,7 @@ static struct cpufreq_driver scmi_cpufreq_driver = { CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_IS_COOLING_DEV, .verify = cpufreq_generic_frequency_table_verify, - .attr = cpufreq_generic_attr, + .attr = scmi_cpufreq_hw_attr, .target_index = scmi_cpufreq_set_target, .fast_switch = scmi_cpufreq_fast_switch, .get = scmi_cpufreq_get_rate, -- 2.34.1