Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp365159rwj; Fri, 23 Dec 2022 02:31:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXuD2wgiDjeURm0y8H+i4pcIs/5l/DbmJ/5a7WCxuXXEw1rsipZzFqEFN+dqHKHrrVvOrUBG X-Received: by 2002:a62:648b:0:b0:57a:a199:93e7 with SMTP id y133-20020a62648b000000b0057aa19993e7mr10400978pfb.28.1671791508902; Fri, 23 Dec 2022 02:31:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671791508; cv=pass; d=google.com; s=arc-20160816; b=U+m0ARnAYSaasxntq7jzrWAw/eNjBpd1H7am5V5CJ8VjDiMGfUS+sjxaEZNomMWriV GOkQ0DpFIkjpvkfHLoLMOIGU3IeshCHjNjTmmA6xTle+PhlCCp3HRjDnfmpy2hifcM3D tyjkTu8TUyOgqRIikFkejFUB5tfzWOfqBpgYj2F7NXIq4pBBiRVGi0K1Mp4Z4375U/w/ rkuVAbG3guJdpOMISQA1lMEvxwB/dvX+XeeYtNFutjwN+SNg0cYWfUh044WDnij2rChh 9XlksOzsNnqHR7gsHyGd1JO8RY+UimxNlMXbqO080Zefs3iu0llWAygkBYPvrz3VRegA My4g== 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=3RvGZfYD+G/FTQ8q/x7aHO2SJ7lH52wWIS3WHPY1Dz4=; b=PjyRZcUjgNR37PB4MJVYeA1u6r6/F8w8ChcMX+m/2sIRCJANchem5a6ll9IO+6r1Ql n7qFHvsakk47caXF6xI5X+eol7whqcw/rQfYD85bSCIV7dghGzt8AE9SC24TBqCR2POS LW2G18gX5hH0cifZZxItHLvZb6GYfUjhxWhYcgs9o9AmT2kJbTauqgdMM//vtmjq3a0b KeePVNqWqCel/cCfYl32nF7RJbCdC6K0QjrTwOtlOGpQeRNlzGGqZVdP3yt0DYe2kZLQ uXQ8PVNolbbBdmnsZBTEeMEIrbvc7kJ/qG2ZIeKhUiSlu3Xvg0nM/jf+lL6H3YLFaDgC laKg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=jK+pxbq5; 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 b200-20020a621bd1000000b005676e2c36b4si2961120pfb.47.2022.12.23.02.31.36; Fri, 23 Dec 2022 02:31:48 -0800 (PST) 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=jK+pxbq5; 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 S230303AbiLWJwM (ORCPT + 67 others); Fri, 23 Dec 2022 04:52:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236238AbiLWJvR (ORCPT ); Fri, 23 Dec 2022 04:51:17 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20623.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::623]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 004C8532F9; Fri, 23 Dec 2022 01:46:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ntEVMQhmTyuEE4aI7/95Pu7JCmTXOWhJO6PXrqHxd5QLknljh0dr7Q6qvJARe0RWWEvD6gdnFWkelr+AfdJEx4SfuLru8xS7gKR7vP8S+AESLgSJiKhTGyrfIj8goP6qycFkjrsQufTuXdj8k3XI3/D6ySN3NH4nR6ZGEOigIA1+jCMzSlJhKKNjdlXscYDI/+OcrjzseuOquTPF7oymAD9nF8DACw5XVARgXwsMJi9JdxEUCCeY+cspC4dOnJZxFphUPDDIudRqZIs6eEMhIXN55vuQVDLmJhkZPFiajFoCNbhCVcyniaS6X3og6NMEx6Fh3Iz9slMNCvgcgEx68Q== 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=3RvGZfYD+G/FTQ8q/x7aHO2SJ7lH52wWIS3WHPY1Dz4=; b=MzxxpdTVD+9XDt/ArgHjSyAw/nYdjv3Up9Im1rZLDXpmNyTR15WM600TstQUpspuhnKZ10n0l3n0ggY58hq1vqvCANk0+0Q4xfqFr9tngJJeNC0dpKXKVyHYW6yayd/Yxa6nZLx5LYB3k5It9muE+dtxVYuHz1s0mc8OaYPC9jMHo9bYXjKrxsJEiwJoly9CLiS0KvT69S+76rlh4aJ0WLirE3VZagtPknolLLW63ijtCn9PLsOYWXPU87FcNqKeJ00Job2tU7K2erDL5x3JSnEoG9zrqWi+G/jSqyzqEabimxbqlZzZYJVhdmIfPn8r6VRSbNQSkRYUXQ32q7CIYQ== 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=3RvGZfYD+G/FTQ8q/x7aHO2SJ7lH52wWIS3WHPY1Dz4=; b=jK+pxbq5yY/fuRF/cQMqob9gM83fM4sJ8Ry9Y2U0A8gR6UiZty5Vm0bB6skDT4DN8Ox2UjD3xB4rArWYsTnkhJkxerbfrpB0QVi7+JgwsrINvLYZznhtJF+CrVhHK09llkdmh2g75DU13YzQbXdjhfzCsHn4fJgliEJofRxkFuA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BY5PR12MB3876.namprd12.prod.outlook.com (2603:10b6:a03:1a7::26) by MN2PR12MB4238.namprd12.prod.outlook.com (2603:10b6:208:199::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Fri, 23 Dec 2022 09:45:47 +0000 Received: from BY5PR12MB3876.namprd12.prod.outlook.com ([fe80::45ef:724b:4b64:b98]) by BY5PR12MB3876.namprd12.prod.outlook.com ([fe80::45ef:724b:4b64:b98%3]) with mapi id 15.20.5944.013; Fri, 23 Dec 2022 09:45:36 +0000 Message-ID: Date: Fri, 23 Dec 2022 15:15:25 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v8 05/13] cpufreq: amd-pstate: optimize driver working mode selection in amd_pstate_param() Content-Language: en-US To: Perry Yuan , rafael.j.wysocki@intel.com, Mario.Limonciello@amd.com, ray.huang@amd.com, viresh.kumar@linaro.org Cc: Deepak.Sharma@amd.com, Nathan.Fontenot@amd.com, Alexander.Deucher@amd.com, Shimmer.Huang@amd.com, Xiaojian.Du@amd.com, Li.Meng@amd.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221219064042.661122-1-perry.yuan@amd.com> <20221219064042.661122-6-perry.yuan@amd.com> From: Wyes Karny In-Reply-To: <20221219064042.661122-6-perry.yuan@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MA0PR01CA0099.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:af::7) To BY5PR12MB3876.namprd12.prod.outlook.com (2603:10b6:a03:1a7::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB3876:EE_|MN2PR12MB4238:EE_ X-MS-Office365-Filtering-Correlation-Id: c3d25ea5-6f62-49ac-4b3c-08dae4ca7171 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A55iuc+8Z4H4HPaMHFMBcfBiYRo9YLCQ8q0t2F1FDOF8zsQomqIfCQgsT+dvuEtsqF5DJBem1/tOT6zh586In3lbBlluHbtoGYG4AbzpBt3n9pcz+/8cE26Fdx+4Xv/ncZI/SFaHvsKb/Z5/QMwRZ862au/O8tJQ+gGXN2m5c1jBV5oeSbUDoD5YDGpEvEjd8sMUnJDv/pX5JkBYgDazaB7/mksA5cwTQ0THwPS9Y3TtLuDY7B6WhlOgfm2VfOxao5+dbsR2UhMS68H6qVVJWKLeB1SmTjs1DnJyDvnE57RXD5ldJ2D8qNM7O+sk0WP0mi4Q2twNFcYdhN5eKOxOhiPgLjUrvIdne1If52ALnx5+92qiCHLxgqt9LC07GpZUZ9X1qDZeJxi7Nwd0yOyjIEyfxJz8KiMRyV6o8CD2qDeYjg5VOoz12ZV1fPBJJsta1CB1xUT46w+bVnijm+QpHm/uyJrQQgyUl7MprpYjGvKOk4KvZ8dwQN5peeVIV6f2/5Ef9BVzXk1fKCO3aDNEKpkIoOxLH65dhcflE3CZ79LcnDnRPlEqs5gjkxAM+HK9yOHvRZmSqLO9qAxYGDsY/fx7Rzn+kSdkY7ApHRswXGynMNxkjOlmp5hFtYmOyYttkFaJEHOrJk9A3d3G/moFREO5eOPP+RuhiaDQELCO2VyYFQUxf/4nXk0uxCsoVYIEN+blAx6d3SR8iAkMlzia7Ogroh0BYWLeBKazYaprq/4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB3876.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(366004)(39860400002)(346002)(396003)(451199015)(2906002)(44832011)(316002)(36756003)(86362001)(2616005)(83380400001)(6486002)(26005)(6666004)(31696002)(38100700002)(478600001)(186003)(6512007)(31686004)(4326008)(53546011)(8936002)(41300700001)(6506007)(66476007)(5660300002)(66556008)(8676002)(66946007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZjdvcTBVa0srYzNIUXRCU2hUc252dXBOaWRSV3FCSFJaeVpvOC9qVXpwQXZu?= =?utf-8?B?eXBvSVZidFg1cWM5Zm0rd1cvUit3L09jc3ltWXdFKzhubUdiRzlIOStmQito?= =?utf-8?B?RWFReFQwc3pRbTcrMnFLZENucjJCMWU3K0dBS3craUo5VExwUGZmcnc2U1RL?= =?utf-8?B?UFNtWTAvS0d6TFg5NnFPaWg3V1ZwVWh1KzJxZjhPTTd2amt2TDNneTFhQXRS?= =?utf-8?B?c3Z5L2t5aytEMDBxTTI1T2JYQXB2VUp6bU5lUUdaWEdOUE94eEJlTzNRSXRP?= =?utf-8?B?UlBKSXJwZ2lqc2NmS3RmOHF6aS83L2FVZXZlNkRiNEdmTVkrTFc4Y2dhemFB?= =?utf-8?B?M3RyT2FBMHpLcjE1bWczWFhnVUgyQ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Message-Id: c3d25ea5-6f62-49ac-4b3c-08dae4ca7171 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB3876.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2022 09:45:36.7873 (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: KQ5Jw8zkwOzrAE2xtok1c7dO5rPFoSa/hzxnMY+TcygF91aA6w4zxmLDb/5JzLElv8h5evX2itG2EHyUxGuvYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4238 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS autolearn=ham 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 12/19/2022 12:10 PM, Perry Yuan wrote: --------------------->8----------------------------- > > +/** > + * enum amd_pstate_mode - driver working mode of amd pstate > + */ > + > +enum amd_pstate_mode { > + /** @AMD_PSTATE_DISABLE: Driver mode is disabled */ > + AMD_PSTATE_DISABLE = 0, > + > + /** @AMD_PSTATE_PASSIVE: Drier mode is passive mode */ > + AMD_PSTATE_PASSIVE = 1, > + > + /** @AMD_PSTATE_ACTIVE: Driver mode is active mode */ > + AMD_PSTATE_ACTIVE = 2, > + > + /** @AMD_PSTATE_GUIDE: Driver mode is guided mode */ > + AMD_PSTATE_GUIDE = 3, > + > + /** @AMD_PSTATE_MAX */ > + AMD_PSTATE_MAX = 4, > +}; IMO the above enum is self explanatory we don't need to annotate. what about below? /** * enum amd_pstate_mode - driver working mode * All supported modes are explained in kernel-parameters.txt */ enum amd_pstate_mode { AMD_PSTATE_DISABLE = 0, AMD_PSTATE_PASSIVE, AMD_PSTATE_ACTIVE, AMD_PSTATE_MAX, }; Plz remove GUIDED mode here because it allows user to pass "amd_pstate=guided" in kernel cmdline. Therefore it breaks the driver flow without guided patches. I can update the enum in my guided patch. > + > +static const char * const amd_pstate_mode_string[] = { > + [AMD_PSTATE_DISABLE] = "disable", > + [AMD_PSTATE_PASSIVE] = "passive", > + [AMD_PSTATE_ACTIVE] = "active", > + [AMD_PSTATE_GUIDE] = "guide", > + NULL, > +}; > + > #endif /* _LINUX_AMD_PSTATE_H */ -- Thanks & Regards, Wyes