Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1809205pxb; Mon, 13 Sep 2021 06:06:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWeZ0S3vfZPuHFyx3OwNkwKA8xj74FHSScyRpejuLmSvnohxHzWskUt44E/STcQFstnAGE X-Received: by 2002:a05:6402:350d:: with SMTP id b13mr13039307edd.1.1631538386332; Mon, 13 Sep 2021 06:06:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1631538386; cv=pass; d=google.com; s=arc-20160816; b=KyEtBhySDL16OPWfd42Onwrl3Ifwk+yUcyHNuYamBFAb2ZG7DeOrsP3dytPn3VSkOY bRXoiXVoqewDwLkL542bvbSu4iCk33i4qp6AooYzvawIohHK/OHJYsRjmX1ATGDrxESy YaEOwEHUGv+6vzRhv/2WJI9GAvGJTB9eMppbrTo/P+gTc24hnm52EVs5srq+fDHtt1q2 NPgTl1aN4Mn4rkENpiLF4NOne02Hq86UXeCwfcarO7Q0moZKXyhwfh8YxQYq8abXzQIX MuI9RynVl9D/Kx3RdkWGoNldfaTtRShn9PRDox+I9p9CZZ0yLKVvIhkx/X54l3M5hJLO BIkw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E4VSsTO5KNDOPjv+jhQV+1nkI5BlVf01smD+cPvg4OI=; b=xHaj4NUpHGMh1Ot1vWXLNrBX721TRNNBu+cRJk6m7ISMKj0lUz5ADYD24vyoHFJ4VR smQhHqhfjKEKSjPZ6QBcO7P1yXnNfYTTylXt8c/2Bcu8doJ5ra83A6pFXcUNvtrLzizp 1VZDlVdmyBdtRNlp3B0lI3ZQcheNbj4MoL3Zz05k5vQ7yCLJ291Vd0Vpu5n2dP5+ePN4 T6wTCKNMcEdymOSFuMY4u2POLliOR5ZHwoo/XB5CSYtPF1Qu1ND2JKoV7eAMbGYamTyM 15XE+UfWFLcX/2IHjwiHz3r1lzeNm+AI5dNa5zTSRxu9F8gfVLM9AsPha6FuMt0EDYpj IVhA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=x8P1qwUO; arc=pass (i=1 spf=pass spfdomain=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 b7si7529645edk.458.2021.09.13.06.05.53; Mon, 13 Sep 2021 06:06:26 -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=x8P1qwUO; arc=pass (i=1 spf=pass spfdomain=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 S235475AbhIMM7v (ORCPT + 99 others); Mon, 13 Sep 2021 08:59:51 -0400 Received: from mail-co1nam11on2077.outbound.protection.outlook.com ([40.107.220.77]:44832 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229613AbhIMM7u (ORCPT ); Mon, 13 Sep 2021 08:59:50 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q1YmRcLCs2lAREqghbprcTRszPH1EFRPETaEWv3v7BaAUgGkwUQ5RmXoX2e9whNia2WH644io0fnR5y1ZJunc0EkdVbl9xavY09DsAdCXtNMJJYQkII6sPh4we7pmvIVgsw8O8IsD5Zr+XXJwMo6Z3t5AfAAa35qIkcD4gyEJ6ugFaE0wsp/a2pIUqniCCDkWN/3RVWdkN3POIiEeLol7jWgKIj1GJM2nMyrbtqQ89PNfHsx7Qc6S7KeCpNFn2uc18TCbQjXplH/QJbxNrd031U0y+ojQdyxBZMonrZahaSWfVGIFi72d2wmvibIT0Is0qRGYFBywcpA910i2mez7A== 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; bh=E4VSsTO5KNDOPjv+jhQV+1nkI5BlVf01smD+cPvg4OI=; b=K113Wm+ydkrFriNhajEqUxM6JMmqW1pqT1w72MteEZoFHv6GWiLs8WrGPWCqaegsnuEuLsnUarIzFemS27MnS4rh4/Tk7h7aX8mVvOk3WzED2IJ32+rvwQ+rphALrKTwBgENgiVX6/kQKXufpRpyjo+qAYLYkMUKECOn+NFZoJd+wa01Uc5oAs9R4Yyq3BGOAjVctfC7tpVpENYsx/GHdMPmjlYsoTA/mzcIg+ID77gDGcjt4X1KZMdY19Vupy8uLSudaK58/b5WYi00tCBlJnITetFwoeKW+x4/6WeyWLdsmn5ss0M8QZCc/S/FwW/Hr1+Q7nvq/dLGHmeTurCq5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=E4VSsTO5KNDOPjv+jhQV+1nkI5BlVf01smD+cPvg4OI=; b=x8P1qwUOH2M3N15vEueVvYWASSszcaQ9qr2UZ4exWRqSPx5x7JtDIPXBVFOPo/rhjqWdOZyteuWjgcRnSjh4VZu3E0mW3G+iw5IKpJRw7IjTit5tbbK8kshz/hHVbHsTb2Fzc8Ua5LduouSw2Dic0TbhpT/zBqkji/z+R9kPmm8= Received: from CO2PR04CA0083.namprd04.prod.outlook.com (2603:10b6:102:1::51) by BN6PR12MB1364.namprd12.prod.outlook.com (2603:10b6:404:1e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Mon, 13 Sep 2021 12:58:31 +0000 Received: from CO1NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:102:1:cafe::60) by CO2PR04CA0083.outlook.office365.com (2603:10b6:102:1::51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 12:58:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; linuxfoundation.org; dkim=none (message not signed) header.d=none;linuxfoundation.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT042.mail.protection.outlook.com (10.13.174.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 12:58:31 +0000 Received: from hr-amd (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 13 Sep 2021 07:58:27 -0500 Date: Mon, 13 Sep 2021 20:58:23 +0800 From: Huang Rui To: Shuah Khan CC: "Rafael J . Wysocki" , Viresh Kumar , Borislav Petkov , Ingo Molnar , "linux-pm@vger.kernel.org" , "Sharma, Deepak" , "Deucher, Alexander" , "Limonciello, Mario" , "Fontenot, Nathan" , "Su, Jinzhou (Joe)" , "Du, Xiaojian" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCH 14/19] cpupower: initial AMD P-state capability Message-ID: <20210913125823.GF3731830@hr-amd> References: <20210908150001.3702552-1-ray.huang@amd.com> <20210908150001.3702552-15-ray.huang@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0402bdc4-4fd2-4026-7a0f-08d976b63049 X-MS-TrafficTypeDiagnostic: BN6PR12MB1364: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:873; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kJhCHPnx/4GxVDsXObvM38tzUAELb+3mo/u2806lSmvimX/KzbIMhc+mmHIE816ozRz4/7YqVZLRFOe7nXSU7H8pBUfnFtXmxYfjpQpFHTMoMrkKQL4PZnO4vlgzK0Mw/x0A0CAf9r0IzZ0GtGFpR7jr3colZdUBQaFMvOcKYLLmGdwwjUfydWOPxUULYW47FE73MHAweReeHKl+zwG+sxX1qq7Ja8/fKzMfD9qrjMUXWC1NyebvAzCMsgTX0MGEYpUawk0DoIGRZonte655KTFW+xrePhrv23yLMRaetOuYMMyF+9Q3+cf6C5U6SiJV3kEgk1xe1ZhtrasFu30q5AX24udnMtwLrmsQvvPbXk1Nc6K8tQ7n2LnraNQsC9fo70AKxDVybBvFoBacAOVCtcJ/6fSOiIwyU4hUKEQPY/KPYOu5wUYL7QWbz/1lLx7lyyTb6Y2ibJvc5iiNV7ogWNA9DVcYfxaulDPbuCgSvIZdZvNyc8kQsFIrFEM/0UpwyiuPHzWMWBWHGyNMSKHJo3WP2UgrSmbJtR+5lbOpF/1D/dTym5jMcqFNI4eBot8ru8ZnHBYPlsnLd+rsPEo8ly1IUUkkG6jruNmkHxocwe73ZekTx5rL2aazLufaUIOo+0bDttK74FnLHw3azjc5LNEhB74qdtXsQ3sOCjqtDmD5qLs9uMn/WFtt3wXjpgqHK/yiUuRX+Bre42HaQtWdEqwfX0tpl/onxJaCI77Mylo= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(186003)(16526019)(33716001)(336012)(6916009)(5660300002)(26005)(53546011)(55016002)(1076003)(8936002)(36860700001)(33656002)(8676002)(4326008)(54906003)(70586007)(6666004)(316002)(356005)(81166007)(86362001)(2906002)(70206006)(82310400003)(508600001)(9686003)(426003)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 12:58:31.4333 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0402bdc4-4fd2-4026-7a0f-08d976b63049 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1364 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 10, 2021 at 06:16:50AM +0800, Shuah Khan wrote: > On 9/8/21 8:59 AM, Huang Rui wrote: > > If kernel enables AMD P-state, cpupower won't need to respond ACPI > > hardware P-states function anymore. > > > > This commit log doesn't seem to match the code change. I see it > calling cpupower_amd_pstate_enabled() and setting flags. Hmm, yes, I should reword this as well. If the kernel uses the amd-pstate module, we only need CPUPOWER_CAP_AMD_PSTATE flag, and disable the legacy acpi-cpufreq relative flags. > > > Signed-off-by: Huang Rui > > --- > > tools/power/cpupower/utils/helpers/cpuid.c | 13 +++++++++++++ > > 1 file changed, 13 insertions(+) > > > > diff --git a/tools/power/cpupower/utils/helpers/cpuid.c b/tools/power/cpupower/utils/helpers/cpuid.c > > index 72eb43593180..78218c54acca 100644 > > --- a/tools/power/cpupower/utils/helpers/cpuid.c > > +++ b/tools/power/cpupower/utils/helpers/cpuid.c > > @@ -149,6 +149,19 @@ int get_cpu_info(struct cpupower_cpu_info *cpu_info) > > if (ext_cpuid_level >= 0x80000008 && > > cpuid_ebx(0x80000008) & (1 << 4)) > > cpu_info->caps |= CPUPOWER_CAP_AMD_RDPRU; > > + > > + if (cpupower_amd_pstate_enabled(0)) { > > What is the reason for calling this function with cpu id = 0? No specific reason, actually, any cpu id should be ok here. Thanks, Ray > > > > + cpu_info->caps |= CPUPOWER_CAP_AMD_PSTATE; > > + > > + /* > > + * If AMD P-state is enabled, the firmware will treat > > + * AMD P-state function as high priority. > > + */ > > + cpu_info->caps &= ~CPUPOWER_CAP_AMD_CPB; > > + cpu_info->caps &= ~CPUPOWER_CAP_AMD_CPB_MSR; > > + cpu_info->caps &= ~CPUPOWER_CAP_AMD_HW_PSTATE; > > + cpu_info->caps &= ~CPUPOWER_CAP_AMD_PSTATEDEF; > > + } > > } > > > > if (cpu_info->vendor == X86_VENDOR_INTEL) { > > > > thanks, > -- Shuah