From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE24C219A73 for ; Fri, 24 Jan 2025 08:59:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709153; cv=none; b=K+4IAUXzeEggLhqMyaKWC7+z9MGNLthyqjo5wuNudBX08aIdMZbP/datpAuUuCw86c3YpvJZydHoYSTmniOGuM0WeFP6dedFXelu6i0MecF1czWB7KcW9OfN2kvd0+LrrQu1kCJdp11sDV6VT7dPt2kr56lxwhb3fUohDbNjZx8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709153; c=relaxed/simple; bh=vHiYt7vyvuTJG+6H+4GLHJZ9r0KvgIZnQowmLqEx3JQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AbExSrrXHrakyxcNanZybfo9xK8uur6t3aPjrJ9X9/kk9pIEIEVCEuOv7/FYbAF+1SUVp5Hh3j3jP1LZZu02JyPiCR0biEThWy+PdvbDPA5VriieVPBmwdWxW0veDbpxpJM9Gi3M0uWvi/bsvCJyziCcEIqUeNB6LlXN4WX7qJY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=vMXJxbCw; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vMXJxbCw" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-21654fdd5daso31437485ad.1 for ; Fri, 24 Jan 2025 00:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709151; x=1738313951; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p945ECaq9P80WMODWEJG85jptgTxpTyGy7Go/5N1kDQ=; b=vMXJxbCwpdu0D4J7HFbHuTsGyOEuW/jHwOqAFg58kT5KLWBVRlfr36X0LgpcOq21UE eKVODHRbBC7G8mRuJOwS0dHI2qksLilfmpzjzKwOOcrOmmgt3PJpu+tGLIowVVkZix2M BERiEbIHZLawOEIHZeYHh1RKlVc6ng2qqhqkNdIAHbPmmvrv7s+caBKqWP7h1de/YQWm P7boG/Z1K/bThOT5hnrRJu3Xqmd+dxobrbgy680FE7+6kuap6QiSOUEvvYBOorO/31ON pRvdajIqg2CklrLASOFsXliT28U5Cc/BiV4ftOvTz5NvPSTjExpOWFktvo/CXDkVRFQR FcZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709151; x=1738313951; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p945ECaq9P80WMODWEJG85jptgTxpTyGy7Go/5N1kDQ=; b=kboqMUGzFClqWklyp6FshcuQcnayPjgxFeoljPQCObvnllOBOcdRazStJK1obvFR2Q QzrCY6LrLrhTXObHC7OEb2POUWnpTRWWhZBLsof2jqiN4bUvLlzJ4uXFmyeD7Y/HXCht cffQNtmXSE9dLCI0Ty7lFsdAbFeDLdNTBUveo/HVYxatTQ9c2ePt7H9ywgCsmlF85Kbh lSfvzwjm+ximtJCelk7YUwUU65fdWgynXcq4lLELQEZlhNHzEWkRMiiKTrqusANPTvOD jPyJloNUUgVF/sa1aD19oFJtCcISCRoJqjhecsjvPkBTLg7F+dQXYogarkjhCHyiC8WF enjQ== X-Forwarded-Encrypted: i=1; AJvYcCWUrkSbTkeotIdGvn6dfTPbcF7a0EjPNmg3QAFwVKw3ceA80T8RbY7S69pgOpC1CyBJZ0TnaYQ37gbI6vY=@vger.kernel.org X-Gm-Message-State: AOJu0YxkW4g+HCVT/Cnu2kDbSYEp6J3LIpgRUv2PQhgpe/Tp3EVeXdJW gv4OZMcQI4QJ/Me7VVLq8iyOjfmutz7h6KIVPtn2gn9Te+dxrqkGPMWqQBv3Qio= X-Gm-Gg: ASbGncuNSCtAoynV1M7CBMmGr3KRsyhKaQYxuOUz3MIkF4qgd91yzHMCwz2elkkkPVQ B4xrM3SwBowlRdmYisXgOgq5HdH8SrQa/Sm8E4Grj4HkGPsv3Jo2Mhw1HAYJrw8ejdJLFBdkQcq 6o5yhSdlpKaNwpdWiWcRmFw78b7s7bC8K0CTdRY74Ao/7lKopglvlcDffOG7KIByoNMnD5zNmqS daFV7bhZrikeGcwKcQIOr+GkWEQcqiIi3vyJDW8esW2+YSYB4L659ceRPV5RYhlC9Oi33DIrzG3 QVBLYlc= X-Google-Smtp-Source: AGHT+IHmp/m1FnjKUe6ha9HUOGa0p8k+59e/B1rJ5ftyPx/opbLtw59hiYoa4G65siJHRA37syBgsw== X-Received: by 2002:a17:902:d58b:b0:216:3e9a:89e with SMTP id d9443c01a7336-21c355b70ccmr503518985ad.35.1737709151226; Fri, 24 Jan 2025 00:59:11 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da3ea3adesm11668875ad.74.2025.01.24.00.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:59:10 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , linux-kernel@vger.kernel.org Subject: [PATCH 12/15] cpufreq: dt: Set .set_boost directly Date: Fri, 24 Jan 2025 14:28:16 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The boost feature can be controlled at two levels currently, driver level (applies to all policies) and per-policy. Currently the driver enables driver level boost support from the per-policy ->init() callback, which isn't really efficient as that gets called for each policy and then there is online/offline path too where this gets done unnecessarily. Instead set the .set_boost field directly and always enable the boost support. If a policy doesn't support boost feature, the core will not enable it for that policy. Keep the initial state of driver level boost to disabled and let the user enable it if required as ideally the boost frequencies must be used only when really required. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-dt.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 072ccf0c2e41..778916f89a51 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -114,20 +114,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = transition_latency; policy->dvfs_possible_from_any_cpu = true; - /* Support turbo/boost mode */ - if (policy_has_boost_freq(policy)) { - /* This gets disabled by core on driver unregister */ - ret = cpufreq_enable_boost_support(); - if (ret) - goto out_clk_put; - } - return 0; - -out_clk_put: - clk_put(cpu_clk); - - return ret; } static int cpufreq_online(struct cpufreq_policy *policy) @@ -162,6 +149,7 @@ static struct cpufreq_driver dt_cpufreq_driver = { .offline = cpufreq_offline, .register_em = cpufreq_register_em_with_opp, .name = "cpufreq-dt", + .set_boost = cpufreq_boost_set_sw, .suspend = cpufreq_generic_suspend, }; -- 2.31.1.272.g89b43f80a514