Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp359491rdf; Fri, 3 Nov 2023 03:01:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHW0qJDPQIxv2o4KvxPasBTGe/utw7yhn2tl62HZ4a7JcJBkpEGlnyNzhthYPWdnYR7+kJP X-Received: by 2002:a17:902:fac3:b0:1cc:4eb1:edaa with SMTP id ld3-20020a170902fac300b001cc4eb1edaamr12523313plb.51.1699005681003; Fri, 03 Nov 2023 03:01:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1699005680; cv=pass; d=google.com; s=arc-20160816; b=ve/1maqhmIMOIUVZpU59irNOP0D1D05b38HRdDM6zuwhlTb9iC9XjVuWkepakHFn6h CDsTfuiyHCvsuIAGjWE1TvhwqlQKwQ1d/4fCfKfkUTIhca/u9p9Yy9LR38o+QWKbGg6z VWRVOqrlhEI0kRQddSl8bcElYE2ug9NUMZxwef+8aghTwdlqcU9LW1AT4XB/u8yDwQeA 6Q3wZupTejJm+2iq5eTQcPoOcAPCrcLaSvO7XbHq5D5frb48EsPBGxJzN7D3eRea2yH4 h/mZex889oVLWNKk1UeFyvwg7XzRkwa8kcWdyV+AjHWWU0l9hHwGnqYSklZc1JxRdByT 2w6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vs8KNNa7JvbN9X54m/HLuW1fC0ZQiI5qAB+PG9WGsqg=; fh=zWJRtcjC8QppxYZLUFkgMX+M0y1kBY2soQ7HzHzqAOk=; b=lp9P6D1BaMM4FQAlGZdWYD+22oez6IBzJfIaFQII3UzjYVbfL4Jtj5pozSDxJGVulk yjX7hRqgHyekcsoyaUVp8OSmv27cK5urSKwGe50nTEil09fz6k3E/eW4uThiFBr+s7zk mfmlXb/F74kGSmTzq3glhVUWkQEKTt39fV+I8n1gWeDhjOJocnROKWBhdE5990M3Eu+L t1/ZGgw3CI70LRo71ct1x9I3ABSFoqB8K9IJ2tEqwrScEL7djgoJ46ycmiNZf2Xgw529 oPh06Ld+oYL+vh4UlebGEh2qOflNrMDmSRdLnMAgmLhgMgRWLwUDbjV7xteUNLjXfQZo d96w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="ikboYp//"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id t10-20020a170902e84a00b001b8904eadb8si1287778plg.460.2023.11.03.03.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 03:01:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="ikboYp//"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1657F804E71B; Fri, 3 Nov 2023 03:00:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347626AbjKCKAc (ORCPT + 99 others); Fri, 3 Nov 2023 06:00:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347613AbjKCKAa (ORCPT ); Fri, 3 Nov 2023 06:00:30 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2049.outbound.protection.outlook.com [40.107.92.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C59AD4E; Fri, 3 Nov 2023 03:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ukggu+FO8i9fpYCG2w07uL++t8EbYeIm0uXOiAw1DMx8dug3YMTxl0eL4VBHS62mnfFmJuEaRCAtjZzfvR8vXRx5cKwBUMGuVRZwFFHsiSwqf35O1+ECgiJI5/DSoxGvuAZOOnuH3HEzuPi/qSv4nqBPlQpHk5uCqpqLSqmdtInWnKnpfcIlRbcMNbQEKhW5RnTrWnTHa1MWGdhI2oyl5OLdGHjeBQyPHWlW8N8rQGqAdkw0cye9Yd3Z/8EDR0dySrtWzsJX4awR1nwBw+6/WV9/T47yBf5tlHMZ/60HNX5dtRlREarVHr6MqGluOM3a4VCBCUC3ijMHwlUposLEwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vs8KNNa7JvbN9X54m/HLuW1fC0ZQiI5qAB+PG9WGsqg=; b=CAGzvofARNp0jIYp7M5eOM/RIHDyg66MGX9RgoZOcJ+lffo0VSJZ6MOSX0tystNzOJs+sW8S+pusZQR7bR5hKSC6FvTFLkI+KzPm7JGCEDc/DuT5Nkt5hYWUOddvSzggHr8UNFMzLpx/tvWXFdMfpYs5G9V0BbysdesI3AQAD4pV5xOi2zT5Aa8MA8bWcFhBYyVm/jh0F/YNcizB3iAovkncE7K7FhJU0jwf5fgGnSpSXi1EKqjQ9YvqF9rysVbq7nl4EG525Dp0z2URvSY53TbDsUIUGRA38GyLHkQf+bBR02jY/3q7rCEUbH2fW2xerWKVM13sigmXFW25NEz6xQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vs8KNNa7JvbN9X54m/HLuW1fC0ZQiI5qAB+PG9WGsqg=; b=ikboYp//+joqk9Mrg1gAy+hHETJLWSsRZvO6pSFV6he7qwIVOZGPq6Hh1+VbEhURWhEuUS+FfbHcN1oBzt5IjlhWRYFbiBU190BBM/RE/5XOvWb6s6M5EYXD+LnOnaEy1WxCX1lzd8Zgden3MSSrcFUCdNFPiYd83PLEsS+qm+M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SJ2PR12MB8690.namprd12.prod.outlook.com (2603:10b6:a03:540::10) by CH2PR12MB4037.namprd12.prod.outlook.com (2603:10b6:610:7a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 10:00:21 +0000 Received: from SJ2PR12MB8690.namprd12.prod.outlook.com ([fe80::87d4:680b:51ef:181]) by SJ2PR12MB8690.namprd12.prod.outlook.com ([fe80::87d4:680b:51ef:181%7]) with mapi id 15.20.6933.029; Fri, 3 Nov 2023 10:00:20 +0000 Date: Fri, 3 Nov 2023 17:59:58 +0800 From: Huang Rui To: "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" Subject: Re: [RESEND PATCH] amd-pstate: Only print supported epp values for performance governor Message-ID: References: <20231103094815.16141-1-ayush.jain3@amd.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231103094815.16141-1-ayush.jain3@amd.com> X-ClientProxiedBy: SI1PR02CA0024.apcprd02.prod.outlook.com (2603:1096:4:1f4::12) To SJ2PR12MB8690.namprd12.prod.outlook.com (2603:10b6:a03:540::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8690:EE_|CH2PR12MB4037:EE_ X-MS-Office365-Filtering-Correlation-Id: a2b68d36-4c94-4b7f-a634-08dbdc53af56 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lGIBS5JcACnQWW4zIxGwIgfnCjp+Xbl7K4KMuHz6g4nu6Pgt1t08mUsK4GH0xI+AGZMjrlEU84Ke+WJ2/L9Cov7DPcl7Knkxrr7f/Ox8NNQXLm30QPC8/D1vLNVK1WZL/Jq6C+bcIzW/DBow8ziamVhvV6kd+05mHXTB8WGKPJ4YWR95iOkhGurXakoKN0LAvs0VxnjFNbLIevMxIRflODevXFTmOni5Efy8q2Wie3BXKSbtR7WnUxORJXTXsqm8Kziv1E1bHTPKnY/l9pd5h2wfZs4r0ZF86ry/5mxEHBfzTA877go8l4b872PXJW4H1h6huvTePRUt9f1Z0RjDOEqoruI/BKJKkMyWTgRU/qHCbVJI1bJ4ZRoJP2NSh6dB3Gpd8R77Bv+edldiSFSaWWHrNc2apgkx83/hgYUt14RU8uE5Fej+28hSWXOLNVLfYSj6ohHTJyLmvO+y629DhV9n/pb1qhLpEmxRn/z/8CmZ6KOVTfWp+u9+xBmJHJkpwRpbMiqP1i20/i6rCd10VmO/rXJQ9gvIIuuYeKnrdPQmwTKkepLQiPEdHO52LiPR X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR12MB8690.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(366004)(396003)(39860400002)(136003)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(6506007)(2616005)(6512007)(8676002)(8936002)(54906003)(6862004)(66946007)(66476007)(66556008)(37006003)(4326008)(41300700001)(86362001)(5660300002)(83380400001)(2906002)(6486002)(6636002)(316002)(478600001)(36756003)(38100700002)(26005)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vjAA2hMZ+0nUblTqxuD+mhGvb3AWbrxgMJ+88OxpEo4OuTLCtAlV80sajIsd?= =?us-ascii?Q?Ro+bHNT9D7GJU+jvp/eUjwcQHps3M9jIF9g1y6/jJhHdTUUTbNA2tyMDXgFD?= =?us-ascii?Q?S3BFPB45sMulnfEd7AYoTTe/npoKHk59Al2I/kr/JS82Xs9qhQeFNjRQyHF6?= =?us-ascii?Q?7KxSPKNkxcIrko1YwLcYQ80LVuacfpnt/JN9+gEvv6T04OXP1C5wc3esHi06?= =?us-ascii?Q?TfPGhpqzggJ9H47b+1IL2pdX0b0h8FDWqMMKZ6DL1UZn6O5WYBo+QNIbfX+m?= =?us-ascii?Q?1LtV4Sa9Y9RPj6HR0rv7QmbzCMWLUjz1FDHoaS2PCj9U0BLaCnbT5hHMy4Al?= =?us-ascii?Q?cg1q+XtpbtP3aCLdvkk2ktBGo0EzWt0BoJwYX6RmA/VHLuniNBn+9b+dV9du?= =?us-ascii?Q?Gk3K6x5lntARr71xMQhrpdHPfznFmrp3wqVlcoR9162zg/1aX/ShbN0dgX00?= =?us-ascii?Q?xbfhQahd5J8B8sZwmGV4WLDV3lhiE1ZC8EN6H7F634qEcvRmfIV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/5zvzJ+SpzCO+mPz9tA/599yHY8gYPQT?= =?us-ascii?Q?JekhNH5oW7eWN2t4YipJxvlxXA7BnveTjpChRT5ay5oWYzz3Zp4aYEXXT5+z?= =?us-ascii?Q?pTqK85yCP2yHT7ROv2k02qTrVGMHW6Mh1keHQRH88SeQtoZLJAJxNDHmub4K?= =?us-ascii?Q?hzCC9pmh+pwKColyLD1VvgVoQGMFSQbQghII679j?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2b68d36-4c94-4b7f-a634-08dbdc53af56 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8690.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 10:00:18.6464 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vYoBIBB5O7FqNS1kvtEdBI22iReq75ZR/0GUChCCiyg9HyBoULZaJ5UE75NnE3npDqa4bWNfHyg5NNiFfNt+lQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4037 X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 03 Nov 2023 03:00:35 -0700 (PDT) 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 > > --- > 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 >