[v10,03/12] cpufreq: intel_pstate: use common macro definition for Energy Preference Performance(EPP)
Message ID | 20230106061420.95715-4-perry.yuan@amd.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp669421wrt; Thu, 5 Jan 2023 22:18:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXsf1UR/VHK3i/T11rrYJROMEyms252mkKY08B5wANYEqQKcrAFBwKuvXyUHf7xxoEd4Jn2W X-Received: by 2002:a17:906:260e:b0:7c4:fe3c:cb2a with SMTP id h14-20020a170906260e00b007c4fe3ccb2amr46578769ejc.56.1672985917752; Thu, 05 Jan 2023 22:18:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672985917; cv=pass; d=google.com; s=arc-20160816; b=0+8q4wagHJ2qLizL2eeIYDicvryGYb9yX7QL70M85t5S/dG3i8Sy+QNDaf/hOjQuaD +HkieTPCgazhduTx1oW/CMs3VocTzlv9w2T6/PbOAmP86Gy9a3fvDeiXVi2TjApFPXJk NVAV9m4jB7v6op5P5m+xnFYW40fAGNTaW1MCOcWwDQRyrwY/RWawgbksXhQI0xg2cPN2 M6bLsFNseQJlMro0Bbv1vLvgEqHhVBDkUQBrr0kBys0eYPTwWKegXNbV+Skjkgiwud1q I+XuRdikTJPNIFjBmyLG//5jN07cMR1F1UfOZyOPFw1/4KmajxPra7fxyLm2uZTnR074 HtcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=a2Sht6uI7OzKHznD+Gq4DXDlzXnrn8gqQWBt5fDbDM8=; b=jv9T/v1kXnSDh1pkF9kOu2m031CMUs4YI5WksfZB/adeAl9d1jWVIRdVgAES80pH4Y N0O9afWFXov3XODZIqzd1qPsHIuhbqJve6238OXwl58RPv72bpGOpKZCbPEfIU4DC23u nH+YY9qTiaekpfn/SsRLvtnW5fIe4gsBRdCkah1Vg+MqtJxEW1vkJXR1mF8b9cWJlyAM IGmnNbmnngJclhfN2Fem3aq/A49pnyDgLqbJ5uHp+ypSd1WAheuM7sqfEPYMJP+Ehiq+ 6/tzFZrbP+li13Wh9j/pCDj2ytLNHukT6wz1BI3LrQua4C2hVsmU1lKuD0dfHBbb43FG tcVA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=to5PY2lk; 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 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb42-20020a1709077eaa00b008376c09a3e6si497618ejc.170.2023.01.05.22.18.13; Thu, 05 Jan 2023 22:18:37 -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=to5PY2lk; 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 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 S231888AbjAFGPK (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Fri, 6 Jan 2023 01:15:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231734AbjAFGPB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 6 Jan 2023 01:15:01 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2061.outbound.protection.outlook.com [40.107.243.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 228156E0DC; Thu, 5 Jan 2023 22:14:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TfS4Cq9m1iL6wp82cfsbeJ0NC75HOG2qQ120V54sxacNsIPc+FM+RhM2dncuDYnG2MfoLT9EaBh25KmGZ0MERIDLJYjvJpDFYgjZDMaWLQb7ouMf4XUOAqwXBk9P0zup6g2Xcfq+VxzX5P9MwKsj2KCmTH/3LhZuZEhuso61hv99acvSyOpOVtmMIj/E0pZkz4JQxlaAsXnEY0wVN0Jx3P/87Tv+ijIlFr2X4OSDqITvvtWgKDwlQY4lK4rd0w2V8zPwk/pHW3RZJuC3QPolPlkGXKrvNQngTd6DX6DjkF3LfXpU21oCGwVZ5AVzOqA3trMx6reaJvN/S477qlD2pQ== 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=a2Sht6uI7OzKHznD+Gq4DXDlzXnrn8gqQWBt5fDbDM8=; b=YKCkhviD3YlRa6ZYU6MgoW0i/E6ip1eAyIZ5OxdiArUClutTIZY207gf/uOJIHm4VtM62dnkd9vtm7MwHDllCx+kk1QUoRaCyP/GgQP+BIuQWAk/PnHxC3Qnn6yYsBeDfGWfZRIbd5HyJlkTLoQWUDa8+2eEXvRWzbGqxIbHeeYislUHpuWH25iYdV8Nxz0IidG5MDtQLUSLUroiOIhmpmZBeK66ZD9aGmGZ9mhRF/58ZvXzjc3ji8AQnl52cUK+lxxKQzEsxMXw0hf5wjlc6vOKmtWyG9FOntbQ2NTUGQFH6pnye08uNRDUrl2U2ImsffbsOhIqfTCb9wThIql5zA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com 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=a2Sht6uI7OzKHznD+Gq4DXDlzXnrn8gqQWBt5fDbDM8=; b=to5PY2lkFAKnHWnnfe6DMheyZ4hm5Fz6BOkcAyS1QVchN9/O0lE65b3cwufHHdczJL1mMflHZPi7gFNr+XTOFfbe6KfQeB2Ysel72ugZU0FS334xbl5Mp3svv1BC2iGYG0Cn87enzUq0N5WBnKMdaARdYZSwxf2I73ObV5gaE08= Received: from DM6PR02CA0075.namprd02.prod.outlook.com (2603:10b6:5:1f4::16) by SJ0PR12MB6808.namprd12.prod.outlook.com (2603:10b6:a03:47a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Fri, 6 Jan 2023 06:14:49 +0000 Received: from DS1PEPF0000E633.namprd02.prod.outlook.com (2603:10b6:5:1f4:cafe::2d) by DM6PR02CA0075.outlook.office365.com (2603:10b6:5:1f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.15 via Frontend Transport; Fri, 6 Jan 2023 06:14:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0000E633.mail.protection.outlook.com (10.167.17.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.15 via Frontend Transport; Fri, 6 Jan 2023 06:14:49 +0000 Received: from pyuan-Cloudripper.amd.com (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.2375.34; Fri, 6 Jan 2023 00:14:44 -0600 From: Perry Yuan <perry.yuan@amd.com> To: <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>, <wyes.karny@amd.com>, <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v10 03/12] cpufreq: intel_pstate: use common macro definition for Energy Preference Performance(EPP) Date: Fri, 6 Jan 2023 14:14:11 +0800 Message-ID: <20230106061420.95715-4-perry.yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230106061420.95715-1-perry.yuan@amd.com> References: <20230106061420.95715-1-perry.yuan@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E633:EE_|SJ0PR12MB6808:EE_ X-MS-Office365-Filtering-Correlation-Id: 2565088e-1056-4d5d-e1b1-08daefad5118 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bvrg2e9ZtjNpZASKwXlmV/iGwcPzHQ/Mde193civ7t1S6aIU7Y1606PhZkWvHfBWhvwj+drHYBcXihNs3pV98YPAiy9PKWilheLBRYs0nhPgYo6GeNV5sF+8ktgfPCAH/RiylwG1gVnvS//6fNEmX2wCm4lOSejaeA4a/iga/52eSiqWr09gJsOtCrN/1RMjDV8/8vdklsArJFHr0JEHPkFJoxBqqXlE84KkRAloC+xnzwYtZe2nFDD6BJNO/k591cCWhaO+S9DOX0Exc7vPaThdUIWtw0v3gB+IseonphTVTJbRXl8SRJNXyEaRkqxQ4alwR7b4kfvt+AojNZhqu6v/c8JCLK76boUT168ONEoMUZU422F5vEB6c7+x2EyTI9W320XpzXLKMIheD4zOwn6j3/twayO3359fJcCH7es6oCzaf1fD7WGyTR2+QkFglvg5dUXSN6J4RGeJjhDuar7EBiNEyaxYOSf8igMjd94cH88htos4Gu468t3tgiOZUEZ+02ZO+VZvePThkpy5/Kv02+KYdGuSbX7EM8SqHvNprEeC25LeIawmVpbwO2IgN3kFjfne7tfgkpbTltXxvDdqfE6P8EI4fkHWMriqm2VQzJEVxWSvc5VFaYaZEQpKonxs4FCiHQyC3aHbItVecL7UdQQnWvgW9W4N8EVx+DmgJoBR4pdpa80xz3o1032N7IV3lSZqM/axMpgvsNFbwHj/ryxo+Z0+m28XsbGA0o0= 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:(13230022)(4636009)(39860400002)(346002)(376002)(396003)(136003)(451199015)(46966006)(40470700004)(36840700001)(7696005)(186003)(40460700003)(26005)(40480700001)(36756003)(478600001)(16526019)(86362001)(41300700001)(316002)(336012)(81166007)(82740400003)(426003)(36860700001)(356005)(5660300002)(2906002)(44832011)(47076005)(110136005)(83380400001)(8936002)(8676002)(54906003)(1076003)(2616005)(82310400005)(70586007)(4326008)(70206006)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2023 06:14:49.4531 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2565088e-1056-4d5d-e1b1-08daefad5118 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: DS1PEPF0000E633.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6808 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754252881376988576?= X-GMAIL-MSGID: =?utf-8?q?1754252881376988576?= |
Series |
Implement AMD Pstate EPP Driver
|
|
Commit Message
Yuan, Perry
Jan. 6, 2023, 6:14 a.m. UTC
make the energy preference performance strings and profiles using one
common header for intel_pstate driver, then the amd_pstate epp driver can
use the common header as well. This will simpify the intel_pstate and
amd_pstate driver.
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
---
drivers/acpi/cppc_acpi.c | 29 +++++++++++++++++++++++++++
drivers/cpufreq/intel_pstate.c | 36 ----------------------------------
include/acpi/cppc_acpi.h | 10 ++++++++++
3 files changed, 39 insertions(+), 36 deletions(-)
Comments
Hi Perry, I love your patch! Yet something to improve: [auto build test ERROR on rafael-pm/linux-next] [also build test ERROR on linus/master v6.2-rc2 next-20230106] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Perry-Yuan/ACPI-CPPC-Add-AMD-pstate-energy-performance-preference-cppc-control/20230106-141924 base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next patch link: https://lore.kernel.org/r/20230106061420.95715-4-perry.yuan%40amd.com patch subject: [PATCH v10 03/12] cpufreq: intel_pstate: use common macro definition for Energy Preference Performance(EPP) config: x86_64-randconfig-a004 compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/f43a51c9a7f805b5fd089878fafe7cf9b06b68f0 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Perry-Yuan/ACPI-CPPC-Add-AMD-pstate-energy-performance-preference-cppc-control/20230106-141924 git checkout f43a51c9a7f805b5fd089878fafe7cf9b06b68f0 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 olddefconfig make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): ld: vmlinux.o: in function `intel_pstate_update_epp_defaults': >> drivers/cpufreq/intel_pstate.c:1629: undefined reference to `epp_values' >> ld: drivers/cpufreq/intel_pstate.c:1629: undefined reference to `epp_values' ld: drivers/cpufreq/intel_pstate.c:1640: undefined reference to `epp_values' >> ld: drivers/cpufreq/intel_pstate.c:1629: undefined reference to `epp_values' ld: vmlinux.o: in function `show_energy_performance_preference': >> drivers/cpufreq/intel_pstate.c:812: undefined reference to `energy_perf_strings' >> ld: drivers/cpufreq/intel_pstate.c:812: undefined reference to `energy_perf_strings' ld: vmlinux.o: in function `intel_pstate_get_energy_pref_index': drivers/cpufreq/intel_pstate.c:628: undefined reference to `epp_values' ld: drivers/cpufreq/intel_pstate.c:628: undefined reference to `epp_values' ld: drivers/cpufreq/intel_pstate.c:630: undefined reference to `epp_values' ld: drivers/cpufreq/intel_pstate.c:630: undefined reference to `epp_values' ld: drivers/cpufreq/intel_pstate.c:632: undefined reference to `epp_values' ld: vmlinux.o:drivers/cpufreq/intel_pstate.c:632: more undefined references to `epp_values' follow ld: vmlinux.o: in function `show_energy_performance_available_preferences': drivers/cpufreq/intel_pstate.c:721: undefined reference to `energy_perf_strings' ld: drivers/cpufreq/intel_pstate.c:721: undefined reference to `energy_perf_strings' ld: drivers/cpufreq/intel_pstate.c:721: undefined reference to `energy_perf_strings' ld: drivers/cpufreq/intel_pstate.c:721: undefined reference to `energy_perf_strings' ld: drivers/cpufreq/intel_pstate.c:721: undefined reference to `energy_perf_strings' ld: vmlinux.o:drivers/cpufreq/intel_pstate.c:746: more undefined references to `energy_perf_strings' follow ld: vmlinux.o: in function `store_energy_performance_preference': drivers/cpufreq/intel_pstate.c:781: undefined reference to `epp_values' ld: drivers/cpufreq/intel_pstate.c:781: undefined reference to `epp_values' ld: vmlinux.o: in function `intel_pstate_set_energy_pref_index': drivers/cpufreq/intel_pstate.c:695: undefined reference to `epp_values' ld: drivers/cpufreq/intel_pstate.c:695: undefined reference to `epp_values' ld: vmlinux.o: in function `intel_pstate_init': drivers/cpufreq/intel_pstate.c:3421: undefined reference to `epp_values' ld: vmlinux.o:drivers/cpufreq/intel_pstate.c:3421: more undefined references to `epp_values' follow vim +1629 drivers/cpufreq/intel_pstate.c 57577c996d731c Srinivas Pandruvada 2021-09-28 1620 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1621 static void intel_pstate_update_epp_defaults(struct cpudata *cpudata) 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1622 { 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1623 cpudata->epp_default = intel_pstate_get_epp(cpudata, 0); 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1624 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1625 /* 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1626 * If this CPU gen doesn't call for change in balance_perf 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1627 * EPP return. 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1628 */ 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 @1629 if (epp_values[EPP_INDEX_BALANCE_PERFORMANCE] == HWP_EPP_BALANCE_PERFORMANCE) 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1630 return; 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1631 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1632 /* 21cdb6c18f85fe Srinivas Pandruvada 2022-10-27 1633 * If the EPP is set by firmware, which means that firmware enabled HWP 21cdb6c18f85fe Srinivas Pandruvada 2022-10-27 1634 * - Is equal or less than 0x80 (default balance_perf EPP) 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1635 * - But less performance oriented than performance EPP 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1636 * then use this as new balance_perf EPP. 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1637 */ 21cdb6c18f85fe Srinivas Pandruvada 2022-10-27 1638 if (hwp_forced && cpudata->epp_default <= HWP_EPP_BALANCE_PERFORMANCE && 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1639 cpudata->epp_default > HWP_EPP_PERFORMANCE) { 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1640 epp_values[EPP_INDEX_BALANCE_PERFORMANCE] = cpudata->epp_default; 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1641 return; 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1642 } 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1643 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1644 /* 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1645 * Use hard coded value per gen to update the balance_perf 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1646 * and default EPP. 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1647 */ 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1648 cpudata->epp_default = epp_values[EPP_INDEX_BALANCE_PERFORMANCE]; 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1649 intel_pstate_set_epp(cpudata, cpudata->epp_default); 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1650 } 3d13058ed2a6d0 Srinivas Pandruvada 2022-03-10 1651
Hi Perry, I love your patch! Yet something to improve: [auto build test ERROR on rafael-pm/linux-next] [also build test ERROR on linus/master v6.2-rc2 next-20230106] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Perry-Yuan/ACPI-CPPC-Add-AMD-pstate-energy-performance-preference-cppc-control/20230106-141924 base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next patch link: https://lore.kernel.org/r/20230106061420.95715-4-perry.yuan%40amd.com patch subject: [PATCH v10 03/12] cpufreq: intel_pstate: use common macro definition for Energy Preference Performance(EPP) config: i386-randconfig-a002 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/f43a51c9a7f805b5fd089878fafe7cf9b06b68f0 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Perry-Yuan/ACPI-CPPC-Add-AMD-pstate-energy-performance-preference-cppc-control/20230106-141924 git checkout f43a51c9a7f805b5fd089878fafe7cf9b06b68f0 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): >> ld.lld: error: undefined symbol: epp_values >>> referenced by intel_pstate.c:628 (drivers/cpufreq/intel_pstate.c:628) >>> drivers/cpufreq/intel_pstate.o:(show_energy_performance_preference) in archive vmlinux.a >>> referenced by intel_pstate.c:630 (drivers/cpufreq/intel_pstate.c:630) >>> drivers/cpufreq/intel_pstate.o:(show_energy_performance_preference) in archive vmlinux.a >>> referenced by intel_pstate.c:632 (drivers/cpufreq/intel_pstate.c:632) >>> drivers/cpufreq/intel_pstate.o:(show_energy_performance_preference) in archive vmlinux.a >>> referenced 6 more times -- >> ld.lld: error: undefined symbol: energy_perf_strings >>> referenced by intel_pstate.c:812 (drivers/cpufreq/intel_pstate.c:812) >>> drivers/cpufreq/intel_pstate.o:(show_energy_performance_preference) in archive vmlinux.a >>> referenced by intel_pstate.c:746 (drivers/cpufreq/intel_pstate.c:746) >>> drivers/cpufreq/intel_pstate.o:(store_energy_performance_preference) in archive vmlinux.a >>> referenced by intel_pstate.c:721 (drivers/cpufreq/intel_pstate.c:721) >>> drivers/cpufreq/intel_pstate.o:(show_energy_performance_available_preferences) in archive vmlinux.a >>> referenced 1 more times
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 0ce6c55a76ca..c7aa190ec2d2 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -42,6 +42,35 @@ #include <acpi/cppc_acpi.h> +/* + * EPP/EPB display strings corresponding to EPP index in the + * energy_perf_strings[] + * index String + *------------------------------------- + * 0 default + * 1 performance + * 2 balance_performance + * 3 balance_power + * 4 power + */ + +const char * const energy_perf_strings[] = { + [EPP_INDEX_DEFAULT] = "default", + [EPP_INDEX_PERFORMANCE] = "performance", + [EPP_INDEX_BALANCE_PERFORMANCE] = "balance_performance", + [EPP_INDEX_BALANCE_POWERSAVE] = "balance_power", + [EPP_INDEX_POWERSAVE] = "power", + NULL +}; + +unsigned int epp_values[] = { + [EPP_INDEX_DEFAULT] = 0, /* Unused index */ + [EPP_INDEX_PERFORMANCE] = HWP_EPP_PERFORMANCE, + [EPP_INDEX_BALANCE_PERFORMANCE] = HWP_EPP_BALANCE_PERFORMANCE, + [EPP_INDEX_BALANCE_POWERSAVE] = HWP_EPP_BALANCE_POWERSAVE, + [EPP_INDEX_POWERSAVE] = HWP_EPP_POWERSAVE, +}; + struct cppc_pcc_data { struct pcc_mbox_chan *pcc_channel; void __iomem *pcc_comm_addr; diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index ad9be31753b6..01431e279be6 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -628,42 +628,6 @@ static int intel_pstate_set_epb(int cpu, s16 pref) return 0; } -/* - * EPP/EPB display strings corresponding to EPP index in the - * energy_perf_strings[] - * index String - *------------------------------------- - * 0 default - * 1 performance - * 2 balance_performance - * 3 balance_power - * 4 power - */ - -enum energy_perf_value_index { - EPP_INDEX_DEFAULT = 0, - EPP_INDEX_PERFORMANCE, - EPP_INDEX_BALANCE_PERFORMANCE, - EPP_INDEX_BALANCE_POWERSAVE, - EPP_INDEX_POWERSAVE, -}; - -static const char * const energy_perf_strings[] = { - [EPP_INDEX_DEFAULT] = "default", - [EPP_INDEX_PERFORMANCE] = "performance", - [EPP_INDEX_BALANCE_PERFORMANCE] = "balance_performance", - [EPP_INDEX_BALANCE_POWERSAVE] = "balance_power", - [EPP_INDEX_POWERSAVE] = "power", - NULL -}; -static unsigned int epp_values[] = { - [EPP_INDEX_DEFAULT] = 0, /* Unused index */ - [EPP_INDEX_PERFORMANCE] = HWP_EPP_PERFORMANCE, - [EPP_INDEX_BALANCE_PERFORMANCE] = HWP_EPP_BALANCE_PERFORMANCE, - [EPP_INDEX_BALANCE_POWERSAVE] = HWP_EPP_BALANCE_POWERSAVE, - [EPP_INDEX_POWERSAVE] = HWP_EPP_POWERSAVE, -}; - static int intel_pstate_get_energy_pref_index(struct cpudata *cpu_data, int *raw_epp) { s16 epp; diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h index 6b487a5bd638..891e5add0e49 100644 --- a/include/acpi/cppc_acpi.h +++ b/include/acpi/cppc_acpi.h @@ -135,6 +135,16 @@ struct cppc_cpudata { cpumask_var_t shared_cpu_map; }; +enum energy_perf_value_index { + EPP_INDEX_DEFAULT = 0, + EPP_INDEX_PERFORMANCE, + EPP_INDEX_BALANCE_PERFORMANCE, + EPP_INDEX_BALANCE_POWERSAVE, + EPP_INDEX_POWERSAVE, +}; +extern const char * const energy_perf_strings[]; +extern unsigned int epp_values[]; + #ifdef CONFIG_ACPI_CPPC_LIB extern int cppc_get_desired_perf(int cpunum, u64 *desired_perf); extern int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf);