Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6748976rwd; Mon, 19 Jun 2023 11:42:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72XnymR1FbOJhtCBiEkvbeXKm+1A6PEx5/Z6uVWAIYliyINpp4T1evTjd/5110+8GxgASq X-Received: by 2002:a17:902:ea01:b0:1b2:1ee9:682 with SMTP id s1-20020a170902ea0100b001b21ee90682mr10931343plg.23.1687200126984; Mon, 19 Jun 2023 11:42:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687200126; cv=pass; d=google.com; s=arc-20160816; b=jK8VIBiUBywPNmAftFKdkEDJiCDC4kGdxSXlDHxEOuy+EggsmSA5MBvZ5bM3OhrRf8 05YANg2Fz5vyC9HsnjNQzmnd2xRcXDC+QP6wzkdQ0NGpdsVCiu5jU3WG8OFyDc23nb9Z G8aAZoehDjMbhH9ME86C0ldWTZODCuDueqPpUvurfT9CWvJkO+8Meq9rkoJu/0BoGPUS tBhW9s6+83aVicr8ol6ktdzG+itWIHjQfovIT7jyc4vZSVOwcWv+YC8DaKBJLYndzxUX zJE48N6FGo8dXyuJ2nETRV2NDGpF3P6lfa24BfVEg0ui5KEWz6ZB2rGh6iooTOY8CSeh +Xjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=I219eKtoHTd5xajVytzf4050f7yUIVsFIMLgddzBtBU=; b=dl+wGR8ZvjBSeU98ft3KXCVkdktOgY9V4a0Mj58MyinPEvWY4UtnOm0z7qP+RHBP3N +fO++OS+KyJu4VsT54yxiHtORd+T8WIqDTp76cKS8n37gw+2tDtSITEhuTj5kURiVGJT oL88XGU5ctOPpgK8UzWZfpvW6i4j8UorDVmMTpW9LhpsN8hRr8U94RZA560W7VDfToFw 5xBkPQewnstTX/vSa8yE3BCdIkOIlHUpZGNxMhnNAaq8vhZszHzPSqOIG9yb4PRZqQ8z dZRVUo8N3bSJjpTw1SM6DUhQoWgf9P8W2xTtW5rO0xVb3tRwAWXC5yhcXq26pjiZHSp+ Ufyw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=GUmrfXGj; 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 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r15-20020a170902be0f00b001afe7fcb257si300846pls.64.2023.06.19.11.41.55; Mon, 19 Jun 2023 11:42:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=GUmrfXGj; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230509AbjFSRhN (ORCPT + 99 others); Mon, 19 Jun 2023 13:37:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232186AbjFSRhL (ORCPT ); Mon, 19 Jun 2023 13:37:11 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 011709D; Mon, 19 Jun 2023 10:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=epG3D+7DJ3yN9H8IiUhIxyuHuXi/t7jzYqPxamzPAiMZ8ECnUyMUojNghHMaAhaw5YW9HLebHQHghnltCIB7RPcboaaIZMwPqbaOgtLLgD1viIJIINBCQE3A2FBlbTM/hp/FArFUxQxb/SVzu4g267OKefQUX0txwcaOJK6gentrzGc2gQU8gbT7tk3Z0zUK51Nz+TbVWSMgBmkgsJSBfrcYiHJlupYq2lXv2lJd8y448puJw/VciyPUyvQ/Si+hRa8dGCdeFnwJeHK6qqAvg4qKOTHuet7dMg92acD9HvDaR+FnS7R0ljuyxd03Ntrdt4hE3dipswECixC4bKKcdA== 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=I219eKtoHTd5xajVytzf4050f7yUIVsFIMLgddzBtBU=; b=Gb+s7Lq2EdXuyDsnGwEAI+Ij0ClIk6NHzctZH73e3y0goryl3ufLVeyUb2FO6/p6UuLqlVAUjHatblepf1stwIHEui3+TwOtrgcSKkhtS6ZS1pUux1y1JekMvq2swI08i9Y4A4E/139DJEaxIuDo8lLg2b46V/M1wRF+sWcoFW6RNK9T+1Zw+1CP6X0fWaenknjvxRwcZkiYBLyZaPZD7+kSbM6YRMIHbdf+wvVQ7FYheX1ZmhYyTtCIjYJeqBATuYH45QSYFguiCI2fko3ssIPseK7OXPAaEgRxwxul1voaTA58SZq3VCX+PISL4Ovj8TIoM1EmR/8YrFH2Zw8qYQ== 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=I219eKtoHTd5xajVytzf4050f7yUIVsFIMLgddzBtBU=; b=GUmrfXGj8ujKoS1/zjNfIDFTZNgLofi4lWZSjYeTsQ1fJIz7CT60w3VmLdAdFQVaiXfG7QktFb3COrkG/uS0VdN2WWOJQSa5jEWSdHhSwP4psxhuGYKezCIiorjz2pNb5tb+r+MnhZviJB1fQdZYvnZreM6kVeVhraCQ3Rg3+Fg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) by BL1PR12MB5207.namprd12.prod.outlook.com (2603:10b6:208:318::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Mon, 19 Jun 2023 17:37:06 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::dfcf:f53c:c778:6f70]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::dfcf:f53c:c778:6f70%5]) with mapi id 15.20.6500.036; Mon, 19 Jun 2023 17:37:06 +0000 Message-ID: Date: Mon, 19 Jun 2023 12:37:03 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v2 1/5] cpupower: Recognise amd-pstate active mode driver Content-Language: en-US To: Wyes Karny Cc: trenn@suse.com, shuah@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, rafael@kernel.org, gautham.shenoy@amd.com, Ray.Huang@amd.com, Perry.Yuan@amd.com References: <20230616120620.147643-1-wyes.karny@amd.com> <20230616120620.147643-2-wyes.karny@amd.com> <348fbe1a-6c2d-68d2-b4fc-278407ede33c@amd.com> From: "Limonciello, Mario" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SN6PR2101CA0010.namprd21.prod.outlook.com (2603:10b6:805:106::20) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|BL1PR12MB5207:EE_ X-MS-Office365-Filtering-Correlation-Id: bc9c3310-e2cd-4fed-3a4c-08db70ebccff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O6iOe0IZ/FUqKEdOikJlz8GhZiC+tZGuB/6+qL09Jpz3fnP/BHp5xV47xTEZyMdLUWGeeGuNOHmRNZc9dW3x2anZInmnAkcS+0CkJ5J/Rpe8LM/c3rFhi+UWtD4ekGS7VdBLcuNyoymFdmOgTC+aU3eSr2kFpdH2hQgkrpvXwoJqOZMPL8Xlpx6HbQDf5JlIFz0cGJhIfgJ40evNGtzvjCSD3nP31pJOwUhXUt5rDmz9x33rSpwYn9b2mmHlURKRL9HJvp/wNV2MYcoVmUBjBHhbgLSzTBGexFN1jVwp34wrs/pgManEwoT5nrYo5k9W3zbvfxXjLhWGp2zgrLeUda/UoV+BkF+FiyRtMvxLR4hcTJG00UylhWh+5R/SWD7FO1zQVsPD9mbE7XMDmcH0wM1JRVO9cDYkdSxwctUniN0DB0XaN4HpzRvBFJev5YMzgrAjYZzx4Cudj/OnrmlbJoGSHXQHuVxFMPbGg9Uui4u1tsQ96o1EKDPOV1GbQBIa0s6ey3WwfzzucC9q9wKjW9VcQ9dGgwVdzRr8QgSdRW2NohoNCV/AS/oHgmzXTOA9aeXDp88qzQtlw6cIjvrt49jy6DTnFD2p//DXvdGZ/7KykA6nBSmhIXW80iEL7i22uSX+WrvQoHPHW2nyMqXAxA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB6101.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(39860400002)(346002)(136003)(366004)(451199021)(478600001)(6666004)(6862004)(31686004)(66946007)(66556008)(66476007)(8676002)(36756003)(4326008)(6636002)(41300700001)(2616005)(83380400001)(38100700002)(31696002)(6486002)(86362001)(2906002)(5660300002)(37006003)(8936002)(316002)(6506007)(53546011)(6512007)(26005)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TUFoZUVkcU5CSndYUUdwL0hwenAxWkxVS3ZXKzRIdUhydDhzUmp3TWQwUFFG?= =?utf-8?B?VVcyYUVZejVIRGlEcGplN1Rpb0Qzei9vZG9iZmRmTU1JT3AwU2lyUzR2WlE1?= =?utf-8?B?cmwwZElkWWlkVDNuaWdwN0p2UjhhQkJ2R3p3RVA3b0JnYkhhZDJNZWRaOW5l?= =?utf-8?B?TWJQaHNGdzArYWR5VC85Q2lHck9zZzl5VWt6NUI4ZFdCWHdsbTRXbUkvQkhX?= =?utf-8?B?RXNqVHhYdHp3YkNsdHpSQlp2MmYveDByemNXMDlWWWN6SGhyeWFzYVpkcHVM?= =?utf-8?B?TjNja1AxU2VBbkdXMVYvcElQeDdrSDJndDFWL2xvV2VOMFdyZUU0bDJ4eUxC?= =?utf-8?B?ZkZuaTFQNUhZc25vQmhjOG5kSlUxSmh0RnE4UkxXL2ZYSEJId1FnWTFLcG5V?= =?utf-8?B?TFlnS2F1TnVmN2hBQjlwQlhKV3d2bFVrNVJYT01yVHdQQXVTanByZ3E5TXFY?= =?utf-8?B?UmVCelV3akIwZEdDZ09wSlNDZk8ybzJET3ZQZnR3WWd2VFQrYkpHc09FSHpK?= =?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YKzNrbDNu?= =?utf-8?B?UjVmSUMvTU9QVktSNExRK1NZZ3JrZW5CNjlGNjN0YzZGNWx2N2FFZjMxZ3RX?= =?utf-8?B?emN5RnhMcHkwTjg3Mzc3cUhtVmMxc2gvL1hpRzRSbHBNV2FpTWlaenl4NDk5?= =?utf-8?B?V3dUZ3VPY0E3SE1EWnB4QUw3Z1pKVzhUaUpCaFkrRmt3WEd4UDN4OTVzaFhu?= =?utf-8?B?N01wNlhwNzJvdjBaTjdyVU9qSTdSbkJ2MHBiMTdOZGJmaTR6NVlHa3NjMVQz?= =?utf-8?B?a2pZVE1NbWxaVi9MejBTSjBkNHFDcHRXRDVMWjI2QjkwbW5qbzk3SWF4aEtw?= =?utf-8?B?UEE3L0hQbnJQWmtRRXBtbmE2OEhBLzJOU3BLRUpBQU02bHRuOW1kcVJJY2g4?= =?utf-8?B?RnN0UlF0R202cTFtMGYrQjVuRktYSDVxREhkWkY0TjBsMVdmSkE1WnN4aGoy?= =?utf-8?B?YlhZdTAyR1VNWVR2dEFrYWhyYnB2L21lcnhkRUh5QUYzRGRPOTVUbGxpcTF3?= =?utf-8?B?V2FSczBDaVFEa3VWa0xacy9nMTd3OHFQTnBqelV2SUVQQzBjdXo3VUNxN2to?= =?utf-8?B?Mi8wYWhmK1lDY3N2K051WHBmdFZOQVMyWWNHNDBFTXEwTHBVdUNXaHEwa2Mz?= =?utf-8?B?WEpxYVRJc3JtdWZISFI5UVpvVjVJK3RYUjlzTEdDS3p4b0xGdDJuS0NsTGN5?= =?utf-8?Q?+jeUT/n3VzcQsMZaOqwEl844i?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc9c3310-e2cd-4fed-3a4c-08db70ebccff X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2023 17:37:06.3140 (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: o58AUm4DG0fQgGWRTdTRl0nGu+MkXzVCy3jk977pD+JKTY2wQtkWKcRT/ZCWAU6/MsCZ1ooZfERnJOdEXKE/TQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5207 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,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 On 6/19/2023 12:31 PM, Wyes Karny wrote: > Hi Mario, > > On 18 Jun 20:58, Mario Limonciello wrote: >> On 6/16/23 07:06, Wyes Karny wrote: >>> amd-pstate active mode driver name is "amd-pstate-epp". Add this to the >>> string matching condition to recognise amd-pstate active mode driver. >>> >>> Reviewed-by: Gautham R. Shenoy >>> Signed-off-by: Wyes Karny >>> --- >>> tools/power/cpupower/utils/helpers/misc.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/tools/power/cpupower/utils/helpers/misc.c b/tools/power/cpupower/utils/helpers/misc.c >>> index 9547b29254a7..21f653cd472c 100644 >>> --- a/tools/power/cpupower/utils/helpers/misc.c >>> +++ b/tools/power/cpupower/utils/helpers/misc.c >>> @@ -95,7 +95,7 @@ bool cpupower_amd_pstate_enabled(void) >>> if (!driver) >>> return ret; >>> - if (!strcmp(driver, "amd-pstate")) >>> + if (!strcmp(driver, "amd-pstate") || !strcmp(driver, "amd-pstate-epp")) >> To avoid getting caught in the case that a kernel didn't have the patch >> separated from this series (for example if a distro missed it in a backport >> from separate directories), how about using strncmp() instead and just look >> for the prefix? > Sure, I'll update the patch. > I'm thinking of using strncmp(driver, "amd", 3), because in the above > case the epp driver would be "amd_pstate_epp" therefore common prefix is > only "amd". > > Thanks, > Wyes Sounds good, thanks! >> This would also let the tool be more future proofed in the case another >> amd-pstate driver was introduced later down the road as long as it stuck to >> "amd-pstate*" >> >>> ret = true; >>> cpufreq_put_driver(driver);