Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4868388rdh; Wed, 29 Nov 2023 13:06:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGoqi0oimqyxEOO7GMuwH6W7hXIya16N3ZhM3kGHav/fUy5akPpz4+W9lT0QXKQ9yDjBowj X-Received: by 2002:a05:6a00:3904:b0:6cb:bca2:cbd0 with SMTP id fh4-20020a056a00390400b006cbbca2cbd0mr23102914pfb.29.1701292015402; Wed, 29 Nov 2023 13:06:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701292015; cv=none; d=google.com; s=arc-20160816; b=WrV5bhPfd4pRlmiI/KtiMdg7IXULp0DCqQ1pbjyb1C668PQgyvfPRksR00f0kLBxbL FRyoomV6wy7BO9qHn2FQaH5+PiXwjooDmC/dWrvBSs5Hpw04fpj8qM2l1Ce7YQny6cBv G8uwJ3TgBdqK/dZEx/1hNTaFgiMSqwGjGE4cfD+juAPttW0h4AmG/QCQVnepoGpwVhvI djWH2JSiYEgKJy4X6M/pRMvSTGGP7O0jl9DocI1FQQeEdSOtP0JBvwxWh+vdLJhR+7e/ LvvDJWejLyLeO/DgcSzPHMWObXVyav3CfBWW8zOgncCHWnE12sSyGd0EtBFQ/+k6CNJN FQHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=DePgUCym9UDCOigfLoGa4phCdAgBOwMvqiK7PwC5JOk=; fh=a/EV6kjZFoNWz+hG7gr1RBPPLUXOxOvcq5BbhPtnqt4=; b=hHpTCds3bmpQI+6doFzhstIuBZUfFIDHNL8CsgEzYtxyW42ZneHR6xRekMYNI3iWW1 ogFJAe4USxYZ3RT6J0FMjqgtdFrzVjDJ3yIFrhqN0dxtAdX3NTOBqtGRdjypATtnDWL8 E3UTS+huHePCGelcoTbTy4sZtOx5botu6ZOmebacSFci8wqiJippNe9AVtsrL/fUgvrw T5GrlKR91K0WX2RCFBT2h9n1xdlKMm9fc5PkbsjnmX4QFDaRU8FRxPItliBEGU25sPBZ eZ1US+iGPrtdPeTVaLKN0HCjvJPkdnTFPVWeO+ZGIgvCr7g/ynOpC7POTQdzKncl+ud0 4k1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id s24-20020a63e818000000b00563da455862si14731167pgh.311.2023.11.29.13.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 13:06:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D50CE804C665; Wed, 29 Nov 2023 13:06:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234168AbjK2VGj convert rfc822-to-8bit (ORCPT + 99 others); Wed, 29 Nov 2023 16:06:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229668AbjK2VGh (ORCPT ); Wed, 29 Nov 2023 16:06:37 -0500 Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6EE4D67; Wed, 29 Nov 2023 13:06:43 -0800 (PST) Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6d8572850d3so33630a34.0; Wed, 29 Nov 2023 13:06:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701292003; x=1701896803; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CHRmRPtF9D4nRminD67tB3n7RvHkt7lPmAjYFdqVXkI=; b=nFSa5jFKpN/+nD3bKwHE2ACeVyJOEPeYX1+tPM6riYxo67fYiz1k/KYGx96QZEkU/y OXx19Mjjp5ox1S7B3nUkSh42+81VCyCgUogaP2dk6eCa6oDR8bwbQctqoI1JqjCypUbs Vc4XsYYjXGtm0x6gBg73ndrtge4M8Fg+YT06wiTv+KhNAHPS5Llup+R221o+Gjluw2ha uxRzXldP2BU0sO2Fse33lWFkYGXKoQaEUM615908izE5lFoj3HuZQ2xDFBy+3kG5IniD 1fgAEbcr2JmZlSvoRlUQl438T++JtW1glcvVDWnBOpPcR9d6P78l91ksVIqALpeyu4pO TXgg== X-Gm-Message-State: AOJu0YwLJQJJJ0kRA1jGRtuTtZM9nWaCgyUWPM69lRN2aHISDR8molM3 RrvNi2gQiChK8Ay5b+A4W8ukJV1NndnXVOZla0vdSWx5 X-Received: by 2002:a4a:d4c4:0:b0:58d:e3d3:ec72 with SMTP id r4-20020a4ad4c4000000b0058de3d3ec72mr563003oos.0.1701292002971; Wed, 29 Nov 2023 13:06:42 -0800 (PST) MIME-Version: 1.0 References: <20231103094815.16141-1-ayush.jain3@amd.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 29 Nov 2023 22:06:31 +0100 Message-ID: Subject: Re: [RESEND PATCH] amd-pstate: Only print supported epp values for performance governor To: Huang Rui , "Jain, Ayush" Cc: "rafael@kernel.org" , "viresh.kumar@linaro.org" , "Yuan, Perry" , "Karny, Wyes" , "Limonciello, Mario" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 29 Nov 2023 13:06:53 -0800 (PST) On Fri, Nov 3, 2023 at 11:00 AM Huang Rui wrote: > > On Fri, Nov 03, 2023 at 05:48:15PM +0800, Jain, Ayush wrote: > > show_energy_performance_available_preferences() to show only supported > > values which is performance in performance governor policy. > > > > -------Before-------- > > $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_driver > > amd-pstate-epp > > $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor > > performance > > $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference > > performance > > $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences > > default performance balance_performance balance_power power > > > > -------After-------- > > $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_driver > > amd-pstate-epp > > $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor > > performance > > $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference > > performance > > $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences > > performance > > > > Fixes: ffa5096a7c33 ("cpufreq: amd-pstate: implement Pstate EPP support for the AMD processors") > > > > Suggested-by: Wyes Karny > > Signed-off-by: Ayush Jain > > Reviewed-by: Wyes Karny > > Nice catch, thanks for the fix. > > Acked-by: Huang Rui Applied as 6.7-rc material, thanks! > > > > --- > > drivers/cpufreq/amd-pstate.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c > > index 9a1e194d5cf8..e6c5a57662e4 100644 > > --- a/drivers/cpufreq/amd-pstate.c > > +++ b/drivers/cpufreq/amd-pstate.c > > @@ -850,11 +850,16 @@ static ssize_t show_energy_performance_available_preferences( > > { > > int i = 0; > > int offset = 0; > > + struct amd_cpudata *cpudata = policy->driver_data; > > + > > + if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) > > + return sysfs_emit_at(buf, offset, "%s\n", > > + energy_perf_strings[EPP_INDEX_PERFORMANCE]); > > > > while (energy_perf_strings[i] != NULL) > > offset += sysfs_emit_at(buf, offset, "%s ", energy_perf_strings[i++]); > > > > - sysfs_emit_at(buf, offset, "\n"); > > + offset += sysfs_emit_at(buf, offset, "\n"); > > > > return offset; > > } > > -- > > 2.34.1 > >