From patchwork Tue Feb 27 17:34:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 207350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2853491dyb; Tue, 27 Feb 2024 09:37:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVLGdNJiTXzAXR4T3S9PFZB9M3Jb5LdINRxvCsjsB6CDRc00NZYubfYA9E3yPLwjOdYQiFvGBjaOlZKZ2cU7FHgwrEiKg== X-Google-Smtp-Source: AGHT+IE4DoSqiooVuic6A/BLJsZpqTYr03pri+WiwiNBiUOiLt8bXIwcKqvGfH+hPSpNUEC+a/93 X-Received: by 2002:a17:906:1c19:b0:a43:7d9c:3c91 with SMTP id k25-20020a1709061c1900b00a437d9c3c91mr3920068ejg.54.1709055437787; Tue, 27 Feb 2024 09:37:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709055437; cv=pass; d=google.com; s=arc-20160816; b=tDe6sUEFcbcmOf98RLHCdEbil7GNvoDJ7fysMyYpH+XP3KNCp4XAlSvYOiENrLBO2j a6n+49eoqL/cxZVmcWj3ofXMsi3s7SXThFEuaZfMo4D7q8nnDjWdCpAHbBlWVF4kr4E2 eWggRlyXxb/veRfiZSiMDJqvQdXhKwgQjUPBQFaeq53VeocsxJtTV7efhIwOiejO4w5N N6VN8bAKUfIY3pZwA6adxfH5E5+twe81FzV9enUWbIAZwLG2KWpXJYfX+d80l3TnCn6o IszWkPTXAfvW7CM9b2gnr5BJB3D6wYcdD3MRTEKH/W5dNyLgQZaW1sdfyV2BZ6i8t3bu RM6w== 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=t5MMzmXBYwNKQ5AoEvIhLimv77ikFX8sq/LandotN24=; fh=JXeAHL/pEiwIRpJuFmm5HWdAyyckOo6ArR8j/crYxoY=; b=ccTBUw8tz/+2CusIsBpaa9Ie3u7PriW+IZOJvM++XRdTTZ/cKyQ5hAcuUYYVZvaHBp v7vBmdrsUq3EMvAbWQWpWqWL1uBb0VMgrXJ0fLEZOk7d+RzupYLzfvJ96KTIu6xgPod8 uAB/zwFa9mdujPIpx6wgl9P/IKV+bMPN0qYT87GUJBdIKCohbuba3oC8/auFnTdKc7Ew RNcchXhDLf9J61QXQLIgmaOUO5XkGj/hMZlGljyOlHr3TY6jkgIGoh/v6cRjtxFhvfJJ sCHIlZizzu4kEzSK2aqYbEaNgwmwU1wyzr62Fk1rbhPpTVZz0FL32CHZoYliTkvXeMdH cxYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="a2e/OWr7"; 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-83738-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83738-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id e14-20020a170906044e00b00a42ed61a969si897336eja.957.2024.02.27.09.37.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 09:37:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83738-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="a2e/OWr7"; 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-83738-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83738-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5947E1F212FB for ; Tue, 27 Feb 2024 17:37:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CFF214A4DC; Tue, 27 Feb 2024 17:35:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="a2e/OWr7" 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 71FEE149DF2; Tue, 27 Feb 2024 17:35:17 +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=1709055318; cv=none; b=WNSSRE6XUWEbB5NB8PxjGhYPiT7z8RaSRSPsmUd+Ar8XHw4AktlpOK0p3ZOHtep9PaiX/BcHLY9vvaTOWVbjLcnKBdNbVIdpKJn4/k3OY7swMjIGWo2o8sEAbcJtMerVOBsnYLkGyr9jxOu6MFgspDPUpS2Kr4Fv9vWe/MbK7VA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709055318; c=relaxed/simple; bh=KhxBN8jWvG5UmM5Eex/uDjN8Et+tbE8+N7z+H/1VdYQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e2OnnzcoDrvDifoAwolvhAIlhBL0GzTWbw0JF8SciJZZg7eDtuZtqzOFirvoolvzmnnydK2iAXfRhU22YHU9A649nj7Us7YkmDVcn7KXycO091dj2IY9rWW91t3UrQQsV5oGfuq8dQWzrEj2iaGmPs+/zTCRR9hZbCQiNW4NUMY= 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=a2e/OWr7; 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 (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41RCd4e9024377; Tue, 27 Feb 2024 17:35: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=t5MMzmXBYwNKQ5AoEvIhLimv77ikFX8sq/LandotN24=; b=a2 e/OWr73q2h+7ahRV7H4gcb/PL5F+JGm82kajRetwBGO4bo/yY0Hlmx0Og3gauKtU 0IBmpuyIymodRnpIPBA5DMUw9lT4Cq3rrbWqFAQdSjVOG+GBLQ3+n1mfjdeFgFUi AxEiEXzjdELT+kdoVJzMoPLRZxZFVcUc3Amv36Eb1NwPYaP+9zLE82RFUccYboy5 ChlOHVn34S5Tae10wU6CwhyEpCjTwiZsr7snn/BvbbsM8SrwXv8cwNkvNsXqT0Va vlmHcqlxguNkCgR+28VGvyj0MDq8DNpsFUINtbg2o5iw/FuVtgJ7oA63vm6IGLD8 iZI3bVaUNAZHMw7uO2hg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wh85qsssb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 17:35:08 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41RHZ7Zr016603 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 17:35: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; Tue, 27 Feb 2024 09:35:02 -0800 From: Sibi Sankar To: , , , , , , , CC: , , , , , , Sibi Sankar Subject: [PATCH V2 1/3] OPP: Extend dev_pm_opp_data with turbo support Date: Tue, 27 Feb 2024 23:04:32 +0530 Message-ID: <20240227173434.650334-2-quic_sibis@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227173434.650334-1-quic_sibis@quicinc.com> References: <20240227173434.650334-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 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-ORIG-GUID: SR3vycA0r6i9rU-cGCgXh2je7e1WWqGq X-Proofpoint-GUID: SR3vycA0r6i9rU-cGCgXh2je7e1WWqGq 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-02-27_03,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 phishscore=0 malwarescore=0 clxscore=1015 mlxlogscore=999 lowpriorityscore=0 spamscore=0 suspectscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402270135 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792074514287374361 X-GMAIL-MSGID: 1792074514287374361 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 --- v2: * Document boost flag. [Lukasz] drivers/opp/core.c | 1 + include/linux/pm_opp.h | 2 ++ 2 files changed, 3 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 f1ac8bde09cb..065a47382302 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -88,12 +88,14 @@ struct dev_pm_opp_config { /** * struct dev_pm_opp_data - The data to use to initialize an OPP. + * @turbo: Flag to indicate whether the OPP is to be marked turbo or not. * @level: The performance level for the OPP. Set level to OPP_LEVEL_UNSET if * level field isn't used. * @freq: The clock rate in Hz for the OPP. * @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 Tue Feb 27 17:34:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 207370 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2875244dyb; Tue, 27 Feb 2024 10:11:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUlLWl9bsgtvbG2I3SJtu3vt761mr8NL2LoFUwiSykq6Y/8MxCmM5P502G9GaT5+x+qV+UGpjB46+87/heU+sxR4QHJUw== X-Google-Smtp-Source: AGHT+IG3PAwMKRehn0dWdLZLpamqY2MwMrrM3ah6PECMn8sVyiqgu7W27XpSwjbCXobRxZknRNRB X-Received: by 2002:a05:6a21:3986:b0:1a0:f5e6:111e with SMTP id ad6-20020a056a21398600b001a0f5e6111emr123322pzc.27.1709057517492; Tue, 27 Feb 2024 10:11:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709057517; cv=pass; d=google.com; s=arc-20160816; b=TIhzNAhPkHtAanYnuEDjnigoyf4Dbv0Knyxx2Gbb8JMPZLEh5r7PbiEce0hvk4vod0 6g/LZEO85pHV8EWMM7bB0wHEsoCdgTM0Yvlvn2eA0wvlnUnnX2PAgXP5MvBC2OFz/Ygy 2zjfXy3F4Ma/6pMAlK5xRzDM6XjaiiA5sJPO7dRKjoNc+tonYuJMmzUEoJyOmHKKNAkE TDBJx3IyHc9hUVrJ0GIWt9jRVEhWTLex6bJ6goYxyGQe9NjRXroWyexiT6tDlqI6hl1R B+VF2ThrUFqLTplhXHVLFW6wqZaQgMl56GOfcFJHPmKgPQEK0mimWWy4pomPKxnDAq3K lr2g== 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=3DVviJxlVwNwJ3tgr3xc9D3SdLGkFfeDO3OWztz/lP0=; fh=JXeAHL/pEiwIRpJuFmm5HWdAyyckOo6ArR8j/crYxoY=; b=klJ1zWEEqE4nrhZPj1zLhAVojg6vWV/I3JifSSrGV+rN5PTM+VW6USJT3US058b9OI CHcCkSkbb8yZVepDnSnEvS/M6uspkfsKS4KV/afzHI4YOuPKXTrwOH0iJ3hKzo0v2USE eI8C9xuK0EbnOhy/SLTisJq5bOtbwEFCv9CooXcllgqfvLLZTcGwEbnjTgkhEkUYJDkS KMbS9n3+wsqMUzap4rWnN2/Ph6CKF51cduRR5AHu7+4PU4sSABNkNtqblvJYCHSzrNwu CsQ5MDOhlQk1gzGvJIhngZpY48CNe7tDDv97OGBFJ5rl06UlFRWKE7cy4qVbM8DQ4G2O DZ5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="MhnvY/Iw"; 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-83739-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83739-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h22-20020a633856000000b005dc0b3095b3si5667487pgn.283.2024.02.27.10.11.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:11:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83739-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="MhnvY/Iw"; 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-83739-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83739-ouuuleilei=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 DA3CBB33D73 for ; Tue, 27 Feb 2024 17:37:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B406614AD28; Tue, 27 Feb 2024 17:35:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="MhnvY/Iw" 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 A6DD5149DF2; Tue, 27 Feb 2024 17:35:22 +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=1709055324; cv=none; b=ArYT5oi+LHbTMyFVyH2WSUsPU76Wx4woLWhd9cjUmF7/zdrWSt6HutgTDdrvIuyf6ImgPjGkktrjGY5Qdu45Ajfzq1clt4IbYLqhnLh6u5nJemWBJUfO198OZUZkScUr9Mcc1TgLUImaSq2h4drDI7dW2fktqA9Yxawo62IP1S8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709055324; c=relaxed/simple; bh=Z5k2hix+Fr7+hFF9XlR19tkcXSwIfZLoKyOcbeHHkBE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f+k6u/Bcz7u9AFtndU1FDJq7P0HYFTF0Laf85X39v93cQSXGVkobsMw3UVagFAygBCR0hLdYBYK2+MNPTgMlqwCwN634t3QlC8ChVyYMjLmTSUatTD7bnFnAtSQZpWFsKTRO9eSem0x2dF6yyfDC8fUTCG3GTKj7ixKESmLtMto= 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=MhnvY/Iw; 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 (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41R9YUO1007412; Tue, 27 Feb 2024 17:35:13 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=3DVviJxlVwNwJ3tgr3xc9D3SdLGkFfeDO3OWztz/lP0=; b=Mh nvY/Iw1tO+NOxDIQYGcO+52fRBjG8UGGCk+Dv8XTgqvDGwt0VUcXcMKvLWVu8v17 oFawAwPNgZhpLlsP7srAagog3NF+/KLqS1IzWp5kWR9GMOvQiXd5Ykv8fIh6xyD9 Nn13axSbm5R+Uw8oY3xU0LDmR9xCWbgsCyYf8yU18S55QPzyW4mBND92XsgUf4jq 7uidfan8d24LDYFVtTkTcLmg58+XzkBmIUuDNl8rTCV4JVcqql3uCSviLULswgrw nPlm44rL7btjL3/z/FwpCRn4Ng7Ih7+h20P5ehBlrbF9S9DeDBuNyyCcjt9LZ3zj or7FyS5fhK97rhHEyr2A== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wh8auhtj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 17:35:12 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41RHZC95029837 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 17:35:12 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; Tue, 27 Feb 2024 09:35:07 -0800 From: Sibi Sankar To: , , , , , , , CC: , , , , , , Sibi Sankar Subject: [PATCH V2 2/3] firmware: arm_scmi: Add support for marking certain frequencies as boost Date: Tue, 27 Feb 2024 23:04:33 +0530 Message-ID: <20240227173434.650334-3-quic_sibis@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227173434.650334-1-quic_sibis@quicinc.com> References: <20240227173434.650334-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 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-ORIG-GUID: 9dE-JkPRBvVKzooJpGHXh_vlnrL04KbW X-Proofpoint-GUID: 9dE-JkPRBvVKzooJpGHXh_vlnrL04KbW 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-02-27_03,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402270135 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792076695155330959 X-GMAIL-MSGID: 1792076695155330959 All opps above the sustained level/frequency are treated as boost, so mark them accordingly. Suggested-by: Sudeep Holla Signed-off-by: Sibi Sankar --- v2: * Remove sustained_freq check. [Pierre] * simplify sustained_freq_khz calculation. [Sudeep] drivers/firmware/arm_scmi/perf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c index 981e327e63e3..caf6191df300 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -850,7 +850,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; @@ -858,12 +858,18 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph, if (IS_ERR(dom)) return PTR_ERR(dom); + sustained_freq = dom->sustained_freq_khz * 1000UL; + 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 (freq > sustained_freq) + data.turbo = true; + data.level = dom->opp[idx].perf; data.freq = freq; From patchwork Tue Feb 27 17:34:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 207351 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2853820dyb; Tue, 27 Feb 2024 09:37:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVUyz01L5VpYGDHrG9PTs8Pk4aakWBFVlXJWyEVLrqrCcfEdG27MnwNAPfAxxIQb8iii/52pCfBaLG53D63VndoraZklA== X-Google-Smtp-Source: AGHT+IF2taX3+ZmdVPkVPEdtnwPz94cvagwmvMmJh6IjOMvqm90p+r3KK0VnBuW14VZxs3duX95q X-Received: by 2002:a17:906:f20a:b0:a3d:169a:220c with SMTP id gt10-20020a170906f20a00b00a3d169a220cmr5969839ejb.24.1709055476506; Tue, 27 Feb 2024 09:37:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709055476; cv=pass; d=google.com; s=arc-20160816; b=kHiXbs5X3XswsUvVPOGqi4hz97anLj9zAj6AL/pWcsLKh5yvyYmiSCq4qxqwMGNCWH tsj9XErJ/gTUB/H0QwFxmXVdSALm5Q3NoUNd1Nw76cso8MXVB6WsfP4OpLEgjvlmQaaO L1wzardiDuvk35TpYf/MIrrfdWimpsFlGiu68R6GCUFzDIM54dnyoR2omZcToxcwH+ap tiZsTfDpFZMWdcNr1OtYiDphblT/AE5JkG/5qqFZMLE1tWBctKia0ItH8oj3HKLyy38e EX+oVfkDXzC0bgORTZ+NJ5IUMLYRIcdj3xha+zMdIS5HnimuZOFHQE6uLU0Q1MTZKSbh ANBg== 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=1OY4o7F0FOht28QF76HQLbP3x9dSbq2zNxyAKtI6AO8=; fh=JXeAHL/pEiwIRpJuFmm5HWdAyyckOo6ArR8j/crYxoY=; b=MGl5PCgn7GElJH+gj3oRP7SUa5ejPE1TAQ2D6XbOEd9a2Bl1RowP7ksfxp1AVTn+Wv ZUdR6qAh6QKjNnFPKzKElpMIzVplr97rvqj27cZeN4evIXqB09pBgGaJX2OiTmT4/wqe ULq40w9nfGQBXjyPX12Mzv+KANB1X9sDKjFV0+uRiV2pv4prQG2g30usB/jKmAdALTvG 9QioLDy+lJ/0eYvZsyrN4Q6blpHH2kG/TAJprUf4TXk1vNd9rHevghWLlosm6E+93lyp Zllup1YNlFLaiHz2OWQ+tkcskOmwxBEkYOskAWIYmEFWXYAxq/oF2lD/9aEhKDEz3xfs 30zA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Sgn41tWr; 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-83740-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83740-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w25-20020a1709064a1900b00a3e788d3ba7si848602eju.384.2024.02.27.09.37.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 09:37:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83740-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Sgn41tWr; 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-83740-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83740-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2304C1F21D8C for ; Tue, 27 Feb 2024 17:37:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D006254FAC; Tue, 27 Feb 2024 17:35:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Sgn41tWr" 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 7BC8448CFD; Tue, 27 Feb 2024 17:35:29 +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=1709055331; cv=none; b=Um9B2+Ulg4co/3rWwbkEN3Hh7KdGUeKZemP5tMhDpv0uEhSAJBMKNitnvfoBXNxq08PazrUcFTB8SKg7hMxB6j2jd3h+YNuNIy0QWWWqdx1eJIAm6/3uWnPNmPomr27F9MtnD8J4T+2O5WP23gyjuJnfuYpktzM3v/HdQCEI3TY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709055331; c=relaxed/simple; bh=yQ2yvmNTpIXiMFF6tObmjhnIeuhFsU3oxjeYCOtNk0Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HXhjkMiNgjcfa+jRnKKc0caeLPlVfkPsIGacohEhpGGJjYvLNvpujAYbybVhCCELnmY7Vow7rDonfWYY9eoWEhfy550gyiJCiZi/0h57zO73GkdUO+Ynww6CEjy6UKAB6IUuTQozkbHBXSYdD3HI89cZSfxNRzeDAFiFXjL2B8g= 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=Sgn41tWr; arc=none smtp.client-ip=205.220.180.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 (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41R9ZMe6017235; Tue, 27 Feb 2024 17:35:18 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=1OY4o7F0FOht28QF76HQLbP3x9dSbq2zNxyAKtI6AO8=; b=Sg n41tWrMor3zJZziknelNrIYLX8d/h5CCuCg6GeFrgkpQwr77qTX987vtApfL1hsc XdCU1kDWVzuoejiGBOWJFZRgLGRvNPrNNLmj0xCDF3ITEZ/QpuiWBTrMy7HSlnV8 DfMC/E356zliwcWHdHbHKYBIZnJLgp1sk4wL6hGwAJvkmR7rPTlbmX9gCR0FJPf0 Wc54diebEttrxsRgblD3UFWrNyPkaVRSzO1fsdm4q1YWS6NpApVo3jylM2NuSOfU cZGQZK4lZohHSLTlTIy8drbU1upyhxUgOhEDEwAW4lmcjSiVYwWA51DqHHYMxtco 78anya4ZH4faQsh5/y7w== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wh64h23kh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 17:35:18 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41RHZHLD029872 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 17:35:17 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; Tue, 27 Feb 2024 09:35:12 -0800 From: Sibi Sankar To: , , , , , , , CC: , , , , , , Sibi Sankar Subject: [PATCH V2 3/3] cpufreq: scmi: Enable boost support Date: Tue, 27 Feb 2024 23:04:34 +0530 Message-ID: <20240227173434.650334-4-quic_sibis@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227173434.650334-1-quic_sibis@quicinc.com> References: <20240227173434.650334-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 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-ORIG-GUID: ZbU3IqkLuiNQcg-qyN_AWXTb_ccc-Xxl X-Proofpoint-GUID: ZbU3IqkLuiNQcg-qyN_AWXTb_ccc-Xxl 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-02-27_03,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 bulkscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402270135 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792074555190472991 X-GMAIL-MSGID: 1792074555190472991 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 --- v2: * fix default per-policy state. [Dietmar] * fix typo in commit message. drivers/cpufreq/scmi-cpufreq.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index 4ee23f4ebf4a..76a0ddbd9d24 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) { @@ -144,6 +145,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_cpufreq_init(struct cpufreq_policy *policy) { int ret, nr_opp, domain; @@ -250,6 +257,20 @@ 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; + policy->boost_enabled = true; + } + } + + priv->policy = policy; + return 0; out_free_opp: @@ -308,7 +329,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,