Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3369082pxb; Fri, 5 Nov 2021 14:35:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjmhq66KC1AtHFGqR6tvJBJUXB49iRndW3/mf+TD003vNZhp6VMUHLxYG9RudxW8MeWD1d X-Received: by 2002:a05:6e02:1ba9:: with SMTP id n9mr33341314ili.297.1636148121110; Fri, 05 Nov 2021 14:35:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1636148121; cv=pass; d=google.com; s=arc-20160816; b=dTDq9au5ogwKUJ7uuYfCcFnL33XLKiM5DEQh2zPizDb6iXC1gVLuGq0Rs/0Xfo65dV xmV5C1qHlAOuZG/a6myyWrlyejUGIDupPdN7L/2AoZYjJvPNxE1ogOFRBLu9/nh9NplV vcehAVSIBZ7tnNDhBVurVqvHZ1WiwCghS9HkHXUiHJI7fOEAcByq+HmLTCeyQz4/wex3 49J9aXtqCArFCki3UwILskbxhsbBfyFWDWCCspus0v32QPn2tCxQqUtuP+AtqDzj7d6f DCux4DPXTUfH2fsjjdtHXHwS9RNNrABVk7IR75Xpqhw+RxLqH0vOJK6LxLoyXXzpcclO WoMQ== 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 :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=3spJF82tAC673bvujY0bSz4EVmrYuy24Li9SfYiHFus=; b=kcKoJc1yO+F8zoEmJqe/4iUC6lb6malhHK45NXhuvLAuddog+c+a5bf9zdaFQokswX AXgq/AaFYGUJrBdEQXlc29wNfaXcSuSZoASfgx6FRJK1wdJXrWUZVpTxrislAVvkzqIF LK+fGnM7bR3zMMhmneUv/X9crZksSEl6wFI2cCzHG2x0tnT0FsYVrrWfr+4S2sf1WSdJ KXKJdiSqGWcPgd3iqmD7vC9lR7M4qPmmXcu4FEWS2j5BUctrdKFefjLm+smKuZsNf9yj a7yWoT4DQZqNr65CmVoLDBgHCKpmYr4/yljqwLRwEuXHXIcPhhrfLmpGmZiohdkiR+85 WRGg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="jNabO/9R"; 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.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x11si10576202jas.123.2021.11.05.14.35.08; Fri, 05 Nov 2021 14:35:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="jNabO/9R"; 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.18 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 S233050AbhKESxi (ORCPT + 99 others); Fri, 5 Nov 2021 14:53:38 -0400 Received: from mail-mw2nam12on2062.outbound.protection.outlook.com ([40.107.244.62]:18656 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232996AbhKESxh (ORCPT ); Fri, 5 Nov 2021 14:53:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UBo3KJALh2Q5aW9J35HmN67mdHrS+S2C/BLw4EseoIu5X8/fQgOSF7dIO7Ihtzid5bfdG46WDBPS4X6R7A+CppFMvpJG9KoBaIcwccidqQpqQAnFbKQLR2flW32YyYbliSMqw+tC0oS4+Z25xJfJPBl3vYAL51qQl0vghI/R+TVXHAmmL36F+ovUs0KH7DZwX7bHXiGLCTXojBzzU9HzailGXd5JuLWeOgZUC6J+nEmU57XEJirJRFEv3GYdEYfB0kru4ssGd013OKBf0qMXwMx1TLME0DmLyfBaQvLZ9Lqd601yxwV5br8Sk0/oMUt/wQssIYVfTb04XSNF3nKruw== 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=3spJF82tAC673bvujY0bSz4EVmrYuy24Li9SfYiHFus=; b=bE+C8kyFZJn/GBvMb7ZrFO40sMeX7t9nyOmqo931HQMNTUigzg4zi/5oMNCqHyayJTXjIQeRaWbRo7GI0v/DlzfjVP8qrcEJimSTrJ0NZWDdBQ7JMmqtfr+c5v22SEsEXBOA/jeffBc6K2uqh3B/8Byj6VAYKlwjnz4qArixKnyN/+lxEEWak6zN35/+nOcnYuvWas+e8jQxMqphrmrCJ1ckzfwg9C1dXcbjdOJdW5F7pjJeDF8daCROw1ESa1oMrqbAdgskggAsszVBPYjag5l79TFxJhQ4wNuqLBm+uLfiODEjboYdn+pK7Xa5LN+n7zcBWS4BNi9rcdIDRZ5clg== 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=3spJF82tAC673bvujY0bSz4EVmrYuy24Li9SfYiHFus=; b=jNabO/9RXCRg8wCWIA8pYpRzUnRMaqmTfpTAStR7Gy/QZnADcsLYJmvpTzecH959V+7YYgsNBSCA1ZgfZVc0LsRENN2VqMU4J7ISPPZhNRiAWMCeY83ITdUWR0CdILqSRRPfKGlDcLlnWplKz7ruibWO09O4Wgvgwi1n57A6y8k= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB4720.namprd12.prod.outlook.com (2603:10b6:805:e6::31) by SA0PR12MB4576.namprd12.prod.outlook.com (2603:10b6:806:93::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Fri, 5 Nov 2021 18:50:53 +0000 Received: from SN6PR12MB4720.namprd12.prod.outlook.com ([fe80::c4b9:b9bb:e863:af39]) by SN6PR12MB4720.namprd12.prod.outlook.com ([fe80::c4b9:b9bb:e863:af39%5]) with mapi id 15.20.4669.013; Fri, 5 Nov 2021 18:50:53 +0000 Subject: Re: [PATCH v3 12/21] cpufreq: amd: add amd-pstate performance attributes To: Huang Rui , "Rafael J . Wysocki" , Viresh Kumar , Shuah Khan , Borislav Petkov , Peter Zijlstra , Ingo Molnar , Giovanni Gherdovich , linux-pm@vger.kernel.org Cc: Deepak Sharma , Alex Deucher , Mario Limonciello , Steven Noonan , Nathan Fontenot , Jinzhou Su , Xiaojian Du , linux-kernel@vger.kernel.org, x86@kernel.org References: <20211029130241.1984459-1-ray.huang@amd.com> <20211029130241.1984459-13-ray.huang@amd.com> From: Nathan Fontenot Message-ID: Date: Fri, 5 Nov 2021 13:50:49 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: <20211029130241.1984459-13-ray.huang@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BN0PR02CA0054.namprd02.prod.outlook.com (2603:10b6:408:e5::29) To SN6PR12MB4720.namprd12.prod.outlook.com (2603:10b6:805:e6::31) MIME-Version: 1.0 Received: from [IPv6:2600:1700:271:b60:ca47:7240:2ff:8536] (2600:1700:271:b60:ca47:7240:2ff:8536) by BN0PR02CA0054.namprd02.prod.outlook.com (2603:10b6:408:e5::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13 via Frontend Transport; Fri, 5 Nov 2021 18:50:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0423de2a-6829-4f3e-21aa-08d9a08d316e X-MS-TrafficTypeDiagnostic: SA0PR12MB4576: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:561; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2Q/biMP2ub27Hnq53lBLcwAS4M7bmBrilaJ65xWx3d0PrSzCBs54YK5Uau38m4xf3NGAwxKsRwoUn9qHWRDq5pSx3JyVEBnkCd5LWx1L/nhn+gu3p/XUL9jcQe1mXpv6wuGJ6CgCZWhtkHdK4L0SPCcNMQPH6J7gBU1Hf00mWcldYPWbcWYijeBXlEP9OM7r/F/uq+kvLjeQZH3QhhUxVKCNZXfCjv3KdEah1lwl6QEOlxUQ0KIBtxIyZLghZ4obIPpBriC6iqRyTJLkEGxaTCSnIJWxTGDDsxYt9Tit+P82lT8a3lPkxMguKy1EKccqbfRLCrEWq4RAlKAO1qxbFGIDljRIfMPOA2r5hThLAoftu6RxSUauGYbCSMcVY60w6v7K8PamQ/raCxXHrHiMZvOhi75IpFLwXNVUiWpMxeZEmecEiINxDreUsZaLJTob2ipTGC6NpHbcgageLE0lskN1ckK0E+zKfAsKLSbaqdOylGqeQek2GSbAhRBUXR+b7X8urQzqQe7cxPj4tyt8t9sayLKJQEmj8xwHJow9mjnxCpZrwpAX8yqBkfSG25ZfQDg0EQc0yoP0L3QYwMLy6Nr9AURFsXe+EAm2IZAp9sgdDKt/+0WIZ7oZBf1/GzMUmwz6zc4Y7/b/w99gpeANkWH7IPGxJKnzjoFDpX3TkUuUgSfteOrA+R4fEkHzU8pHtn3cYLovaqcz7PqIY0f62vZUdSAtL0Sn3zAzeNlDNb0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB4720.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(31696002)(110136005)(8936002)(53546011)(66556008)(54906003)(2616005)(4326008)(83380400001)(6486002)(508600001)(186003)(7416002)(66946007)(5660300002)(36756003)(31686004)(316002)(2906002)(38100700002)(8676002)(66476007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YlFlWVNFcEJ5WnQyeGgzWnRlNjZMZFhTYlR4TGNGWnQ4UDd1YW9icGhiYW5z?= =?utf-8?B?aXFUVHNPVTBhNFhpVjlTdXdWZ1ZjL0F5ZTQ5ajhPNTg0ZVN6N1ZibXpWN3pl?= =?utf-8?B?VjNyMURsYkZUYjgwSWV6dUxvWWk5bE02T1ZLemhyMWNWb1RzeWxiaFFXSXRa?= =?utf-8?B?UGlzcTRlZS9FZ1loeEFHbmNVRjM2Y2lSbVJFN2ljSzdRSk1tR2FCN2YrODAz?= =?utf-8?B?L2tZdzJuVjhXV0R3U0dzTEhZRWZCN2xOSGhnc2oxOWdTTFFvNnVNS05TREh0?= =?utf-8?B?ZGtEZlpoaG9QaUF6OTEwdEdXay9KTFJEay9CeWo3a21QZHhtQkRqQ1Z1REw1?= =?utf-8?B?RFB0a3dwZDZTanR6QmxQOXc4YnZabjdyVUlJQW1CeUx4L2ZDZWxXdllJaDBZ?= =?utf-8?B?ajdaY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3JuNUI5OUxuaVRw?= =?utf-8?Q?/Co/ZyEemYioHhbTpZbokIblTu7O7psF/5Gdgzggqw=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0423de2a-6829-4f3e-21aa-08d9a08d316e X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB4720.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2021 18:50:53.1848 (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: voro8JOInpm8C411MmGnASNZbKDxU5t61JNXiwTI4fXgejZiYxi9PfQZi9qxUthXXc0sAzk6/A474ZaUAXKebA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4576 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/29/21 8:02 AM, Huang Rui wrote: > Introduce sysfs attributes to get the different level amd-pstate > performances. Can you explain why we need to provide duplicate sysfs entries for these values? Each one of these are already created by the drivers/acpi code and exist in sysfs (see /sys/devices/system/cpu/cpuX/acpi_cppc). -Nathan > > Signed-off-by: Huang Rui > --- > drivers/cpufreq/amd-pstate.c | 53 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 53 insertions(+) > > diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c > index 8cf1e80f44e0..58ee50bf492b 100644 > --- a/drivers/cpufreq/amd-pstate.c > +++ b/drivers/cpufreq/amd-pstate.c > @@ -536,14 +536,67 @@ static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *poli > return sprintf(&buf[0], "%u\n", freq); > } > > +static ssize_t show_amd_pstate_highest_perf(struct cpufreq_policy *policy, > + char *buf) > +{ > + u32 perf; > + struct amd_cpudata *cpudata = policy->driver_data; > + > + perf = READ_ONCE(cpudata->highest_perf); > + > + return sprintf(&buf[0], "%u\n", perf); > +} > + > +static ssize_t show_amd_pstate_nominal_perf(struct cpufreq_policy *policy, > + char *buf) > +{ > + u32 perf; > + struct amd_cpudata *cpudata = policy->driver_data; > + > + perf = READ_ONCE(cpudata->nominal_perf); > + > + return sprintf(&buf[0], "%u\n", perf); > +} > + > +static ssize_t show_amd_pstate_lowest_nonlinear_perf(struct cpufreq_policy *policy, > + char *buf) > +{ > + u32 perf; > + struct amd_cpudata *cpudata = policy->driver_data; > + > + perf = READ_ONCE(cpudata->lowest_nonlinear_perf); > + > + return sprintf(&buf[0], "%u\n", perf); > +} > + > +static ssize_t show_amd_pstate_lowest_perf(struct cpufreq_policy *policy, > + char *buf) > +{ > + u32 perf; > + struct amd_cpudata *cpudata = policy->driver_data; > + > + perf = READ_ONCE(cpudata->lowest_perf); > + > + return sprintf(&buf[0], "%u\n", perf); > +} > + > cpufreq_freq_attr_ro(amd_pstate_max_freq); > cpufreq_freq_attr_ro(amd_pstate_nominal_freq); > cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq); > > +cpufreq_freq_attr_ro(amd_pstate_highest_perf); > +cpufreq_freq_attr_ro(amd_pstate_nominal_perf); > +cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_perf); > +cpufreq_freq_attr_ro(amd_pstate_lowest_perf); > + > static struct freq_attr *amd_pstate_attr[] = { > &amd_pstate_max_freq, > &amd_pstate_nominal_freq, > &amd_pstate_lowest_nonlinear_freq, > + &amd_pstate_highest_perf, > + &amd_pstate_nominal_perf, > + &amd_pstate_lowest_nonlinear_perf, > + &amd_pstate_lowest_perf, > NULL, > }; > >