From patchwork Wed Jan 17 11:04:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 13521627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40BEFC47DA2 for ; Wed, 17 Jan 2024 11:05:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=koHvdbcbLA9xZQt47qUTq76reeaQDmp/223v1kA8CVI=; b=cU0njY6SkCpiT/ YOhKvXnfmQ3jYLJMclqyelIZc3qwCv6wKUkpQQinjtw1IfUz9o8odvPx2bb+UHMElK55/7zkZlzNF FU8X5BbyajpDUPP38Zj+VTCN3T42EBLCdKDdEX9djQ4wOoFPYiy/znPIWdd2huUd3Jhk+0VbzxBW5 k5GxZ/6bQzXDCUxaxGswGGo5MzMs4p0Rhh4clJwc5q0thUp3Az/TwYdbPiS8dKq4WIErIIX83+Rx/ ADDierVYBU5kEEgVSdvMdoCtq0r5FTO8qVrUfMuPP3D1F6/tq3GxeINy1npfLXvnh/4JQ+FOztTRn VzypKyna0rnbgfN5HiQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQ3jT-00FO7I-2p; Wed, 17 Jan 2024 11:05:19 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQ3jR-00FO4u-15 for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 11:05:18 +0000 Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40HAmiPl016006; Wed, 17 Jan 2024 11:05:08 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=HsxiSsCFdmIbg8BYHbMzFgtmOiVLc8AZK3LlDrMztDA=; b=HV +qRTAY2ukThgT+dPMBxpOFTj36EHTl2jJxWHs+fER9zMHBcdNrqHXEnVVEBg0GEW ay5TXBCcSGPo7pHk/OcUfP/q0sWvz5IcvSCNPcwOE7uTFZYZk/3HORnDjaCsmksm CgAUda43RMjlMbadw6PQPUiU1VzOAMXHQm8cUjXn6/9B0wATSG67nLsLD7pJgi8g Zmn2HCzr+c/GJ+1DtlGM/tsCHOC+vGdC7jpitHMpTWXTsTRlHTmFfM2IOnxUsyAY O9Dpu1Z5SS/1u7ajOW3EGaRBWWzBfTsh6FOTz9qPH5Qw1Ig8Hyok9AbQutl4eahJ SADQY1UTl513I+KzumEg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vpdfgr0wc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 11:05:08 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40HB57v4007804 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 11:05:07 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; Wed, 17 Jan 2024 03:05:02 -0800 From: Sibi Sankar To: , , , , , , , CC: , , , , , , Sibi Sankar Subject: [PATCH 1/3] OPP: Extend dev_pm_opp_data with turbo support Date: Wed, 17 Jan 2024 16:34:41 +0530 Message-ID: <20240117110443.2060704-2-quic_sibis@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240117110443.2060704-1-quic_sibis@quicinc.com> References: <20240117110443.2060704-1-quic_sibis@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: 8kTFpV05Rzz1uffd1YDmDEF69leh9Xqd X-Proofpoint-ORIG-GUID: 8kTFpV05Rzz1uffd1YDmDEF69leh9Xqd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-17_06,2024-01-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 mlxlogscore=999 phishscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401170078 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_030517_441157_37A4B6A1 X-CRM114-Status: GOOD ( 12.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Let's extend the dev_pm_opp_data with a turbo variable, to allow users to specify if it's a boost frequency for a dynamically added OPP. Signed-off-by: Sibi Sankar --- drivers/opp/core.c | 1 + include/linux/pm_opp.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index c4e0432ae42a..e233734b7220 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2065,6 +2065,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev, /* populate the opp table */ new_opp->rates[0] = data->freq; new_opp->level = data->level; + new_opp->turbo = data->turbo; tol = u_volt * opp_table->voltage_tolerance_v1 / 100; new_opp->supplies[0].u_volt = u_volt; new_opp->supplies[0].u_volt_min = u_volt - tol; diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 76dcb7f37bcd..a08a1fb1ca2a 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -93,6 +93,7 @@ struct dev_pm_opp_config { * @u_volt: The voltage in uV for the OPP. */ struct dev_pm_opp_data { + bool turbo; unsigned int level; unsigned long freq; unsigned long u_volt; From patchwork Wed Jan 17 11:04:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 13521629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8171C47DA2 for ; Wed, 17 Jan 2024 11:05:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iAPmbRE4Moq7B6BWvfTTiljTSfQIfx1JP3j1IpekQmY=; b=zS9vfaEEwE0rDa wRWiSqUgrKDJ2bWZCflU1IpZhMrZEpmGugBGqEyStYz+lJaHCt6s04jSHIK59GKHzOz8bMewlWOD/ LSUlooe+uz83HGo++7PAF3Q3GEqGWYLrhjhnt4p7H3gH5EO3FdWpN+sbaufTNU4DwUQLxh5/GkBXO q6oBy7qGsdPz9TP2vDC8OjoPSOo4gp3xPv8qaPs3ky8jhY15zw31MI8LyaskOVOtdAlAspdDS2yT7 0NomlGIc39u2o9QgtEgnkJddZTJQIMDYqkVHkIlAx/or0gQ6KEo79oWEoA1XcdddJsTFLQF5T4yYz Go6wcNrIYNe+aR4Lb3ow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQ3jY-00FO8t-07; Wed, 17 Jan 2024 11:05:24 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQ3jU-00FO7O-0j for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 11:05:21 +0000 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 40H48Wrl011339; Wed, 17 Jan 2024 11:05:14 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=kIBM+GHgT/wUh9R8cGaTg7wnwnKkMQJIMeU6iA7gLtI=; b=fF DTp5xjiWVK9uN/tjubBc6Rrp2/oj801Gk4xFd/vybuWQcnqg1H5qTdDvD+gB8EB3 K8CfhIvnunncLg04+uvAQwpvl3lK9Z0LDj3cx8g/bNsKkpS/mpjHQueptX0WRqOe eYv9CycvULBwTC+rd7XZg87X2aKTGTSHHfc2X8PukzPLF+XI+ILyxDTHpcgQpmNa 7xwGfeFvzXWoHbpYoCpBE8Fe48Ss/VW1QWVuwiWG5rddVux+hV7BF+J/JUCAiIQx HjmyUhBhfGaXtkQXpQJOJm6Qfy+hhE53/jLLQYTVeiuAnKgguqyuOM9aH4XI5M+o 4Mjb8dcywpl49q1AhVKQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vp6sqrv3m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 11:05:13 +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 40HB5DAF013494 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 11:05:13 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; Wed, 17 Jan 2024 03:05:08 -0800 From: Sibi Sankar To: , , , , , , , CC: , , , , , , Sibi Sankar Subject: [PATCH 2/3] firmware: arm_scmi: Add support for marking certain frequencies as boost Date: Wed, 17 Jan 2024 16:34:42 +0530 Message-ID: <20240117110443.2060704-3-quic_sibis@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240117110443.2060704-1-quic_sibis@quicinc.com> References: <20240117110443.2060704-1-quic_sibis@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: c-LF6AQ3b8-Dre2U12eZ1yB6MKmVYtj4 X-Proofpoint-ORIG-GUID: c-LF6AQ3b8-Dre2U12eZ1yB6MKmVYtj4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-17_06,2024-01-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 spamscore=0 clxscore=1015 impostorscore=0 mlxscore=0 bulkscore=0 mlxlogscore=984 malwarescore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401170078 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_030520_299731_14E4476F X-CRM114-Status: GOOD ( 14.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org All opps above the sustained level/frequency are treated as boost, so mark them accordingly. Suggested-by: Sudeep Holla Signed-off-by: Sibi Sankar --- drivers/firmware/arm_scmi/perf.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c index e286f04ee6e3..d3fb8c804b3d 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -811,7 +811,7 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph, struct device *dev, u32 domain) { int idx, ret; - unsigned long freq; + unsigned long freq, sustained_freq; struct dev_pm_opp_data data = {}; struct perf_dom_info *dom; @@ -819,12 +819,21 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph, if (IS_ERR(dom)) return PTR_ERR(dom); + if (!dom->level_indexing_mode) + sustained_freq = dom->sustained_perf_level * dom->mult_factor; + else + sustained_freq = dom->sustained_freq_khz * dom->mult_factor; + for (idx = 0; idx < dom->opp_count; idx++) { if (!dom->level_indexing_mode) freq = dom->opp[idx].perf * dom->mult_factor; else freq = dom->opp[idx].indicative_freq * dom->mult_factor; + /* All opps above the sustained level/frequency are treated as boost */ + if (sustained_freq && freq > sustained_freq) + data.turbo = true; + data.level = dom->opp[idx].perf; data.freq = freq; From patchwork Wed Jan 17 11:04:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 13521630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFD5AC47DA2 for ; Wed, 17 Jan 2024 11:05:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=81p+2DCHGqVX2Z8qWLnH2b2986zYQVjZeg7U4sQ5PuM=; b=PBtxs9mJ62dsXf 04MYng5sRY+1UjGH6oPBlpz9eko+i/mmaIPaf2MjxPkdhhHhLtBvHNwj2iVH49h4ckiPQrNvUHO2M +CD6xcgJkhRxpbW1seQbujszWads/fOllUFihUHX8tm//wusF85GJKyulVJrNS5NJe+CO1b7CKmuF ZIr3zAisCGy4bstC3V+oDK2npxEH4gbpK5bK+XL7NGZpI4tC6omTJ/FoDQffYLNpMEqLIHb/V+dHs jvOCbF6CkP/DZvR3/uMKdT2dN6PxHQHfj08uG7vsCeqWJdfOHVZ2wr0wJfwS9jbx7KEyDlQRA54+O Q17N+LA565iBCCWyrXJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQ3jd-00FOBF-0X; Wed, 17 Jan 2024 11:05:29 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQ3jY-00FO9A-1P for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 11:05:25 +0000 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 40H79WtU011576; Wed, 17 Jan 2024 11:05:19 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=vlGPI0dnXph4HiaDHyobQa70eLKUOk82RAMp0wm6CyM=; b=V8 j9DuwTNd5tz2LjhZ5rXVlAg+jP3jrLoERpirnDOHCMf5noPjS/ZrzZDBpfGSri9G bsoKv/Zink52zHlU88/UflDk9rHakR6GCgwXSIm66xEOCC6rl6MsMDb3v/+kk12s hcfCtFSUMOi6YFgbLfG2YDVCmy88XAK3ZMDMtSt+jOm/jetpCzAmbdBWg5eGx+pi 64OItEJOsb3xoFxhdvMhf6+Vbvb5TZtF7xTvIzU4l0oBYcaJPGVw3zD0vKJ9bCab PI/iJGtxWm3CoDss8boGyRJcKYR3aswF0pTQkZiSq8gLV1Vd4Uu1m2JVw9UKG69p ClWRyJbDXjKSXRoLbqgw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vp6sqrv3t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 11:05:18 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40HB5IfI007943 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 11:05:18 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; Wed, 17 Jan 2024 03:05:13 -0800 From: Sibi Sankar To: , , , , , , , CC: , , , , , , Sibi Sankar Subject: [PATCH 3/3] cpufreq: scmi: Enable boost support Date: Wed, 17 Jan 2024 16:34:43 +0530 Message-ID: <20240117110443.2060704-4-quic_sibis@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240117110443.2060704-1-quic_sibis@quicinc.com> References: <20240117110443.2060704-1-quic_sibis@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: QzQ50FqTbV_MvgQ0K4SWefbpg7OZtc2b X-Proofpoint-ORIG-GUID: QzQ50FqTbV_MvgQ0K4SWefbpg7OZtc2b X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-17_06,2024-01-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 spamscore=0 clxscore=1015 impostorscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401170078 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_030524_552854_1D8B2E29 X-CRM114-Status: GOOD ( 15.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The X1E80100 SoC hosts a number 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 --- 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 e0aa85764451..4355ec73502e 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -34,6 +34,7 @@ const struct scmi_handle *handle; static struct scmi_device *scmi_dev; 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) { @@ -148,6 +149,12 @@ scmi_get_cpu_power(struct device *cpu_dev, unsigned long *power, return 0; } +static struct freq_attr *scmi_cpufreq_hw_attr[] = { + &cpufreq_freq_attr_scaling_available_freqs, + NULL, + NULL, +}; + static int scmi_limit_notify_cb(struct notifier_block *nb, unsigned long event, void *data) { unsigned long freq_hz; @@ -271,6 +278,17 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) policy->fast_switch_possible = perf_ops->fast_switch_possible(ph, domain); + 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; + } + } + ret = perf_ops->perf_notify_support(ph, domain, &info); if (ret) dev_warn(cpu_dev, "failed to get supported notifications: %d\n", ret); @@ -348,7 +366,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,