Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp453724pxh; Wed, 10 Nov 2021 04:32:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzD9u8Xkf3hG8r+EOJrZ163BNCL9rqk5Iddlf6kNZM4xvDqw0rmInJOm4QBRQkch5kb5K5V X-Received: by 2002:a05:6402:520b:: with SMTP id s11mr20741283edd.363.1636547536631; Wed, 10 Nov 2021 04:32:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1636547536; cv=pass; d=google.com; s=arc-20160816; b=nVnOfY/p903yxQ6uTubBkMgaXU8UJK/kdolT1Ec7YApQyETpoKC4fxb7dR6sT841u0 NoWawOfe4An6EvRjN3yotemrC9dpye8EzghsjjToC/96U/iDX0jbEK5mXFvlGDXhK+ZY V/0KmXXGXeBfBIJwEpASoJfHMJ5s3PHywpsSS1Rh4cwiK3HeC62wBtocUsvLy8AxrNgD knquhmUSiy/qh83m2r21yuFvnEZqoBh8hLM4SBqgQtedQgjfeaoX3uRvM2q87CM+uObU jDc0mb2e5M+XAk8GzAUBXCBJHxNsmRo0ZxpbSVCPr/MiSoraWsaxtNmGsOTW2lm0qlYB J+qA== 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=ltK+dLjVLcnH6eXlNnB0W8qZsjqslyklxkAWNMznTi4=; b=CHgDMhGKpU99cYK2jIEb0qdXiPiTxSLMWl1Ojc8nAgQXrgDPoXCfIrchEGvKQkvKLu rlzR+Qr1aumwk3VIR4quU+5xYVOO3q6+qZuMPJG0QqEv5osf8QNpWxTcVOViAee8+hzN IZR8Cz481BgRSUmAxE4wGu4gk6m1jLy4bRt8UDWz+cOzWIuXLPDvzForceXGXtbTdJGY Oqn1cOKU0FEiToI6F2pUruHh25m06brydZqMv5gfEz72seIEoFd8e/s0jqUFstj4xXcY zlmICdPOopuUj9+UiVt2x+x5gHEqkru87DEd5DkcdvUO/NJUMyy3d1TwqC7L1uLiNnTl jofg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=1YtxP7jN; 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 z26si43091759ejc.230.2021.11.10.04.31.50; Wed, 10 Nov 2021 04:32:16 -0800 (PST) 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=1YtxP7jN; 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 S231518AbhKJMbh (ORCPT + 99 others); Wed, 10 Nov 2021 07:31:37 -0500 Received: from mail-bn7nam10on2042.outbound.protection.outlook.com ([40.107.92.42]:22881 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231298AbhKJMbg (ORCPT ); Wed, 10 Nov 2021 07:31:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QwnyDj7AxwYUPFgG86/rwZKzBu4uU3/8mHJV8LN7aGUHm3SCOlBBlC+NEhgYoFutTmm7Xy9ecNjO3KEs53dHGEZdh4RAJhJLxz2NWrmJeDZdw7bLvbOxyd35Ryw5JNGgntKVNZK+F+NFBKJN7swq+mLk3ATNR+2yvbNhHCdQBr4yCmMyiFdiwhS0A8jRLSz0zcHWAg/u8xV8onRS2MypRfKY6H/a7UkXw8SIMBo/UQaMkFkURi2cIcozgPc5kXcocERwP3pFjPSPs3C6Lbd1UBKLgFN5n+4LVQPt5bKcKJ7qp4StZm6zg0TPcZP3NTETgRAOQVlTyFXqK/sD2VWFag== 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=ltK+dLjVLcnH6eXlNnB0W8qZsjqslyklxkAWNMznTi4=; b=cneygVRRwt0SabUjOjekgiS5cELDJzbZqreeLuXgDscgM5mn23hPaI00TOgHSLPk07gETwD2qGnYuq0lYCzdKOIJvg3IGtJn3fZtPCUJkyaHSOdOAODGDO3E/NK2u7suaKOw8Bgur2zQ1xnyWDKTGDbqAQ49BtN9hkXB87Iczl7ydCTQYzLxgrZlbLMDhPyJvldNPWinJ8qJJwJts5tWiNemLcB1ydirsAznJGPG1QTt9IceF1KGJGi19PttZ5nUkDpQ0u9Z9CtSskJXb3ha5y/Z1UWh4ZjMmtQoWhfGdsHn91jrgjyrO87wUuPqmhryKJv0aXr8z+FvJ3ys9SZVOA== 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=ltK+dLjVLcnH6eXlNnB0W8qZsjqslyklxkAWNMznTi4=; b=1YtxP7jN/onhARyi3LKEwRKmgBANfjVPb1aQzIhDMV+K+QCQBmMgn4HOmcIedqkPs9pEC3mU3qzpHARWYxEYk1iukKlJbmr/6H2EEQdjvl0dEKBXiNWCZqv3zfA3lmrwViv4GVVHT6QhPoXHXz39hlXDqaJgzXptBi7IxXOPvMA= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from CY4PR1201MB0246.namprd12.prod.outlook.com (2603:10b6:910:23::16) by CY4PR12MB1381.namprd12.prod.outlook.com (2603:10b6:903:42::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 12:28:45 +0000 Received: from CY4PR1201MB0246.namprd12.prod.outlook.com ([fe80::5d29:d78d:3e89:b697]) by CY4PR1201MB0246.namprd12.prod.outlook.com ([fe80::5d29:d78d:3e89:b697%3]) with mapi id 15.20.4669.016; Wed, 10 Nov 2021 12:28:45 +0000 Date: Wed, 10 Nov 2021 20:28:06 +0800 From: Huang Rui To: "Fontenot, Nathan" Cc: "Rafael J . Wysocki" , Viresh Kumar , Shuah Khan , Borislav Petkov , Peter Zijlstra , Ingo Molnar , Giovanni Gherdovich , "linux-pm@vger.kernel.org" , "Sharma, Deepak" , "Deucher, Alexander" , "Limonciello, Mario" , Steven Noonan , "Su, Jinzhou (Joe)" , "Du, Xiaojian" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCH v3 11/21] cpufreq: amd: add amd-pstate frequencies attributes Message-ID: References: <20211029130241.1984459-1-ray.huang@amd.com> <20211029130241.1984459-12-ray.huang@amd.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: HK2PR06CA0022.apcprd06.prod.outlook.com (2603:1096:202:2e::34) To CY4PR1201MB0246.namprd12.prod.outlook.com (2603:10b6:910:23::16) MIME-Version: 1.0 Received: from hr-amd (165.204.134.251) by HK2PR06CA0022.apcprd06.prod.outlook.com (2603:1096:202:2e::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13 via Frontend Transport; Wed, 10 Nov 2021 12:28:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 679e7b04-992c-4e02-5ef8-08d9a445a36f X-MS-TrafficTypeDiagnostic: CY4PR12MB1381: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fuy4PHVMWGlxjml+BgcNRU4qXrLH+HqoPLD/nAmXuNvZLZzBqvYi18iMu0YaXspC+/aZ7CDCubXB+8xZr5QamaBiq3ISc6d/u6/zWyuGYkz7uP5bXbW04GOgE6oG6fOWhY1HCalcm+NzsKTWWOkHUsQ9TS3mccHwy4gd7bIcUB2q91W7ca6nyseJhIc0MLMi20x2ckaYRtplvdv9C7D8EvlTLEc41Z/rUS8z9hYmjIf+gCEvWw1/12IlEldCOmzMiyfzcgkTIO2L0xNKrbatTBY6MxtnBbMb9M7ef7c0Y5KaB/cQvaYpvWNOTavUO0ThnO+rP3mXmgAl8wpOG7X3PoaZO92cnFzmTYyT2CFi6awHJ3eG5Ix+QhwPzt+yS6IQSHsEOOWnbH+NDpsicYR/OX97R0anXPK5C3qu4Wtbbb5g/rqi4C181WeU0aNeCQNsmfvPazZtRBwY46EleLaz5U1qWCGZw+WRKktFHz0u7r5ycd89JBXfX1n12H8npCKsmJ9zKpnkaSSdiOeEIQGJ+baUwCSgPK2whzp8uyXcjJyKB+mEb3NlU4pxkj6+qoWn/EBzXGnHrpEpyAVCMCwABKUhanSpfBQuF8Cp4KDdbcWIFD1s+d6jjinvlmCI4TCVLtkFZyCCv7ihrKD5UlPA01jX4MMM7Duo1CZxdVidNnU+giQ0o1cpKyu3q3AntMxoAcIjiC7n816w3abL4KAs2w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR1201MB0246.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(66946007)(508600001)(55016002)(316002)(5660300002)(54906003)(33716001)(53546011)(9686003)(66476007)(66556008)(2906002)(8676002)(6862004)(956004)(6666004)(26005)(8936002)(4326008)(6636002)(7416002)(38100700002)(86362001)(186003)(6496006)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?KSRwkpYy7ONy9N7nk9IchuuT8J0EzaJ3S7gHJ6YUfJyHKOZi4cnrylyF8IsM?= =?us-ascii?Q?l/kZzs0J1ehaUZru0/afozztbMkBOEA+QGNNYvD/xwAN91jmJdSYYlAMs3YP?= =?us-ascii?Q?6DEFYLMQqsnOkin1ecVqtyzwiYe8rlsXobzWxiV1d8Fcgt8yvPva2mW5XEkZ?= =?us-ascii?Q?dHNctKFgXDTwkahpbjQO6h4gKln43j7Fp4LVUzDUD6uokBo0Vc2PDlXtDN20?= =?us-ascii?Q?QhxHcrhcocCIB/B3uDIpQNlLsIXID4I2lWUFTMlJbMVl4vfSJrT/Om/wyOvR?= =?us-ascii?Q?o0AWedB12KUHIHWAU4kh+2N5EXZLNVtSOm5J7JGEDyXiMFWtD25xgCxl9I5n?= =?us-ascii?Q?iSWQaanNtQ8IuHKfQM0+MU+yRm90pXel8QNEFPMFBHpxoauAqiA1U89jLTLP?= =?us-ascii?Q?eVxFQ5xtQ0OzPuHZqKZvPYSin5fKpLmAGVupKp1iD1EO/T12Ry0m9PAp4ye4?= =?us-ascii?Q?AHVCjez1Wrrzu7C8jXPgu7iucVSd31QZzbnK6Fyt/ZTnQxxSAgmeLzSeP6LN?= =?us-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ST5Z5QjoFAxCiJzF3Uq7Z3spW4h75G?= =?us-ascii?Q?euGUreRhch3WOJ6diGVWGK5KufojzbRz766hD1Qd9fRoqZXBCU7WWqq/w8tj?= =?us-ascii?Q?NiAWrIzeePxAXY9t/mlLYmMmUYwyJRwwO25omVCSbu15CuQ9CYcKvPkFtGoy?= =?us-ascii?Q?bzFqyjmdwyCdA//i38h4IJ1xXy77fYeXuVn1n2a4wK2cbYl1A9MdYdDVHdKR?= =?us-ascii?Q?aQi8vxuJ1vVJHcSfLLCAcZY=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 679e7b04-992c-4e02-5ef8-08d9a445a36f X-MS-Exchange-CrossTenant-AuthSource: CY4PR1201MB0246.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 12:28:45.3618 (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: JC02B0iQbyzPdbP2WewSrHNXASlvnpsyI+LyKV/JOV8vII4iPq0I6KA2wZjHwP0eA851v4ytDFEt164LSGzCoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1381 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 06, 2021 at 02:59:55AM +0800, Fontenot, Nathan wrote: > On 10/29/21 8:02 AM, Huang Rui wrote: > > Introduce sysfs attributes to get the different level processor > > frequencies. > > > > Signed-off-by: Huang Rui > > --- > > drivers/cpufreq/amd-pstate.c | 63 ++++++++++++++++++++++++++++++++++++ > > 1 file changed, 63 insertions(+) > > > > diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c > > index 9af27ac1f818..8cf1e80f44e0 100644 > > --- a/drivers/cpufreq/amd-pstate.c > > +++ b/drivers/cpufreq/amd-pstate.c > > @@ -485,6 +485,68 @@ static int amd_pstate_cpu_exit(struct cpufreq_policy *policy) > > return 0; > > } > > > > +/* Sysfs attributes */ > > + > > +/* This frequency is to indicate the maximum hardware frequency. > > + * If boost is not active but supported, the frequency will be larger than the > > + * one in cpuinfo. > > + */ > > +static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy, > > + char *buf) > > +{ > > + int max_freq; > > + struct amd_cpudata *cpudata; > > + > > + cpudata = policy->driver_data; > > + > > + max_freq = amd_get_max_freq(cpudata); > > + if (max_freq < 0) > > + return max_freq; > > + > > + return sprintf(&buf[0], "%u\n", max_freq); > > +} > > + > > +static ssize_t show_amd_pstate_nominal_freq(struct cpufreq_policy *policy, > > + char *buf) > > +{ > > + int nominal_freq; > > + struct amd_cpudata *cpudata; > > + > > + cpudata = policy->driver_data; > > + > > + nominal_freq = amd_get_nominal_freq(cpudata); > > + if (nominal_freq < 0) > > + return nominal_freq; > > + > > + return sprintf(&buf[0], "%u\n", nominal_freq); > > +} > > The nominal_freq valus is already reported in sysfs by drivers/acpi since this > value is part of the ACPI spec. Is there a reason to have multiple sysfs entries > for the same value? > I will clean them up in V4. Thanks! Ray