From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 7483621A44B for ; Fri, 24 Jan 2025 08:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709146; cv=none; b=sUGsV8hlmJTQjScSUwR0Y5shNP4HtGOSEcWWyISJmJWdyBVzNe8Wu9ojn+Mfyw+AuDLcRa0Qr7DMOFWT/MfpcHWlLyUDGoPjElmQsFIJHWi7c5H021Wiut4WzL8EVaPEVA+B1zsSJAdPf/UwDVDRXWGGh0xa/KK9Ulhsjc6mDjw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709146; c=relaxed/simple; bh=3/ztBZ/HEPa/0k8R9f3RWIpWad4EPbBsiTzjR0GmEsc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nAGH/SFu9fVApdqN25KAkz67XEF6NswK4/JRd1Vmtnc77pjNYTcAMWAwaOGAzh7Bc/+MjHpZlJzwIHjBwhFfKHJLgwq+1W5WtghZ1Fwh0NKUwUBu/S4NZ2ilh9cm7roKMBV9mP+iKsuEKTjlrC36qFwJL+jiTziECWnwII53LmQ= 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=dCqrEGVm; arc=none smtp.client-ip=209.85.216.42 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="dCqrEGVm" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2f441791e40so2659591a91.3 for ; Fri, 24 Jan 2025 00:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709145; x=1738313945; 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=XHvPLEImTEWfALntTBCPd9TKW0+oiHv2uyr8XB4xyIc=; b=dCqrEGVmN+SlrNYH2QodDIHZOAalwer66LQDEbpuOG9nE+XQwJ7LyJX6yaeOD8R3fg tO2LgPMFfSXNLcVB1GKO+P3NusZmqfwE21yiEwhuBWQqoeWXVYWvLMe7hv/TinyBiDZR IajaY1abD/+q2n4g0WBYPWWXKVB0kx/GpIfgf+/1hrEt5NFlTqcB+N9orZlip9ZW4gRO m8kKSDhYDycm41hhQkw4ylpHRpp6lCu7bM/9p4zemo9oF6hKUY5QER9ZcHA50zM3YVFp c+kMm1A/GG/YfUnNhS3JGbUalUVVeMGFxQR/oRjggYQG4GHV38AoprHBdGf1wym7uVAb V9hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709145; x=1738313945; 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=XHvPLEImTEWfALntTBCPd9TKW0+oiHv2uyr8XB4xyIc=; b=lOYSTTzlvafCIFhzmicrOeXjtmyaLXf37HKE3eVL7Sy/nz8EPCIrfet4d3QFJuOxa+ PDsIft5lJ/2J3swqOIEU4DHChV7xPrg2VoJ6QurqJofvpESvts0OytbpW21b41WsUNm9 +Lt/ZqmPfEI72v2tqQv7xtxS5FAGXdQcJQ4eqGx9UQCgPjii8TgTocRWk4fWxCBOtPyU 92DwFeoDLyGl6LtVxuBsZmEUMxbSA2NslYFr3Uh19bjG51taag/cZtL/FRzAoIUBr5Lf +tVQpzBa7xBwBSIk6r3LivPF27yq7j/3KkTA3QVXW9KQH4waJbudHzy5N+/wjDcn7A4J ZZyA== X-Forwarded-Encrypted: i=1; AJvYcCW7PaF3/G7dsS/bVcLxadKT+cTa9yUUzOmy+5/irYD4vaLl40ZBF5CEtyoz+cHfIYHQsDG8XIObh3Yjsdk=@vger.kernel.org X-Gm-Message-State: AOJu0Yy84tyJUClsvJAMRBC5QuQQa/OGQisMlVQiq/o0RP+bKMglprME 6vXCtaC5Eb+rDN1mHC1RsTbbXZbNBvHlumzalHNRj1/6lxbaqHKq0U+ZUvudTY4= X-Gm-Gg: ASbGncsOOPo/8XkGlzzC5zAdrGl9wquXf2/ZavHpmSCH8ZXxFtuwOhtYD1fYZvrT5DO zhclYboDrSiJymXEVwZCHLO+7UmBt7nkWnD9Nd6kWX9uC5zyYeQ4Kb+eOwW7bOThPRO25D64jjy j984WOLSeQatPHRgQxiwXsOaxQMaf5d1OO7W7jkK6pXaE/f2Mk7+WzvbF25/NkceDuxDiOWblM/ jETlPNXfx20b8glrb5/6tSR8e/Fka37h9Q9fieto/4SE6WyNDkYwIVFkaB66xQZFfFmQbXP/q5D 1L54L3o= X-Google-Smtp-Source: AGHT+IFlPf6Y5ApV2vEgtwBRH/T2hTrMCJRbAhXXb7JfHHFFf33S6aG5dH1A+wfV/EhE0fz4W4IA+g== X-Received: by 2002:a17:90b:1f92:b0:2ee:db8a:29d0 with SMTP id 98e67ed59e1d1-2f782d4f3edmr36840886a91.26.1737709144725; Fri, 24 Jan 2025 00:59:04 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f7ffa6a725sm1258715a91.21.2025.01.24.00.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:59:04 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/15] cpufreq: powernv: Set .set_boost directly Date: Fri, 24 Jan 2025 14:28:14 +0530 Message-Id: <9b4af20d5b415f41e866ddd8bde9cf6441c463b8.1737707712.git.viresh.kumar@linaro.org> 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/powernv-cpufreq.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 0c3e907c58bc..4d3e891ff508 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -1125,7 +1125,7 @@ static int __init powernv_cpufreq_init(void) goto out; if (powernv_pstate_info.wof_enabled) - powernv_cpufreq_driver.boost_enabled = true; + powernv_cpufreq_driver.set_boost = cpufreq_boost_set_sw; else powernv_cpu_freq_attr[SCALING_BOOST_FREQS_ATTR_INDEX] = NULL; @@ -1135,9 +1135,6 @@ static int __init powernv_cpufreq_init(void) goto cleanup; } - if (powernv_pstate_info.wof_enabled) - cpufreq_enable_boost_support(); - register_reboot_notifier(&powernv_cpufreq_reboot_nb); opal_message_notifier_register(OPAL_MSG_OCC, &powernv_cpufreq_opal_nb); -- 2.31.1.272.g89b43f80a514