Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp3266207rwj; Mon, 19 Dec 2022 15:48:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf6kzrgb5gEyEjYSiNlA56DsYNB+L2tBLzOcR4kIZifggE77Re2SwlN6u/Aoqxv6EkMG7wpu X-Received: by 2002:a17:906:1d47:b0:7ad:9f03:b330 with SMTP id o7-20020a1709061d4700b007ad9f03b330mr26024196ejh.62.1671493699224; Mon, 19 Dec 2022 15:48:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671493699; cv=pass; d=google.com; s=arc-20160816; b=q9FgiWq2PBiV30BbzwBZjH3NYnoRmmFGJj1eOXj7nPEYPkMRALuKZzSriXnAgZYKRs //tiXg2DXf1r3oTHOIcQmRlm1NLHAXIb09KTN+IJgzuQb4FzMEBUFEmrzvgmzTt1fOM6 1Vpwtl2lpROX3aJwoyvH4TWcr9UkGgqd/PtoeLjLU1ATOfCn5QxhYMNbj7sOAfHgNF5C Jmm546CwZEOa3+7dbgEpiyoXR4FzmbYH4QyZjlHzSjf86IfrAuAsIOLluhLSsMRZ4i0F Gxfef8TbkxxmiTP3ViqrFHwppWIpH6VN6oK1OcBhhlhku8TJMvNVo48IttSYwITG1Wmm rS+w== 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=2eI+DHn8Pv6w+6n5X9IHyI/ROENTq+x0z/36d6kypuQ=; b=vHSiSpqOelwfo5c1FFMH78gYxCXh1QKLomeSoKPA/+Kt1SUBJ9BqDaWiLOzbzRWIRJ 9fCrpgLS6Z4Wpe42KFD/08VFSbjfPHHU/HgnQYUEGi1pUZb4IqaYIuZBcR8UfZ8QMXyI E4FxKwO6aDInnXkhnPx5dJcgnfPDngKOnRTHjZZPqFeMUgv1Cg3gL1TndSsFeB5KV+7i 0HlVnwQ2FYU6dSlp+tGXcXVYHRgArHzqCk5Eg9DAqfOYEtpHdRc4MSaRMEJJcuP5T9OS aYY/pF5php1WHHNfe3aunFuniPG7kUhL51wv55m7pYE3irokaciHYKV/rUNUtOXbxiMj jVSg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=GLJB3TM1; 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 md6-20020a170906ae8600b007c0e0d7abe5si9010014ejb.782.2022.12.19.15.48.02; Mon, 19 Dec 2022 15:48:19 -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=GLJB3TM1; 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 S233169AbiLSXHw (ORCPT + 70 others); Mon, 19 Dec 2022 18:07:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233258AbiLSXHF (ORCPT ); Mon, 19 Dec 2022 18:07:05 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2071.outbound.protection.outlook.com [40.107.223.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEFB717585; Mon, 19 Dec 2022 15:02:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MPoai7BXbL2B8duPHnx4e5g6Mah2lB4OHE4SRHt+yO54Cyoz1QA6A2vecBuaWYaVz0QQPUooHdcV8nxkcTIkULdtGuL0qKMEmv3eVUw4QjO2EgD2Ry9zttuj+o9oz0HNBnsrG7Qt6B5QkRy0C6GwA9+ZDsjdAhDzljOu3STmzB3GTh5NepWM5WzVyDyALXF7yvE6miEKhn4G+Nj5UiEzwssNTv6mBNDPpLEm/zVgt0KXpX+Hut0Pxk9rDqvbEoTJKBPhALPp/piT2XN4PW1RP87R2xvZYviI6UUyqtIDi3LzVF9dyS1uA6Y5qYhhK5EfdmLMZoeQg/lsD7EY0GMKNA== 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=2eI+DHn8Pv6w+6n5X9IHyI/ROENTq+x0z/36d6kypuQ=; b=LJrnRmTDHGYIIjWmeyZBpBttfDxu0culU32UJXLaE2M0nk047596XraBPOAh1ePbtu+LGBuENmkL+bwHChbvsvdvlTITwWSgdNhwJAo4DegN4pKHtWOld8AnYb6aa5fhscl0UlbDVYg1CoObLG8wpZ/uaOWo81Kvw8A6SiJo/PwqHlKNPCT7JcEKmeRKFR315iqAYwg8ZO4pN5i4nU4VYdMr3mkCKkCEOToiJ/SkB7u07dZft4zfAS+Unc0Ga1RW0Caeeeb4Ebnz636qFu/B3w7ifALsOh4smp7eiKUcV8J601w77kXGxpGe33pLGPUIlQUTQu7M+GL4Dy1KciScyA== 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=2eI+DHn8Pv6w+6n5X9IHyI/ROENTq+x0z/36d6kypuQ=; b=GLJB3TM10+8deRFR2EqxURFZYYXbDz2dOKQXDh0BZhcsJckAMMKRyoYpEKJiGCNkb4DGF2V5wAkSXD1s4cC1UOQR2g+FeLfUs6EdT6a2KxXeTIYQFnTKuEE8/i33isjSCdkA4MP46rbIHVf6SI4kR50BRfqfF5KuJnCV87wpN0s= 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 IA1PR12MB8405.namprd12.prod.outlook.com (2603:10b6:208:3d8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Mon, 19 Dec 2022 23:02:01 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::ff3c:2d37:75f3:442a]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::ff3c:2d37:75f3:442a%4]) with mapi id 15.20.5924.016; Mon, 19 Dec 2022 23:02:01 +0000 Message-ID: <59f451af-56a9-5c89-7c59-321850114df7@amd.com> Date: Mon, 19 Dec 2022 17:01:58 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.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, 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, wyes.karny@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: "Limonciello, Mario" In-Reply-To: <20221219064042.661122-6-perry.yuan@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MN2PR13CA0027.namprd13.prod.outlook.com (2603:10b6:208:160::40) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|IA1PR12MB8405:EE_ X-MS-Office365-Filtering-Correlation-Id: 54de3116-dae4-40c7-f548-08dae215099c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ewqq1aLo9wzwVI97ZpV+fcAyDAOYtd/slRuhW75FgJPSoI1xKW8aHzz3sYKXDrV+xCDDynaG+ne0oFU0IQhItE8M/7PBroSdBGp2osq59T3EC8TytDpvheW+2DyXiQqdH00a4ZIAAFOMh8V4P7KRlbEg/wxioYlmvts3dx1QK96rEtJQHgqZjzRvkag3A9HuAFalxyNUJCgG6x7YT/DPWyyxiRX6WmRmA9SZt6vNtMklsURF7xy7s1FqCNjE3SSlJqRQhiLxSfWmuhB9EUKwGGY+zNxhRWhHxus8YDdPvn3H1zhBVUQTHib/Hfu70EdRTQUHDH04wGXxUfZiA3WiG+isU6IpEZtT4ez6V9+4LrqPmbECZX7E2wP11oJlGIm2iSGE0KG+gud109meSqf+oHtYNjO5KUcGbYCw7lvNui5UvY0/eb/gIVYjNQt33gZNW5hJXfCIiAK6DvpFidwSDVuq6bD5EKtvtlh6Nx44lKYyerD9YuS8etr5dV6LNtuRX2bA7zVJCneFPoTySE3fjkM8p5GGqTTiCZGFmGIZmtWUC0xWHmOm8Iy2o183U08vfVfhG4aeONiankq8rz5ZQnnO642iBArBUhOMJ8/D6+pcN13T+BWPghtrovaXgA6mwGUqcN9cNn2VCmoGJ3JVOXtkEjmnlz2PmAXlT6Lq7YC+xsf3Dba2Ejf/WT+aqICerv/wYT2eBnsHfLPd2zVn1Z7CqdE+sCwzDLsm+RjaClI= 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:(13230022)(4636009)(376002)(366004)(346002)(39860400002)(136003)(396003)(451199015)(41300700001)(36756003)(2616005)(8676002)(4326008)(66556008)(8936002)(478600001)(66476007)(5660300002)(66946007)(6506007)(53546011)(6486002)(6666004)(83380400001)(186003)(26005)(316002)(6512007)(86362001)(31696002)(38100700002)(2906002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SjVyS0VMWmxMTjBYTlk1VkVqejlIcDJySGNWbDlwdkdHd0U3N0J4M2dSNUUz?= =?utf-8?B?SWgyK2NYNU5KV2JBUHVqbU9GZkE1a1NPeUZPODhlcW1kaXI5NTBlaGtZdWxG?= =?utf-8?B?MDFtYkFEOEVvcnlNc2Q2NzhMZWV4cnAzLzZsSXFvQTNGSW5hNTNxTG82QWVR?= =?utf-8?B?N2R3Yk0zc1FUNWI1QWYrTGZtUXBGUzczT0w3NXU0NXVQMnNoRVJlY09Kb3RC?= =?utf-8?B?c01ISENUVWphbVVwZjZEaE45K3RsRmlIbUpNRUFuQVFrYmxVS2JjWTBCR1hV?= =?utf-8?B?Nks3emt0ZFVIRjZZdzJTUjUyZ3hJalE0dWlNaGxoQmx6bXhCek9YeDViWVVv?= =?utf-8?B?ZnlLa3NiUXl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MS-Exchange-CrossTenant-Network-Message-Id: 54de3116-dae4-40c7-f548-08dae215099c X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2022 23:02:01.1068 (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: utjH9Fyrrnp5w2RF1gG1bTE8TdlMWHo/5lM0i2zuPcgOfmfWJ4erHYklFqIRHfc20PbHqNs3G5vc0oM7FfIWJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8405 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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 00:40, Perry Yuan wrote: > There are some other amd pstate driver working mode to be supported. Perhaps: The amd-pstate driver may support multiple working modes. Introduce a variable to keep track of which mode is currently enabled. > Here we use cppc_state var to indicate which mode is enabled. > This change will help to simplify the the amd_pstate_param() to choose > which mode used for the following driver registeration. s/registeration/registration/ > > Signed-off-by: Perry Yuan > Signed-off-by: Wyes Karny > --- > drivers/cpufreq/amd-pstate.c | 35 +++++++++++++++++++++++++++-------- > include/linux/amd-pstate.h | 29 +++++++++++++++++++++++++++++ > 2 files changed, 56 insertions(+), 8 deletions(-) > > diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c > index c17bd845f5fc..861a905f9324 100644 > --- a/drivers/cpufreq/amd-pstate.c > +++ b/drivers/cpufreq/amd-pstate.c > @@ -60,7 +60,18 @@ > * module parameter to be able to enable it manually for debugging. > */ > static struct cpufreq_driver amd_pstate_driver; > -static int cppc_load __initdata; > +static int cppc_state = AMD_PSTATE_DISABLE; > + > +static inline int get_mode_idx_from_str(const char *str, size_t size) > +{ > + int i; > + > + for (i=0; i < AMD_PSTATE_MAX; i++) { > + if (!strncmp(str, amd_pstate_mode_string[i], size)) > + return i; > + } > + return -EINVAL; > +} > > static inline int pstate_enable(bool enable) > { > @@ -628,7 +639,7 @@ static int __init amd_pstate_init(void) > * enable the amd_pstate passive mode driver explicitly > * with amd_pstate=passive in kernel command line > */ > - if (!cppc_load) { > + if (cppc_state == AMD_PSTATE_DISABLE) { > pr_debug("driver load is disabled, boot with amd_pstate=passive to enable this\n"); Presumably this message needs to be changed since there are different modes that can be used to enable it now. > return -ENODEV; > } > @@ -671,16 +682,24 @@ device_initcall(amd_pstate_init); > > static int __init amd_pstate_param(char *str) > { > + size_t size; > + int mode_idx; > + > if (!str) > return -EINVAL; > > - if (!strcmp(str, "disable")) { > - cppc_load = 0; > - pr_info("driver is explicitly disabled\n"); > - } else if (!strcmp(str, "passive")) > - cppc_load = 1; > + size = strlen(str); > + mode_idx = get_mode_idx_from_str(str, size); > > - return 0; > + if (mode_idx >= AMD_PSTATE_DISABLE && mode_idx < AMD_PSTATE_MAX) { > + cppc_state = mode_idx; > + if (cppc_state == AMD_PSTATE_DISABLE) > + pr_info("driver is explicitly disabled\n"); > + > + return 0; > + } > + > + return -EINVAL; > } > early_param("amd_pstate", amd_pstate_param); > > diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h > index 1c4b8659f171..922d05a13902 100644 > --- a/include/linux/amd-pstate.h > +++ b/include/linux/amd-pstate.h > @@ -74,4 +74,33 @@ struct amd_cpudata { > bool boost_supported; > }; > > +/** > + * 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 */ s/Drier/Driver/ > + 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, > +}; > + > +static const char * const amd_pstate_mode_string[] = { > + [AMD_PSTATE_DISABLE] = "disable", > + [AMD_PSTATE_PASSIVE] = "passive", > + [AMD_PSTATE_ACTIVE] = "active", > + [AMD_PSTATE_GUIDE] = "guide", I get the intent here, but guided mode isn't actually part of the v8 series under review. I think it should either be folded into the series or this patch should be split into two across the two patch-sets: 1) introduce the state machine (part of the EPP patch-set) 2) add guided mode support (part of the guided mode patch-set). > + NULL, > +}; > + > #endif /* _LINUX_AMD_PSTATE_H */