From patchwork Thu Nov 17 02:49:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 21387 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp181892wrr; Wed, 16 Nov 2022 18:53:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf4jxEv6IodcCjUCiqSCVRDwKWiCsfL5RcpUcBvDOPGroAlx9s5Y8skb4Qrl660ENB8c49Zj X-Received: by 2002:a17:90a:df0e:b0:20b:22fb:2ef with SMTP id gp14-20020a17090adf0e00b0020b22fb02efmr6766362pjb.158.1668653590487; Wed, 16 Nov 2022 18:53:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668653590; cv=pass; d=google.com; s=arc-20160816; b=CzQQbwyFSdW2Ng+qoFspN3BV24cRJCHKmZkRQMv/H3lg266rvxHkrBrwPFadHV5wHK gdAjDEyLdd1bQFCwKm71uV9vX2ni2Dz0zyG4F6pNC5XSb1KAPxaGvQDc0gMl67eVaZGv udwpzxBhr8s1Jv5gV6+hWaigHI6j1GoqY0FNdQuwCDC6h212cZiCJLWCTrIvNC1ef3xn KB40VVIaOh/MA0hUNt1nsPNrJYm8wG8wPbOMySEsYMlI0s8GcgQpNISpp+PDpKDQOiNl /TuKGsawWzVej8ilEHIv5fuUGrnq3gSxDVr7JXnnfHF8/zqkW+QjdzubvGkrz3D56BW/ Z8yQ== 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=c4vdABTnmomCtasCUx+mcw49cRlQDJP0SSFAHernidE=; b=RA7tat5ZuBnxq8eZtTIZ414+hv1S3poA8fWj1NJ+D69CD9cz/zd/wOTb1saSXAX2+t oGsAh9GvsE5LIxAM0ozrJw9kw7Pqkpkw3FcIk7RCnICwoYM5MlzV8h3l5ZWC4BOChRaR JD37JgnpPl2kjqXtcFGiNYu3wlX0B2BxtIShnEO4tNDylo6GdNFkbyGFILD5Qriljd27 LjUo/cKCFqSVZ2ojUHOk96qLCV84HaKJuBbiFBnmQ6EkReDm7tIxzw1q/skuQGYQ2wIK JO93n0G9LdKXcOGNGdG20Cpi0V5x713/y7klrA523HaYBtAyxSOl/WQo1/FkxL74/FIj QNTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=tXK6ASfD; 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 s132-20020a632c8a000000b004429ecbda9fsi16039613pgs.39.2022.11.16.18.52.57; Wed, 16 Nov 2022 18:53:10 -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=tXK6ASfD; 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 S234454AbiKQCwD (ORCPT + 99 others); Wed, 16 Nov 2022 21:52:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbiKQCwB (ORCPT ); Wed, 16 Nov 2022 21:52:01 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2080.outbound.protection.outlook.com [40.107.223.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF96E43AD6; Wed, 16 Nov 2022 18:51:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ed3LngrZYFrJSorwgAJjs1rwi7Z/6xcBernnutv0bLnqSwKT2SXq6krCbGA17nGR9NAFsHT1DP5jmec1s6vTD8I6E3G1lzgzMR62FnR6npUUzofxHRpK516oNY7LktpixlLiNr+CwACW8Et+dgU6hA8ZC+wTV2QZT7bfdsIVO0ELYo1y7WLsJqO1T60tCoBHEoxOHofhlSd4Exn/Pq61Ib+biUHTQe58cA3vbbaNvwCQ/1s3X4J06CS2nh6pb+gpiPjjohuDLZE+V/frRixolC+XqDnG3a68CDcwxKTvQA/0KqsKwn7BAIigb1m3yYYUiQz0CcTsDTvehK4XNnsVVA== 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=c4vdABTnmomCtasCUx+mcw49cRlQDJP0SSFAHernidE=; b=iAxDXjRfv9vVIlU/VvgzDLv4PEsxEAL9kaK9HVGxaqoKNDdnEpim5mipMkgbig8jeAS6Ztm/bwuCRz4gTeF7Dx4jPU73Xrck2IOs17iGJy3Ohg2o+1LpvcFyHHTBqTEKSbvLMpoBTUFXMcuj3HKwZz3f54p5ks6E8fWqWszc/hBCiBNsYUigwUCGk12vDIBx6IyFzQGwBtF+FRUM/ZVWkhzYv04cF1t8OgwVeyYJMtaue/VWL0xCSl5b2FBb3rOCATID7Edl4XOXHUNyg3/yQFBXireaOtxcLQUNSamvFW9B9Pkzy3w0pbUFrFkR2R7DzglU4vBeKZfbfAP1NLFA0w== 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=c4vdABTnmomCtasCUx+mcw49cRlQDJP0SSFAHernidE=; b=tXK6ASfDjDWLotsE7iiA3q1zXrbu61QxA1VNfpKYsOZVhhrBUfOzQwqgq/raENNh9qNlUGGiM9ZyWeAZ/Dl7iq5LwEik+SL3tHrhr+qwTuWixK8rZ6MxyATkBp7+CiFPCFkG5Vt0iDmZWBG5fGRI2ywZpQItlNjsWJlHQgaqhY4= Received: from BN0PR02CA0031.namprd02.prod.outlook.com (2603:10b6:408:e5::6) by BL1PR12MB5319.namprd12.prod.outlook.com (2603:10b6:208:317::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.18; Thu, 17 Nov 2022 02:51:56 +0000 Received: from BL02EPF0000EE3E.namprd05.prod.outlook.com (2603:10b6:408:e5:cafe::fc) by BN0PR02CA0031.outlook.office365.com (2603:10b6:408:e5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.20 via Frontend Transport; Thu, 17 Nov 2022 02:51:56 +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 BL02EPF0000EE3E.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.11 via Frontend Transport; Thu, 17 Nov 2022 02:51:55 +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; Wed, 16 Nov 2022 20:51:08 -0600 From: Perry Yuan To: , , , CC: , , , , , , , , , , , , Perry Yuan Subject: [PATCH 1/5] cpufreq: amd-pstate: cpufreq: amd-pstate: reset MSR_AMD_PERF_CTL register at init Date: Thu, 17 Nov 2022 10:49:51 +0800 Message-ID: <20221117024955.3319484-2-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117024955.3319484-1-Perry.Yuan@amd.com> References: <20221117024955.3319484-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: BL02EPF0000EE3E:EE_|BL1PR12MB5319:EE_ X-MS-Office365-Filtering-Correlation-Id: 20f40f32-b28b-46c5-fc3b-08dac846b072 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6xlsKiyN6Jk83QcjboapZ2KPWgfsIki0xleXjWAPATvLcQYCDoZTsCqHvhpR3ayE/7AxyeGCH8RJnpJ06TJH2acAtuMeYEOGK/da01o8fwn9uIkMH2lbV3fv5J/OtoyyWFb4Il9z+ijJ+wcS6ffnMaYcvMTU/JJdM0ykG53JvIr4qLMKdpJORrmEASvAi0aXr02WNnoyPGO7HRokGG7iH4NaLuwhQtNb7MshWUzYcZrHhJxXIctLjOD0deU60YKy5Ew+gnbwf9e7vMxUROc/+Im35STr9IIgcz/afkacLHr/t8+8TDk7Ss5jQz/XjhjebtFw3DuR1YWHST2mVUWnR5uoFf4f6R4cwsiSMUgjTulomTicWJtxdx6VtSHBrJW5SLnkSL7PFYqFcos+ENEbRavC9S9swS9sZOpvWh86yn3b+kgI3JkhJViJtvjq0FSNKmImLRKjKO5AvG0Q9fBQNNpZouUf0Vh60z6qCrX6r6VX7BsmsjncVEJ/b/0NyYC7V+dKANCRLDZKYYlL8JBAxzOFQBO2EBOxzenYS1RAGnE05JRxh6J8hTGsY7TAezp6kD6XFtlR4SQw3F9lmdEyLCN9ki8AfNFfqWAlLUgn9vg/lNbJ/M0T7huSrHMOVewGZpousoaDsRXBUmH8IwwNyzq+Rx88XQ1P1Z2Wbn0oCnp6plshZmfgrfaGwXT9v7xMtPNmjr/PjddOru6qB7XZQp545BP9X6fImnYPIZN+OsbSUhk6aG4xEJhI/Fsd/KDjmpm//KKwEO+P56+A2bsvHOvAinM4HqixmxAtZv/NlzoRzjIYyuEMCFPAwWwUmmHd2262eBjP5bblf4zObVuRwA== 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)(396003)(39860400002)(376002)(346002)(136003)(451199015)(40470700004)(46966006)(36840700001)(66899015)(82740400003)(5660300002)(81166007)(356005)(2906002)(40480700001)(8936002)(4326008)(70586007)(8676002)(70206006)(41300700001)(36756003)(26005)(47076005)(16526019)(7696005)(6666004)(86362001)(82310400005)(336012)(2616005)(186003)(36860700001)(426003)(1076003)(110136005)(54906003)(83380400001)(478600001)(40460700003)(6636002)(316002)(2101003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2022 02:51:55.9469 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20f40f32-b28b-46c5-fc3b-08dac846b072 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: BL02EPF0000EE3E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5319 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749710106845486680?= X-GMAIL-MSGID: =?utf-8?q?1749710106845486680?= From: Wyes Karny MSR_AMD_PERF_CTL is guaranteed to be 0 on a cold boot. However, on a kexec boot, for instance, it may have a non-zero value (if the cpu was in a non-P0 Pstate). In such cases, the cores with non-P0 Pstates at boot will never be pushed to P0, let alone boost frequencies. Kexec is a common workflow for reboot on Linux and this creates a regression in performance. Fix it by explicitly setting the MSR_AMD_PERF_CTL to 0 during amd_pstate driver init. Cc: stable@vger.kernel.org Signed-off-by: Wyes Karny Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy Tested-by: Wyes Karny --- drivers/cpufreq/amd-pstate.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index ace7d50cf2ac..d844c6f97caf 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -424,12 +424,22 @@ static void amd_pstate_boost_init(struct amd_cpudata *cpudata) amd_pstate_driver.boost_enabled = true; } +static void amd_perf_ctl_reset(unsigned int cpu) +{ + wrmsrl_on_cpu(cpu, MSR_AMD_PERF_CTL, 0); +} + static int amd_pstate_cpu_init(struct cpufreq_policy *policy) { int min_freq, max_freq, nominal_freq, lowest_nonlinear_freq, ret; struct device *dev; struct amd_cpudata *cpudata; + /* + * Resetting PERF_CTL_MSR will put the CPU in P0 frequency, + * which is ideal for initialization process. + */ + amd_perf_ctl_reset(policy->cpu); dev = get_cpu_device(policy->cpu); if (!dev) return -ENODEV; From patchwork Thu Nov 17 02:49:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 21389 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp182033wrr; Wed, 16 Nov 2022 18:53:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf6gg0zmGCi0NjpKg4MlwbdXIsaWFgvviDEyhlAQpqM8Bu4MuSmJPmRq05EAt3Fx7Oa3Ox6L X-Received: by 2002:a17:906:d78e:b0:7ae:c0b:a25e with SMTP id pj14-20020a170906d78e00b007ae0c0ba25emr477795ejb.603.1668653630367; Wed, 16 Nov 2022 18:53:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668653630; cv=pass; d=google.com; s=arc-20160816; b=Sn8WVlDhildsGM0p9d2FQgPfXCD7HRorLu+zu3/1HR0Ld5f3iF/Sqt0z9+zZb+YFT6 LSl3WTRmR5Z6O5g2Jtt0VVgeVi4FVO5UX7idSu9cRXYsmjhxLzlqr9KR6nf9qn9ZupwN 7L56Ghtn2Rx7MvQVEkaaoxjccuresW8qemwcaF4/WcTTKnKsn8gJHOAIdvAtjDIDs3nK sRvxUP51yuk6RmasrrlWBC2iobGF63wmQSNurpttJGQmxlVcrMZBXVHyTlPm6plnY8Bt 4hT4KttD2huBzEOs0tOd5hWjHaoCssaVtC1dMI1g7Kg97+sAeTs0mLPCziEJF7lknZdU OQVw== 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=7OiiB0U9F02X9T48xdt0/E/wPxXK4V3G3If9b/U6C14=; b=gl6xxvxZSZQQqK8LO3kGZhaEc1nvgM0BZ1OMDiKprDOBTRZl5MVpFlTgQKEvRWt9mR tBETKkYHjDGuGSPfvpsLGnsaGMksti2ODQYjHS9485fv47NROQgXgjF5Dw5mx3p1hLdm 5BoJybqvIrbLeaj8zyYLlAIOe3B6o4LXQCvL3Pqu1/Iez+WbBq42Wn7qbd05ei+suG4I VmDmjSyoRYmV7ZBeG2/HA2HAWZd9vv5gcglcsv8p3jxnaKIz0HdDShnTb3DXcxNfS1ww SUyVkxEbAm3I1HpRwPyBTx5UdQz6D+AijapmqSm7/hn2gdr8+N2kFH7gDNBzjTyiZsHB WwMg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=tUFht8ZP; 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 hd39-20020a17090796a700b007acf3aed468si16181787ejc.786.2022.11.16.18.53.27; Wed, 16 Nov 2022 18:53:50 -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=tUFht8ZP; 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 S238962AbiKQCwN (ORCPT + 99 others); Wed, 16 Nov 2022 21:52:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234662AbiKQCwI (ORCPT ); Wed, 16 Nov 2022 21:52:08 -0500 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2072.outbound.protection.outlook.com [40.107.212.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 982C045A24; Wed, 16 Nov 2022 18:52:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Whe8+pJLVixayToZca7mCfWVNLXr4exBSmtfhOGAuEylHqDn1DLgp53D5Hi6xoBCJ77OI6fzI31Qc+Z2WwlrOK93RtrLYA8uTlFQkFEkwmoTdR4FQlfExAXRYco/IzsZFAeZn7b3l8NIXyVxbzUyWu0v0qQmZ1/3ZpqnyQjZa/19E4wM5u25EGOPzMbVSUJhFvw5TK1KUYulMZZfYXA/HCU1t5fpI5g6hN1lCGUutgAlJauN+Fq0kzbw9VJCYvrGNphBabQeYYkVsn2Ud8lvFeNjJ+AtOyou+BN0uSyooNLooRmQepngFaWJij7u2K9KD+/B9xlZgl+7ZeA3lfmnhA== 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=7OiiB0U9F02X9T48xdt0/E/wPxXK4V3G3If9b/U6C14=; b=Sspsg5Pb6ljXtZqTWU+2G107RrPmJ0vTW7VgcfDUADFbTFUVqpOsThyppSQdgqs+8XgydBbWweKz8OqC4AAw3yQmsdwUn1vua0bq3WHWVnJHQwjSBZaayD/S1R7nDSdVN/GxgoQOMFtTuVHCpKG2mKhm4eucMiVtzOvu3Y0fBi/Ld7CWFnN1J5sEDAVm/olEqcQrU/XnLMNc1QCC+ClYnLoaJl64Bpu3BxchCkrctIBPva++vPHuZ9hEABo4SkYAI085vMBaNz29A9yp8frqFNJbfNo5Lb/XUGt6o7CKHUjtyphoo2utH1Kjw7idFM6FOMBB8Akt7uT+w6U9zR7XNw== 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=7OiiB0U9F02X9T48xdt0/E/wPxXK4V3G3If9b/U6C14=; b=tUFht8ZPeaQ9ExACWlWKCcp//eYRXpOt98HRNpIi0PfV3p1rNDsyU+hc0DIq0MOiS0YFcW7mmUseUIivnycF/mwQol8ztUzrIfvmc1chixgUjFUuPtxRuj3yjQ/AHWJ2jeTtDawXHX6VrLf6BPiguxNcdzgQUK8/Ir55RFiAMOY= Received: from BL1PR13CA0133.namprd13.prod.outlook.com (2603:10b6:208:2bb::18) by PH7PR12MB7116.namprd12.prod.outlook.com (2603:10b6:510:1ef::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.19; Thu, 17 Nov 2022 02:51:59 +0000 Received: from BL02EPF0000EE3D.namprd05.prod.outlook.com (2603:10b6:208:2bb:cafe::47) by BL1PR13CA0133.outlook.office365.com (2603:10b6:208:2bb::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17 via Frontend Transport; Thu, 17 Nov 2022 02:51:59 +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 BL02EPF0000EE3D.mail.protection.outlook.com (10.167.241.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.11 via Frontend Transport; Thu, 17 Nov 2022 02:51:57 +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; Wed, 16 Nov 2022 20:51:41 -0600 From: Perry Yuan To: , , , CC: , , , , , , , , , , , Perry Yuan Subject: [PATCH 2/5] cpufreq: amd-pstate: change amd-pstate driver to be built-in type Date: Thu, 17 Nov 2022 10:49:52 +0800 Message-ID: <20221117024955.3319484-3-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117024955.3319484-1-Perry.Yuan@amd.com> References: <20221117024955.3319484-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: BL02EPF0000EE3D:EE_|PH7PR12MB7116:EE_ X-MS-Office365-Filtering-Correlation-Id: c5d12f36-51f2-4159-348e-08dac846b16c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k1IM0MS3QcpBFuk+NFU15PBOcZa1e/RE3LMMQCt7ivZ78J5gchNVXvH7Z1PXvZunibDL8XUoK6vuAFrfVhGZKEXFV8JRliguanSBsX/3ZWeCmIgALwodhodqijp7o7mlTISDC6rCXsf4ii9oyuMOIa7jR35FQU+ff3417D1ElL7dpXUS+yuB1kDMi6dz0/pzAa/jdzUCx6rIp5NiDsxn+Ghf54OLucUYX8IDl+3Pqcpc3reibHfj5PieF2LYfocbEjLerY9sQxjSOx54A0VtWfKA4p3JRymfO4/nPH9ljqlb9CcRimFifnk7yV/pogckCBZOCpMmNMukq/i0gTyRApCBEh5sDaQwHUy3yENFlOhfxGzS5UIK+LxNccRMR9OfvEA+0G0AatXuxmEL/7O9lHKK0Ix4y+FaYuOAkwT0/ZoCLsOF/6U10fUiRFGJHEK/h8mGecQh8xKBJfCDKnmrYFXYqp6ysHJAxyhzFKG+fgrChFUMTsQInmmzRI6dYQUax2MWqpe3kNUPBNUh944K1L29vSfCuEf7KReES4BBQvpRjWpdykgyHTLtoQoMUDnoWCu7V26dcgzhZOrQn3a2JJfIamCDG7lUfN9+lV8P85vtsNqek8nVCyvx2ydEpC+AjTBObI9BN9561Zt8ciTO/UBRnpY4OEAhhueL+NJLJfEMPKNqnRYqIiRrYDAYMmrv7GtoynKmZ8gCbVhghDIc6fGEVrx2MvAWpn8d0LzI9XH8JmUKj3dEmaBvp8hZwhVM7jxak91qOG1Yl9vZS/Wk/xWxLF6xZj2Gv5/Wt+HKy50UGKRFeP1H33Y+ByYDWNvjpFxiKtI6l7aMxBUQ/mblLw== 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)(376002)(396003)(346002)(39860400002)(136003)(451199015)(40470700004)(36840700001)(46966006)(40480700001)(5660300002)(70586007)(70206006)(8936002)(41300700001)(86362001)(356005)(81166007)(110136005)(2616005)(316002)(82740400003)(2906002)(36756003)(4326008)(16526019)(426003)(6666004)(6636002)(54906003)(336012)(186003)(47076005)(1076003)(478600001)(8676002)(7696005)(82310400005)(26005)(36860700001)(83380400001)(40460700003)(36900700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2022 02:51:57.5801 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5d12f36-51f2-4159-348e-08dac846b16c 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: BL02EPF0000EE3D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7116 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749710149180340467?= X-GMAIL-MSGID: =?utf-8?q?1749710149180340467?= Currently when the amd-pstate and acpi_cpufreq are both built into kernel as module driver, amd-pstate will not be loaded by default in this case. Change amd-pstate driver as built-in type, it will resolve the loading sequence problem to allow user to make amd-pstate driver as the default cpufreq scaling driver. Fixes: ec437d71db77 ("cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors") Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy Tested-by: Wyes Karny --- drivers/cpufreq/Kconfig.x86 | 2 +- drivers/cpufreq/amd-pstate.c | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86 index 310779b07daf..00476e94db90 100644 --- a/drivers/cpufreq/Kconfig.x86 +++ b/drivers/cpufreq/Kconfig.x86 @@ -35,7 +35,7 @@ config X86_PCC_CPUFREQ If in doubt, say N. config X86_AMD_PSTATE - tristate "AMD Processor P-State driver" + bool "AMD Processor P-State driver" depends on X86 && ACPI select ACPI_PROCESSOR select ACPI_CPPC_LIB if X86_64 diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index d844c6f97caf..701f49d6d240 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -663,16 +663,7 @@ static int __init amd_pstate_init(void) return ret; } - -static void __exit amd_pstate_exit(void) -{ - cpufreq_unregister_driver(&amd_pstate_driver); - - amd_pstate_enable(false); -} - -module_init(amd_pstate_init); -module_exit(amd_pstate_exit); +device_initcall(amd_pstate_init); MODULE_AUTHOR("Huang Rui "); MODULE_DESCRIPTION("AMD Processor P-state Frequency Driver"); From patchwork Thu Nov 17 02:49:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 21388 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp182012wrr; Wed, 16 Nov 2022 18:53:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf6psPCnvy2mWFZ4g4sYBKApxsbotY120Ado7MRFotUm7OMbA2a4tJE2WeHC9j5OhShq9MUa X-Received: by 2002:a17:907:c016:b0:7a4:98cc:7c8e with SMTP id ss22-20020a170907c01600b007a498cc7c8emr563471ejc.48.1668653622377; Wed, 16 Nov 2022 18:53:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668653622; cv=pass; d=google.com; s=arc-20160816; b=i/s23eNE6kstdY7HQoQjYngD10+SHLAbkEf5LEMdWZTfzfdewSm6Ry2Yo+zncxKh4b 6CtFWN8jrMyflNWOc1psEaVxmFwQqZu4ZqWLXQKDvUSjCtdklca7sFCApecD9/CjpJNY 6rzK6eQKvGnPkfP6XNZQGnD8Ey8FTFnQ07FC9benveh89C2xCHVde9wMLB5B0IiHz973 D6hYmMNXp2+FetShSDunDyWDjsgL4DtZp278fWjh1H/YU5UmfmxQINOYyb15UdXdJr9K +whjBIO1Q84LS1ut/lwoZyd7U0/LhBjNvPkt0GWiUv5yPZum/7JxigZ8dVwhGzG38Wbc HTFQ== 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=OcSIU8qAOy6ZsOorOZuWzhi2F18NrsiwjaSJz4IC7pg=; b=VJ44z6avn6N3aCvLW3fMtrPkow5+kVknBl88024WLwItJD+xIVb/ZZMRi6uZ+5+rNA f9JEsjxEnzoia7liPMBxJq9Qnj3YuPRjoKSgabZ8d1jpbFV9sdJJ/Ne6dvxlDFvmmcfo xhb0SBxwV/3AxtfmuebNi/FHFdoBPPyuzOet+XcdX7RD7duwp/gFpaotppf7fPvcdez9 p6gjlvE2bbJkFO55zGdZ7hBOidNgxNYWASNQ6ERTllIr8CPDHpzRwnM8xpgR6wykdjSD 73AhVzOSczFFuChD9LDjIxyeDhtJH4H28sym/Xwgh7byfZYTmbPvZqQ+tl+0x/8tO8eQ Nl9g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=H7Bzq28b; 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 hd10-20020a170907968a00b007ae199ea55asi10899352ejc.817.2022.11.16.18.53.19; Wed, 16 Nov 2022 18:53:42 -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=H7Bzq28b; 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 S233814AbiKQCwK (ORCPT + 99 others); Wed, 16 Nov 2022 21:52:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234530AbiKQCwG (ORCPT ); Wed, 16 Nov 2022 21:52:06 -0500 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2080.outbound.protection.outlook.com [40.107.101.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9289145A12; Wed, 16 Nov 2022 18:52:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=grNl3Y0PVtpLBc8fDfnHl03kBZwQRZzVs+TPK8mXk8fl0Id/1MtwYp+rAdHpXB81n5tC97j1CFBXZD1zUFQOf3u5xkMIKTeuD1GCsAPWpIJhM/8zbluRQDMfw61xu0Yvgd1IcCe9w8D+82oT2pGlPrTbW8b7IkCpH2jvaMShB+ztwFzw5GmmFLbX2cS6uLTaC1/pubZkUoLLjtumIzem3g4XwnDU8NQQM3E6EpeykmM2DVkfpbYh5asKvhMq8vzSWBkg+y2oAwBYeddYoBwsUSMxOgmgQjk7uTICEt5vWcTko0M2zB48t8LjNk7twn9ZR2z5ZWcvNVKh0yvIP+QhYQ== 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=OcSIU8qAOy6ZsOorOZuWzhi2F18NrsiwjaSJz4IC7pg=; b=YneWIH9j5CzEBgLvXMboWaY2pg70baykOsy12b3AyJiRBucnssegoWfpk5I/xDho5kIOcrLUyp88ls+84dLZQ/nwuAgdjqoI6FzUI9YdpPKHyG6Fh6nTZZgnp8M1NUWE9wNLJOuMrWY6iO9TfDLCmNOnsSWq4Qt5CQhz7XIuHdel3povrNy3F35RhMT7u6TjYbVEP1aO1S2s1qhQPm2DbYn7iQujHNdxlw1+dvlHNtKnqEWBqP0RaKKARN4CxKQuntb6lUQS+4dZWHYg9a5I98KZ9xxPN6y2DI4J2YFGAukSK+X/O2ia6VypXAbHcSj73QdX7hrNmfN5/W37xkidyA== 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=OcSIU8qAOy6ZsOorOZuWzhi2F18NrsiwjaSJz4IC7pg=; b=H7Bzq28b9WSHgqTI6grLBfngb3Q58oUX+hU43/GQFzWyQIDAlNo5KcWsTpzcOXK8MSfwgby1uDn4gLSPzI7QoQcUMM3OQRQ0M/s9g1Z07GMw0ipBtg65uAUmRZGMoYpzyJdxVv3EzUjexiHx/+Xdy1CoJPuJr3/wjexOImzqdpE= Received: from BN0PR02CA0038.namprd02.prod.outlook.com (2603:10b6:408:e5::13) by BL1PR12MB5898.namprd12.prod.outlook.com (2603:10b6:208:396::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.19; Thu, 17 Nov 2022 02:52:01 +0000 Received: from BL02EPF0000EE3E.namprd05.prod.outlook.com (2603:10b6:408:e5:cafe::ea) by BN0PR02CA0038.outlook.office365.com (2603:10b6:408:e5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.20 via Frontend Transport; Thu, 17 Nov 2022 02:52:01 +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 BL02EPF0000EE3E.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.11 via Frontend Transport; Thu, 17 Nov 2022 02:52:01 +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; Wed, 16 Nov 2022 20:51:57 -0600 From: Perry Yuan To: , , , CC: , , , , , , , , , , , Perry Yuan Subject: [PATCH 3/5] cpufreq: amd-pstate: add amd-pstate driver parameter for mode selection Date: Thu, 17 Nov 2022 10:49:53 +0800 Message-ID: <20221117024955.3319484-4-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117024955.3319484-1-Perry.Yuan@amd.com> References: <20221117024955.3319484-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: BL02EPF0000EE3E:EE_|BL1PR12MB5898:EE_ X-MS-Office365-Filtering-Correlation-Id: 85574f31-c7de-45b9-9f74-08dac846b39d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ofc8iJzpBmfj8cUH0s4EL8am6xeCFtE0wisvko3U3aat+2jezlHXh06CCpsO0NQNHio/vX+15JP5xrbVmO3oCI1FqF3itfLz0VZr6/zq1XZl/AYb8HujHZIx6yM5W/gcQlaoICqBU0h1WCzCjdBL4fyafOU/0r5g5yUKsC6cgWw4/ToSe1xITnwgZFpntW95lFRomZMfXe9B0Wb1PQNDGJEmX+lgci+R/T+DVoWqJFJWC1KtlGXc8FoDQNarI2RXhM/uStc1GpelgLLjqD6pydsOYXJQHiJhuVUbBTG4WZ6eWf+PPyDB163bRf02nJ3ZqkBWceOBus0qFHqOQcqEqSH4MHTcl1bMSukxfcznXqM6elhvrCxK8eXUTeAnwypxjCOMex1fSa8XWtGzZjq3YnJzAEFqQeof78ZgTbmwniLfflM0z3ikyFwfJDgeH5bvE6kdlF7YAdNGhwNy30ztGIu2DwT7UbTJee0fzNbN0epAsvmPtRLL8FpC9e6qOxLsQtbj8qfOwxsPNy2tCLuO0Y0+KQb4fGW60NRddfhGPW9nspmNtl1wmVXebKW0sf54hzoKO64otdQApFZLrCFTbwEI9ty8B2CXoHTIqPZFZNofl5pKZpks8k689sLi/502KhRnsGhZODO0r65Y4fwyYsrj+Bdodh+d5sP2oRpROOzdZhzmkVm8NjcpGC4+W2CaqeH+tW+l2TbRN7c3RaS2E8buNi4GkPM1njNTZYcc5cDSO21Ipm8nKfoYoyRczviegKxqqDlrTvzij3oOOX2FcuMAYxtFqg5RZGGRP0f5JuA+JQf3wzb8nTo/fKGIG4rOoQgJhlQnokUgfOWb02TmqA== 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)(136003)(346002)(376002)(396003)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(36756003)(82740400003)(2906002)(4326008)(81166007)(356005)(8936002)(36860700001)(83380400001)(86362001)(6636002)(8676002)(316002)(2616005)(186003)(336012)(1076003)(426003)(110136005)(16526019)(478600001)(26005)(47076005)(40480700001)(5660300002)(54906003)(40460700003)(41300700001)(82310400005)(70586007)(7696005)(6666004)(70206006)(2101003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2022 02:52:01.2595 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 85574f31-c7de-45b9-9f74-08dac846b39d 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: BL02EPF0000EE3E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5898 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749710141111975396?= X-GMAIL-MSGID: =?utf-8?q?1749710141111975396?= When the amd_pstate driver is built-in users still need a method to be able enable or disable it depending upon their circumstance. Add support for an early parameter to do this. There is some performance degradation on a number of ASICs in the passive mode. This performance issue was originally discovered in shared memory systems but it has been proven that certain workloads on MSR systems also suffer performance issues. Set the amd-pstate driver as disabled by default to temporarily mitigate the performance problem. 1) with `amd_pstate=disable`, pstate driver will be disabled to load at kernel booting. 2) with `amd_pstate=passive`, pstate driver will be enabled and loaded as non-autonomous working mode supported in the low-level power management firmware. 3) If neither parameter is specified, the driver will be disabled by default to avoid triggering performance regressions in certain ASICs Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy Tested-by: Wyes Karny --- drivers/cpufreq/amd-pstate.c | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 701f49d6d240..204e39006dda 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -59,12 +59,8 @@ * we disable it by default to go acpi-cpufreq on these processors and add a * module parameter to be able to enable it manually for debugging. */ -static bool shared_mem = false; -module_param(shared_mem, bool, 0444); -MODULE_PARM_DESC(shared_mem, - "enable amd-pstate on processors with shared memory solution (false = disabled (default), true = enabled)"); - static struct cpufreq_driver amd_pstate_driver; +static int cppc_load __initdata; static inline int pstate_enable(bool enable) { @@ -626,6 +622,15 @@ static int __init amd_pstate_init(void) if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) return -ENODEV; + /* + * by default the pstate driver is disabled to load + * enable the amd_pstate passive mode driver explicitly + * with amd_pstate=passive in kernel command line + */ + if (!cppc_load) { + pr_debug("driver load is disabled, boot with amd_pstate=passive to enable this\n"); + return -ENODEV; + } if (!acpi_cpc_valid()) { pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n"); @@ -640,13 +645,11 @@ static int __init amd_pstate_init(void) if (boot_cpu_has(X86_FEATURE_CPPC)) { pr_debug("AMD CPPC MSR based functionality is supported\n"); amd_pstate_driver.adjust_perf = amd_pstate_adjust_perf; - } else if (shared_mem) { + } else { + pr_debug("AMD CPPC shared memory based functionality is supported\n"); static_call_update(amd_pstate_enable, cppc_enable); static_call_update(amd_pstate_init_perf, cppc_init_perf); static_call_update(amd_pstate_update_perf, cppc_update_perf); - } else { - pr_info("This processor supports shared memory solution, you can enable it with amd_pstate.shared_mem=1\n"); - return -ENODEV; } /* enable amd pstate feature */ @@ -665,6 +668,21 @@ static int __init amd_pstate_init(void) } device_initcall(amd_pstate_init); +static int __init amd_pstate_param(char *str) +{ + 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; + + return 0; +} +early_param("amd_pstate", amd_pstate_param); + MODULE_AUTHOR("Huang Rui "); MODULE_DESCRIPTION("AMD Processor P-state Frequency Driver"); MODULE_LICENSE("GPL"); From patchwork Thu Nov 17 02:49:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 21390 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp182091wrr; Wed, 16 Nov 2022 18:54:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf7LUmNZrDPHrKjGL4aI2z8h4Vq5dkcvDvyM2GfocTCT6A0eQ1AQniE+JBh7++E68dd8qaCg X-Received: by 2002:a17:906:1c52:b0:780:bd74:f960 with SMTP id l18-20020a1709061c5200b00780bd74f960mr497115ejg.701.1668653640482; Wed, 16 Nov 2022 18:54:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668653640; cv=pass; d=google.com; s=arc-20160816; b=A6LLDjjGjFFCY+FkxgN7BeyRKP8RrUji/ombMKJRqDUewjdcnP/xDp4dvjroMWNCCS XIY19i6TxMmMdAbXJXM1dBpEgb/sRnvbfZexExcGrUMws3xsGqSySdSplvGE9lK36wa8 au78XjhrEFO2VSAMb5WpBCtUTNJMST+UmNUBlOEJV47OQNlZA0tuxphAa81Wvbqs0Q1I dOULHbANxLy3g4UmfqkyIUF096U6eQDIN3uMo1BcFnCiCNnIuej0Wwb1S9t0An1qDXlK F7ZYs5s4FZBFVVtw1CaVCdgBDo5z6Ed/p+AX3gdp4PiUMRjlysz0W5qUqD8B31Rv/7lU 8nBQ== 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=WOaTYCi7NB3f7zqVf4NrguCJferwo6NNYNHoyElxFQ0=; b=CNrXD6xuawLnFSmdaSy10ZnHuw/043eWN5XTeuOHzzxYlCVb9lffvG/lQeHjQqNw8J KvcLWLwVgbOJVHLDDTJ42bgynh8pNzovaLeRnOaeiKYx6hVvfsesIhGAYo8LbwseqUgP eMmJ3zvtaOgE6YUm8zDphPJ7VAPVDVsAFzNvx/HnUAN8TGNVywion8BLGm6Z1TpbSbii KqmR7hwTaYE7r2/pAP9W3fc8B/wiP1DIE6ehMCozhZx2PrKCw30IQP8HFdy+VHhLlrN2 Ur79BiXXPd3rmxn/0h52EaSAwng1kbsAfDNShttU3bHp3JU0oCPADhEYCsqxvzLoqj52 nlYg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=JgwZ5WVy; 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 d25-20020a1709067f1900b0078df2f22f80si13282072ejr.647.2022.11.16.18.53.37; Wed, 16 Nov 2022 18:54:00 -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=JgwZ5WVy; 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 S239022AbiKQCwl (ORCPT + 99 others); Wed, 16 Nov 2022 21:52:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238978AbiKQCwc (ORCPT ); Wed, 16 Nov 2022 21:52:32 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8362A43AF7; Wed, 16 Nov 2022 18:52:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jkWLJmmt1drKHO6jEoqGJ/EcRhYAb93/FgL8G/SDaQ/ilDQU6qFxhmu6AVIGDDiXJQDcyUILcfh+8NvZLt0mmq4Xeq2oncJbZnxH9xXCM7ZKctgA6Ou4WY1nUx1NsH9e4C39dUy5ukW7Lzc2L4zK0Xr71c4hgeYJCE+ch7FD3ITDl+NLnZQ/sl0se/6H2rDW5AAwotz5g8mRRtlgzxMtBEqfvUZpcCZBUaKtp+2D1C2tQ1WfqAxnHKHqanOl9rCIAJFOBTRJgtyzj9xJa1ktpkxhTKOfSzgyxQ65M7qKfmSHNw8kuTl2sxzwuPY/rkwguofqIOjGTmngmz9wYNshOg== 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=WOaTYCi7NB3f7zqVf4NrguCJferwo6NNYNHoyElxFQ0=; b=O7YEBvdQW0VLurrRADmzjyxNGR4t01EcABf31pF5+GVV9i1K0IP9iTqu/6DGf5JEXIACu92l+Cogi51jTbS6k1XMm295TilVSrHFB2LGQ2sDUmevGKVgasV5XToVR7gtKgv+7EQa5urIdSKeVn/2yQo9mZz/+0HhY/iPjOrLIv3T3LsXZS9khwfNiQJbHc9TV//c8WWBoS7/EmKjDv4FyHmqCV3arms102GI/pCAHGH93DrCX8tun4uzw6Qpw1d+JdB+n9Trhsm8SBu6oNyoCBlJoHV8WJwLHKsfcasuWBoKpHDRh50Maql3jRQzMHClbFOeg0HeI6gCDJvOHFJyeQ== 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=WOaTYCi7NB3f7zqVf4NrguCJferwo6NNYNHoyElxFQ0=; b=JgwZ5WVyaOedb2u4Yxn3RxM68CjKxDucKJjrzdUuzXDqxYKUCzx0jVTxhfja/UXOdPDHZtmNsjGSYsxzTxXf3RcsEj1PYqM6EIBsOB49XIsn0ZCovWXDS9c3oE9UMzvp10deGIdVLtGIzMBDDAsgERZ4OVGHCS0S2My6uTOOTX4= Received: from BN0PR02CA0058.namprd02.prod.outlook.com (2603:10b6:408:e5::33) by SA1PR12MB5657.namprd12.prod.outlook.com (2603:10b6:806:234::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.19; Thu, 17 Nov 2022 02:52:21 +0000 Received: from BL02EPF0000EE3E.namprd05.prod.outlook.com (2603:10b6:408:e5:cafe::a4) by BN0PR02CA0058.outlook.office365.com (2603:10b6:408:e5::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.19 via Frontend Transport; Thu, 17 Nov 2022 02:52:21 +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 BL02EPF0000EE3E.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.11 via Frontend Transport; Thu, 17 Nov 2022 02:52:21 +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; Wed, 16 Nov 2022 20:52:01 -0600 From: Perry Yuan To: , , , CC: , , , , , , , , , , , Perry Yuan Subject: [PATCH 4/5] Documentation: amd-pstate: add driver working mode introduction Date: Thu, 17 Nov 2022 10:49:54 +0800 Message-ID: <20221117024955.3319484-5-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117024955.3319484-1-Perry.Yuan@amd.com> References: <20221117024955.3319484-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: BL02EPF0000EE3E:EE_|SA1PR12MB5657:EE_ X-MS-Office365-Filtering-Correlation-Id: dbbf3f15-94a4-4423-fad0-08dac846bf73 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tvQKM1SMlaEu+8B9gZUMGx59EQPuXvz1FSh8tww8HScfh7ZoHU9/SWQiW4Njqb7XGdkvRg/ZzaHp4a8HCtYZvwJRbbhYojwF4ESMDKl7dZUwtVfVNj11NM6Wa9MR63YaQStw7JvajbRnoJCfhrA85bLyZ7Jogci+z8oUHppfsqdZ85fMViL1w0yz/UB02uGkZxmqFQWnswfNIS6JT+McErU+YuTcxG3n1D7rsWWJlXweUfYImeRBg9ueGVW3YpKgm/Xeyux7BlRULc5UmIilt/ELPl8IS1UZvxQPOl462H7hDladEOLl9qmAn84u/CTMmKUH+kmhiwcU4u/3d7XZBInt75MI5Z85bgsPlZlXGfUusuqb8OMvvIRLl4wJpSK9c1400WX/r+RfHiA6hxy+xueKhvo3w1v1o9Lsa9cRmiqTL5MrxWbuyEfqsqmJMPpOyhzhf71UHkwOAqpu6yssNzrIXAtTzcprb9DowheG198BQoawcbYaDvFyn5D49j5A1V16WESHVG4ArhuO5u5aeXHAfnJwSXYzMicNJC0QmNZZyyEoSD2lzdpDoYelxLHwfrgnNhQ0K9vMq62qRhI0ONZLOsKnN6kynsoQ2S3Ff4u5stGUgPsCBsJtw6jV283TXPS1I1Q7jmYKbafdXyX+Pp0sMtDH4h78G1Duv5vsur0nKdoocbYLKZmBVHJ4jJT7JxStTenk9K4qmkJ7gYMMB2TeiyYTwUYHkSDWFOKzdPVj6LHLTajREOC8CEAJaE5sT8Fy5ekbu4NXv6WeKsuaSXDMQ2cyURI4RQ8GzIJQchd9jD0hGLaK5Dgld4Zm/tGlyU7aBYpNFppkI3jDmnxFeg2C08R8BtB63s4v6h1/RNk= 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)(376002)(346002)(396003)(39860400002)(136003)(451199015)(40470700004)(46966006)(36840700001)(16526019)(36756003)(426003)(336012)(1076003)(186003)(2616005)(41300700001)(70586007)(110136005)(82740400003)(86362001)(82310400005)(40460700003)(83380400001)(70206006)(4326008)(8676002)(47076005)(40480700001)(36860700001)(8936002)(2906002)(26005)(5660300002)(54906003)(316002)(478600001)(81166007)(6666004)(7696005)(356005)(6636002)(2101003)(36900700001)(473944003);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2022 02:52:21.1192 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dbbf3f15-94a4-4423-fad0-08dac846bf73 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: BL02EPF0000EE3E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5657 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749710159543760504?= X-GMAIL-MSGID: =?utf-8?q?1749710159543760504?= Introduce the `amd-pstate` driver new working mode with `amd-pstate=passive` added to kernel command line. If there is no passive mode enabled by user, amd-pstate driver will be disabled by default for now. Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy Tested-by: Wyes Karny --- Documentation/admin-guide/pm/amd-pstate.rst | 30 +++++++++------------ 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index 8f3d30c5a0d8..06e23538f79c 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -283,23 +283,19 @@ efficiency frequency management method on AMD processors. Kernel Module Options for ``amd-pstate`` ========================================= -.. _shared_mem: - -``shared_mem`` -Use a module param (shared_mem) to enable related processors manually with -**amd_pstate.shared_mem=1**. -Due to the performance issue on the processors with `Shared Memory Support -`_, we disable it presently and will re-enable this by default -once we address performance issue with this solution. - -To check whether the current processor is using `Full MSR Support `_ -or `Shared Memory Support `_ : :: - - ray@hr-test1:~$ lscpu | grep cppc - Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm - -If the CPU flags have ``cppc``, then this processor supports `Full MSR Support -`_. Otherwise, it supports `Shared Memory Support `_. +Passive Mode +------------ + +``amd_pstate=passive`` + +It will be enabled if the ``amd_pstate=passive`` is passed to the kernel in the command line. +In this mode, ``amd_pstate`` driver software specifies a desired QoS target in the CPPC +performance scale as a relative number. This can be expressed as percentage of nominal +performance (infrastructure max). Below the nominal sustained performance level, +desired performance expresses the average performance level of the processor subject +to the Performance Reduction Tolerance register. Above the nominal performance level, +processor must provide at least nominal performance requested and go higher if current +operating conditions allow. ``cpupower`` tool support for ``amd-pstate`` From patchwork Thu Nov 17 02:49:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 21391 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp182665wrr; Wed, 16 Nov 2022 18:56:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf59KYW+cA/NQgGMgAsxdCcVtlrrQuYA5Qm0qvaX81GYbwGbqfSB6DvPYPFvnyuoYrxAIrA8 X-Received: by 2002:a17:907:b60f:b0:787:8884:78df with SMTP id vl15-20020a170907b60f00b00787888478dfmr533526ejc.246.1668653781610; Wed, 16 Nov 2022 18:56:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668653781; cv=pass; d=google.com; s=arc-20160816; b=WfT4SF5l3xl4PalQitT2krinn1G/yT7cfHrJQbMjRFBSkIV1/vGfYwaSOpPBt7l+Rx xynk/KA933u0bEok24W+OJsMATA62f20cf2mhFrbR5DhsWYGeTqO+PiRfWwztkwuoaXR sRezl0nWtHEqrQJzPWxcHVTfKMpAuHw3/dJWg98CQzteOZj3nUlYRabdNO2IkNAaKIni G0vC4+QT5/pegbCYbzFzQWuYkAll1yUUN9JsSnOzQRTEbxwHyZrAfF2vftN4mYzYTNYh 1ZweVOS8kS+aB4SudfYyHZGGOHai9PBXkDoXrnKDYVtxI/ox8peyNAQzO9WcNP6BnM0m Yk1A== 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=EjeACgwjgrx8S3K9aWL8w70AGW4JjCzQ3yg1/2SQElk=; b=Guz7pDg344xcjH0DuyfyNsZb1DpzZafpa/MrBgBOhx0tKa8WjVoQBCXap4CiBlfZPy qfzkBwnO+fcUaoqELoCmHYY1AfOjpXYVX7ZgCxvu83N7PIub41EcAwgvx07rXk/EDbg/ Ng4S8JgbWVD4qXTNbMGvFKGB64pq4xmTC9JCB87BCaQ0eu1EdN57rfkUNrvwXvnZ5CUK 4RJDSe7vrVGN631N082NruD9YX5SI1Tx/T/ttf584ZtOHSHiwjIW4nUC7pfWGL/EGb2G vP+C4IPlgfjpBH35LzaVyFb9o2xJdJahJpHoePtDSwTqYVaqunZok7X5VuX9p1CXkmlT hWKQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Fgyo6JhY; 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 k9-20020a17090646c900b0078db719e54csi12472349ejs.98.2022.11.16.18.55.57; Wed, 16 Nov 2022 18:56:21 -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=Fgyo6JhY; 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 S238891AbiKQCwr (ORCPT + 99 others); Wed, 16 Nov 2022 21:52:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239004AbiKQCwi (ORCPT ); Wed, 16 Nov 2022 21:52:38 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87A456B235; Wed, 16 Nov 2022 18:52:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FRQD3j+m916UGmfMJVF9wURQiYO1q2YUmWkn28qEl+joe4gepxbbVLr0PkGMx80fjHRSZ/3XWc6AeWS+fpDA3VPv/V0rBCpfFIJh5X1rgO0uWFlyuiCxjfmFNILu3TmYpnuFLwJL4a87P1OEJIwCApNdOZTT3jwjFzmWovs67/QRtbS3fvEFuP6uyusCWb79JbeuvSue2VEgn6zA/CGrfyIeN9w42I0xUEIYbE29LE+qwMh3Gj/6DRb746CSkjQ1d52i+6hsqF7sBGsFqUpsD2xkH+l73vNax9LbqOwkpKDqWthno83E9c0Vj2Z4bbu/1TV85yNLvqgfDOFylbliIA== 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=EjeACgwjgrx8S3K9aWL8w70AGW4JjCzQ3yg1/2SQElk=; b=EPbzPncyZD7TbUWeYxKzmyDljOzv3z/45sc6PouOJPT1aR3UJwJ7xCo5QL5BLgHbQUuUzG36NycPUx7k3Deb6K3ijejx7cBydE4epSMdQtoRXuavI/aqDwBxR0j3kvj3kbZUCR6Ukg23cHw0wmh559Lwz4W8ez87EF8g2Veyn9mimGqUpKA27K89P9uz9A9zX3Eh8vy/ZSuIpT8Oi+0q9yVzgSxkPOVpERZYG8ApUtMWs3h0y9YYaUqmzeehCbAsmdpNB485jvnt2VYtn5O2S+f5FEK+cj2f4N5BkEVJ2R8/GkBHZmzd2gPO7ap+omuoS82c67Gdja2E8q9/mE9vTg== 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=EjeACgwjgrx8S3K9aWL8w70AGW4JjCzQ3yg1/2SQElk=; b=Fgyo6JhYkFTRM5u7uECeMRKT3/pfqvUiZYOmFOlFkPUAdlL2gwYU01U1q28FrK76OGGdLasaVgRuXjN8inn7AEZ88lHmVLVecomzaoA49ItItLMlw297ibCos9PqWIlnEtRqasM5Cl0CH2gayYSllGNfILiwfVjRKq9CvpDUkCY= Received: from BL1PR13CA0124.namprd13.prod.outlook.com (2603:10b6:208:2bb::9) by IA1PR12MB7661.namprd12.prod.outlook.com (2603:10b6:208:426::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.18; Thu, 17 Nov 2022 02:52:27 +0000 Received: from BL02EPF0000EE3D.namprd05.prod.outlook.com (2603:10b6:208:2bb:cafe::15) by BL1PR13CA0124.outlook.office365.com (2603:10b6:208:2bb::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17 via Frontend Transport; Thu, 17 Nov 2022 02:52:27 +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 BL02EPF0000EE3D.mail.protection.outlook.com (10.167.241.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.11 via Frontend Transport; Thu, 17 Nov 2022 02:52:25 +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; Wed, 16 Nov 2022 20:52:20 -0600 From: Perry Yuan To: , , , CC: , , , , , , , , , , , Perry Yuan Subject: [PATCH 5/5] Documentation: add amd-pstate kernel command line options Date: Thu, 17 Nov 2022 10:49:55 +0800 Message-ID: <20221117024955.3319484-6-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117024955.3319484-1-Perry.Yuan@amd.com> References: <20221117024955.3319484-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: BL02EPF0000EE3D:EE_|IA1PR12MB7661:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a55a373-412c-4b80-d198-08dac846c1d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GFKWRGCT0NLbXkUKzrukZ9RnAUI0kE45pQQC8uMT/5dsrTykMPl0rr8QyDAsaAdbO08D60C0VY1rVadiKSByBW9NghNX1WvI/hbeCUfZUdg7LKWkduwTtL32rykSLLH7uwXN/KZv62lvaJqxnRnRgkMb4feXYJeGp6hQFhefKU3gvp/rNL+4uiIcnMI9czaundnFbUWaWDMVwQ5/SNnOeL3wGE1M+yDCbAJ1K9gmFYQ7iXmrxRmZnhOz+/ezXMQam+ODM3qPBrbjuGH8TxB3YZ/78OImTe4Ii3gxWxt9YFmMLagv2c75uLYDkc9rDaTP0U98Rq4tvYLPcavKfXOptFGHsIbeHrr9QSCN+C0iMeHKZcH2uGUGCyua3W58GoWdOynGVTP2RBe3lRbuKjYitm0mO7KuMtolH1FLxgT/oZmUnfk3MS7F1y05As7OOMoS0vUzbKwev3AQcnoI8iIhz+lhzVvYdUmruzNiXXohT90C/9waz4Ksvjb7WFGVVv3ELxapYk6NoNFTAFEeA6gNNXUpED8B+52Ge7JBLhFE4l/Svn5rCG/KFg68VkJ8wx43n9jMb6fvnWSosF6KKoRP5p89GMUfVecLoxJw72NtUVUrbYP0cOZ0ixymnNngcmQ8asoAdcpcIBBpGtjJF4H0U92iLWeIY5MqDIk05LyBr7A53oapzumuDLqN633yHxpdwHxIqsUkwJkM8J0MPo+C8yktsNrMu3lD36+9jrHLIkQOoaqwSxTORcjuvzcQBgoMOwYEtQdY4ytQ4PN0DgkbJYuC/kQABuJ2esYiXgFWsCLjElAS4XcWl6PxplnX9svQ6yAM/eW0B/2Y2Yu6CYMuDA== 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)(136003)(346002)(376002)(39860400002)(396003)(451199015)(36840700001)(40470700004)(46966006)(426003)(336012)(47076005)(36860700001)(82740400003)(1076003)(2616005)(186003)(478600001)(16526019)(82310400005)(6666004)(83380400001)(86362001)(40460700003)(36756003)(40480700001)(26005)(81166007)(356005)(8936002)(41300700001)(2906002)(5660300002)(7696005)(110136005)(6636002)(54906003)(4326008)(70206006)(8676002)(316002)(70586007)(36900700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2022 02:52:25.0493 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a55a373-412c-4b80-d198-08dac846c1d2 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: BL02EPF0000EE3D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7661 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749710307732426683?= X-GMAIL-MSGID: =?utf-8?q?1749710307732426683?= Add a new amd pstate driver command line option to enable driver passive working mode via MSR and shared memory interface to request desired performance within abstract scale and the power management firmware (SMU) convert the perf requests into actual hardware pstates. Also the `disable` parameter can disable the pstate driver loading by adding `amd_pstate=disable` to kernel command line. Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy Tested-by: Wyes Karny --- Documentation/admin-guide/kernel-parameters.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index a465d5242774..42af9ca0127e 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -6959,3 +6959,14 @@ memory, and other data can't be written using xmon commands. off xmon is disabled. + + amd_pstate= [X86] + disable + Do not enable amd_pstate as the default + scaling driver for the supported processors + passive + Use amd_pstate as a scaling driver, driver requests a + desired performance on this abstract scale and the power + management firmware translates the requests into actual + hardware states (core frequency, data fabric and memory + clocks etc.)