From patchwork Sun Aug 14 16:35:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 597252 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6878C25B06 for ; Sun, 14 Aug 2022 16:47:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243352AbiHNQrZ (ORCPT ); Sun, 14 Aug 2022 12:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243965AbiHNQrH (ORCPT ); Sun, 14 Aug 2022 12:47:07 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2078.outbound.protection.outlook.com [40.107.243.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B9C095AC8; Sun, 14 Aug 2022 09:37:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SCJroC69dGsPbqQfWAZy1GjXXaeQxXSPe2jBcRyU4SdIk7gKJnVuRl5WSFBJCv9mbkE+OiH90hK+Rxo7C/d5rd1n6Bj0fVuthlgiflmhi2gzponCZiTnG5gV7P3tCFhd+GKpPf+J+s5+LXZa9KKyfOtzk2hQhUwMFIxnheA6eYhoK0WuLT7f5FJ3VQXiOw7e/lo84Hkx+T7oPNXKky2GdPDq8/0nwtHBztloEsynrsSAPznSDMap61y1mOaDJKvj6iIN54V7Kml5u+kFJ+FGdKnMJux4y61/sKP5A9AguEQMitUBheWMXHrWPG2QCJ3FYVwNB3kquiUopyyfmyJGwg== 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=ybRtwuyt6S2qJNkz9GNQm+d4ydIhgbt3IuVG2m09KhQ=; b=CMP0Dkv4rZvglQAw2Y4CW26Ty54irChI+8NkcGGT2IjQP9r+oEjYFRxSsgEHxHyyVg6rUJFvpyGJkvU5ucw7A07k021xcJDgrlKFjOFnx7QJPdO9xQM2okSP6uIWHZlb6p6ME0lj5ZzQCXXbYEbo1jAp/+dpxXopj596TZNjus5c53prF5WUQyF5ASrFaQGoHc++e3+jrU1ywm+314xAfVqSyOS0B+7u0/mqYaXNOmapdfWYmOhNuuQxEdjOH/6/7Cvagc+R6NdiK8YRoAT52BzI7KxgdSNcP+k6qW1VUAdqbVAyxuQQsyDn7AeRvcp6OqeaLjqUU+aFpMnLyBWpug== 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=ybRtwuyt6S2qJNkz9GNQm+d4ydIhgbt3IuVG2m09KhQ=; b=4e1ZsBLXxA+mQ8QQQSLjrql3V3xW5tgYMfptUwTv+Dqaj8coxqkjq8+Mv2rU8lhdADNtQRwVgRrL1lvLdhY2bDmQpWt9U9a/r5ajb93nqJQo0y3rurJ6NPRXSIw3isH31aPWTrmjv4WF+fw6BaWY26xFXY7FA3FZ2lkUZE76cd4= Received: from MW4P222CA0017.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::22) by SA1PR12MB7125.namprd12.prod.outlook.com (2603:10b6:806:29f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Sun, 14 Aug 2022 16:37:03 +0000 Received: from CO1NAM11FT106.eop-nam11.prod.protection.outlook.com (2603:10b6:303:114:cafe::e1) by MW4P222CA0017.outlook.office365.com (2603:10b6:303:114::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Sun, 14 Aug 2022 16:37:03 +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 CO1NAM11FT106.mail.protection.outlook.com (10.13.175.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5546.7 via Frontend Transport; Sun, 14 Aug 2022 16:37:03 +0000 Received: from aerithdevpyuan.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.28; Sun, 14 Aug 2022 11:36:30 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v5 1/7] cpufreq: amd-pstate: cleanup the unused and duplicated headers declaration Date: Mon, 15 Aug 2022 00:35:42 +0800 Message-ID: <20220814163548.326686-2-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220814163548.326686-1-Perry.Yuan@amd.com> References: <20220814163548.326686-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: 6944583f-9002-4d42-81b3-08da7e1337f9 X-MS-TrafficTypeDiagnostic: SA1PR12MB7125:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hLZPdxcUI1LIUvYLbyHLQXM0NnFZ2tCxALGYwc6J061VycN/Yl+YvBQvmD/2Pezzj1H+n7X2LxluFR9LjEEUyrGjDrvrY2JGhtxijjfC65tK94CuWkG6qVGhox5Rb3e5ElOkgDKgZNgvMKU6nr3bDz3ni2o1GAjhvCLqylz1Ke8IUvyhiZtrMkySG8fRMU++dfzlcIznW7SPkTOqIaZ5B1l2H7kEWlEKb0F9N+8OQeXlsbDRMCTjJ/UGsbu/OwNoo4T8nEYkxZmvDVQXFnaPPASSZcajAI7I9YmMn5Ft9sIklI3MensEETflY9jRt8tvH7rB3vCs4PB5TAhByP5Q/qDIhz7qoF+u5fzBIMRCMDVdfLiwlEeBFChsoDKhmCnitwU9DqdVQFKZrbnO8X5WGF++A08Qyg0vO1+2hF3/Ls0BWe3D++v09OZmQQfgU67fQK0JKBWn5t6cGx2Yyj1KjUJhkMVNYRUZoxX/dAJdHi6Z+2RqdzN4Huu6o3vtc1IOxxVqCBEuNiWuqL7YitBytYOMAI0WZimYlDZUQzeubNNQxVx4LZOxT9IBK8/x6ZBUtz5Muq8vG3dzoXGKyDa69xi/ryiVCRF+jL633iUMzISoxwpxZrXtm30RQYojvIoefXPRYeUpnPmNk1JskwFBugS/qKrf+pKZhNWTfEvj8JCtnU2VYr1rJCbuBXfZFakeFx/JdscdVAs2nCMBP2pW7Mjx5ZV9XopA+D5Amvj6GjJAS/YULLFlH7QKZabKAmU0s6kDtKL2AAfkM1EOKu81CxcqRVQI5QNaN/RI3lX4c6lvKG1WFWh7nmv5u4ne6D99X2qplRPHNEiV6l9F2BNRT8CyZW/lzF+LloU2J9ZempY= 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:(13230016)(4636009)(346002)(396003)(376002)(39860400002)(136003)(36840700001)(40470700004)(46966006)(478600001)(36756003)(6666004)(7696005)(86362001)(2616005)(26005)(426003)(47076005)(336012)(186003)(16526019)(1076003)(41300700001)(83380400001)(82310400005)(40480700001)(40460700003)(70206006)(8676002)(54906003)(70586007)(110136005)(316002)(4326008)(356005)(36860700001)(81166007)(5660300002)(8936002)(82740400003)(2906002)(36900700001)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2022 16:37:03.3048 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6944583f-9002-4d42-81b3-08da7e1337f9 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: CO1NAM11FT106.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7125 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Cleanup the headers declaration which are not used actually and some duplicated declaration which is declarated in some other headers already, it will help to simplify the header part. Reviewed-by: Huang Rui Acked-by: Viresh Kumar Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 9ac75c1cde9c..19a078e232dd 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -31,19 +31,14 @@ #include #include #include -#include #include #include #include #include -#include #include #include -#include -#include -#include #include "amd-pstate-trace.h" #define AMD_PSTATE_TRANSITION_LATENCY 0x20000 From patchwork Sun Aug 14 16:35:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 597251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E83BC25B06 for ; Sun, 14 Aug 2022 16:49:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232006AbiHNQtR (ORCPT ); Sun, 14 Aug 2022 12:49:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241104AbiHNQtB (ORCPT ); Sun, 14 Aug 2022 12:49:01 -0400 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 802339E2D8; Sun, 14 Aug 2022 09:38:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bY6Hakp/ZmfbaqzXSrpMYzJ7inLXLJH7PNEfEvG0TrpdOpAehqD/notZ5zFJlTdKA+FRiR9Ve9UlbGU3TbnZOXb61IA9YSHOb8JxGsfdbX50A1S6zVh29yac7vz5S59Hw87wyJurttDeC8j8cLRXu0xInLWWuTSMKUzSTuhs+hjgwsnwYZ0QfTDGsN+1AkWARq93qFVzkIRnTamfSb2EmhLOGEmzhPn3pilWX75hmpsM/ryImKLhJrRqbtyxD6e6++tNlZM6NFnqpp5PHZXS2rJRNTHl8WwJ9InEJTie3PFCSmOGPo5J1B4wqGFL2a/MD3+iA+Qbs4jwpbovaxyt4Q== 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=HvMXDPcSyspKZwfDSte4a5scNDX8L6+9iCN3PVZLF98=; b=k2nzUyu88rvsqSpjk7Q0yPIBeW5Lr0fMRphcfW+yR0m+fN5KKhzinwwbXDI6aDAjZZt2SVs7DzA9xtbWhLeyv2hUQhTmK2WJNfvanS8s4nrV2nwiqbnGpEQb48dlFmDSNSrvTn8aOrQLhMxywzJfdV9bTvN1dHZLeo1919wWCg4qjJzqJ9ff49dfNkmb6BuRAzEJcIxJuXXCQjGjf0uT6Qg17KxZ6de81nQWhhOKV42xEp4sWXtCeEzOei11bRr2K/t02AXA7lJC6ky6lIqfBKYpwga6PuT0tTH1wYjHAQHZ7kI2sy3X2sAsTIlQoI3NjpB+jHkQQZ7SMctOa8geuw== 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=HvMXDPcSyspKZwfDSte4a5scNDX8L6+9iCN3PVZLF98=; b=Y9Hs/huD4aBfrd+6IIXHw2sXiulCl+uIcN4JtjB2N0OTsQFcZxx53Q6TgxR07iXYTBVhjgfcQDqWVwU7GaKvqZ24qqE72uRAt7HxgafCxd8fVZ98JxDKIjHsHbw1wnvFrQFqF88vBLrV0WmUmGjXditzbgC7ov0Q0OwlZQssU0E= Received: from BN0PR10CA0009.namprd10.prod.outlook.com (2603:10b6:408:143::6) by BN9PR12MB5035.namprd12.prod.outlook.com (2603:10b6:408:134::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Sun, 14 Aug 2022 16:38:01 +0000 Received: from BN8NAM11FT109.eop-nam11.prod.protection.outlook.com (2603:10b6:408:143:cafe::f1) by BN0PR10CA0009.outlook.office365.com (2603:10b6:408:143::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.15 via Frontend Transport; Sun, 14 Aug 2022 16:38: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 BN8NAM11FT109.mail.protection.outlook.com (10.13.176.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5546.7 via Frontend Transport; Sun, 14 Aug 2022 16:38:01 +0000 Received: from aerithdevpyuan.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.28; Sun, 14 Aug 2022 11:36:34 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v5 2/7] cpufreq: amd-pstate: simplify cpudata pointer assignment Date: Mon, 15 Aug 2022 00:35:43 +0800 Message-ID: <20220814163548.326686-3-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220814163548.326686-1-Perry.Yuan@amd.com> References: <20220814163548.326686-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: 46df4687-1afc-4b5a-422e-08da7e135a51 X-MS-TrafficTypeDiagnostic: BN9PR12MB5035:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: phNYlTdWbrXUuC0keUTJnU2X/9PJq9pQarV1RtbPHu3wZG+7RYJrx0TA8SZIk3QBMaZAAIh/TgZE2HyG4/R3CUJIX77AU3Q4m3PrXZhUaamI3Y52XmkUkJ0cw85jsC23AOe546QWHY7p416SmgHriNOOSPRy1dLcncuV8hu3veMV7c1ev4kKdScX0ZvH36NQy/+n3UjhjTRSFvchSCQiBySETCGZJd1YWKGqvVXhLLwBdNMR9yADB45CzOFxYDHxhP+6tiKbFK1b3gdccVhmXe+BgO3EgJRIUDqFI+owPbYmtour0FGDF5d23yLoB5bx6M/FbZyD1aXMn88mdw2sJTlPfLCatuCGOL2V6tXdx/QD3Rl0rAImxmH44eXAKixOJjlrMpZpL1TgkMvSgNjOCVskTvx2e/0jKCZva3UcVZGmDMG+xYEu4X6s2ftxZt8Kel+q+ywApL/zXqfPlgy6BiALtkM0Xd2m8FD75pB1auJhFcdMfeFgMqVgqFj9Z2hTbjp2RgmxNeBrKcyu+FeGfoLhK7fgezKNWgsPO1dhvNroq//B4ecHzPflOPeVoTFYSib+OUprOH+ax9Exf8VGu9jMYns3PaGZm9vj0lsRwNJUMHvrTw9BGLa1yaHnWF6Fpb5xID2Oo40f6AYiZjzeg00wrQSEkSSQ279ylWUZPfv0TN53phSsCym4qRDvssafoDOorxvZoTx1vxlZG1jBZYT8MiFMDMk4O5Me7aqqrhSWGt/wg3cMtJ9LG/vRzv5F9pbdjc0c3PRo5FGKpt1MSHyEsU+LVDz+UqWTpqaQXt4OwGzfCTT71nrVpGlm4MkqPxcwb10E9cjXZikp6MYdjjsVwEMb8nl6F6N2vxUUo14= 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:(13230016)(4636009)(39860400002)(346002)(376002)(136003)(396003)(46966006)(40470700004)(36840700001)(4326008)(8676002)(47076005)(426003)(110136005)(54906003)(86362001)(1076003)(40460700003)(82740400003)(83380400001)(16526019)(186003)(336012)(81166007)(70586007)(70206006)(316002)(36756003)(356005)(478600001)(41300700001)(2906002)(7696005)(2616005)(26005)(40480700001)(8936002)(82310400005)(6666004)(36860700001)(5660300002)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2022 16:38:01.0474 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46df4687-1afc-4b5a-422e-08da7e135a51 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: BN8NAM11FT109.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5035 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org move the cpudata assignment to cpudata declaration which will simplify the functions. No functional change intended. Reviewed-by: Huang Rui Acked-by: Viresh Kumar Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 19a078e232dd..b31bb5e6cefc 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -550,9 +550,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) static int amd_pstate_cpu_exit(struct cpufreq_policy *policy) { - struct amd_cpudata *cpudata; - - cpudata = policy->driver_data; + struct amd_cpudata *cpudata = policy->driver_data; freq_qos_remove_request(&cpudata->req[1]); freq_qos_remove_request(&cpudata->req[0]); @@ -594,9 +592,7 @@ static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy, char *buf) { int max_freq; - struct amd_cpudata *cpudata; - - cpudata = policy->driver_data; + struct amd_cpudata *cpudata = policy->driver_data; max_freq = amd_get_max_freq(cpudata); if (max_freq < 0) @@ -609,9 +605,7 @@ static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *poli char *buf) { int freq; - struct amd_cpudata *cpudata; - - cpudata = policy->driver_data; + struct amd_cpudata *cpudata = policy->driver_data; freq = amd_get_lowest_nonlinear_freq(cpudata); if (freq < 0) From patchwork Sun Aug 14 16:35:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 597458 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1393EC25B06 for ; Sun, 14 Aug 2022 16:49:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243412AbiHNQtF (ORCPT ); Sun, 14 Aug 2022 12:49:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243282AbiHNQsv (ORCPT ); Sun, 14 Aug 2022 12:48:51 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2086.outbound.protection.outlook.com [40.107.92.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F7A19F0D2; Sun, 14 Aug 2022 09:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lFhscuqlJEt3aIUTDFPa6T3pxA10Nnn40IhNSLpNOqVuGrjyVcrTIH8/pTP2qtSB/hkZoLfwduacCkP24Kvdau2O0bj667PmPiOSELjtA/G0PgzZqa2AxW8UOm92ZE04CAHCqM6t+oVvWmBqBiEKH/vBVP27GXsM9BNF9KiRNqQlvH28tZObLYs1S78qVfScjQ8ObyTpKQA0SfYvpc+jj6nXMiwDfYajmd4AX9iE48VNpcxuC/Ul1gsLnZ//rIbuNBeM9PSG/LRZhgLSKAfNbs9IpqKuyc77zpfM9L19SCakL693hYH+NeRSBZKVR+o9gNVu2GAdWOxL58B2DvLeIQ== 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=wqI6ibsnnowMxQI8rW9A5/Owk7pQgp7fZYXH3DTrxgw=; b=SoGzG9mDgqgfKry57G6UffqLIWztzDQrodABhRnpwcnKUsToRFewEvcKzJV6awlCQuD2qHpe5eZSQF5z+yCH4CgvVAI0TuNwChagpiFHfoe1HP9eWyunoasQpAxBSBF1wHT1jd0aY/NZXXHguOA/q8oMXumo8X4ZjFAXo3oretOqf1skXjmilmUv4p5KRCKnj5IFRpUc9PV5QXSc7IHugoHuCeUoA393RZnUdd1129IbbHR10sOPtEnyLanfre7zfB40aXRkwi1KORxHO1oFcQY5Ess7pyExOnHTbxT0BfhJk/eFlwk82rXbHlwLAPQJI1s/SFRY8vZHYd2yRbvBhw== 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=wqI6ibsnnowMxQI8rW9A5/Owk7pQgp7fZYXH3DTrxgw=; b=zwgFPQC/sxP9aztrl5+o1GVaMTpu/LuHF4FAw6hjdqTcQt3MjcswdnX2VxIcD0FOAwDHYVbNBl+uYrJ6zvczYwZBREPwjRp7KffDYDLXdfc8CCZbMzPgkxvgNOwoRIUkr/FqeHDYSvcUdWW+706WUqljmsAmKEjV3xmRBV5YG2w= Received: from BN0PR10CA0002.namprd10.prod.outlook.com (2603:10b6:408:143::16) by DM6PR12MB3865.namprd12.prod.outlook.com (2603:10b6:5:1c4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Sun, 14 Aug 2022 16:38:02 +0000 Received: from BN8NAM11FT109.eop-nam11.prod.protection.outlook.com (2603:10b6:408:143:cafe::b2) by BN0PR10CA0002.outlook.office365.com (2603:10b6:408:143::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.16 via Frontend Transport; Sun, 14 Aug 2022 16:38: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 BN8NAM11FT109.mail.protection.outlook.com (10.13.176.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5546.7 via Frontend Transport; Sun, 14 Aug 2022 16:38:01 +0000 Received: from aerithdevpyuan.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.28; Sun, 14 Aug 2022 11:37:05 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v5 3/7] cpufreq: amd-pstate: fix white-space Date: Mon, 15 Aug 2022 00:35:44 +0800 Message-ID: <20220814163548.326686-4-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220814163548.326686-1-Perry.Yuan@amd.com> References: <20220814163548.326686-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: 6782ebec-704f-4faf-d7d4-08da7e135aca X-MS-TrafficTypeDiagnostic: DM6PR12MB3865:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xwkljc0UBCunJvZC+6fgsWHPXldLzPDe0AKVaDCuoxktTbyXjL6lOUjkOgZVUHxgA+CYZjA7TwH06sFElqtHGL6pmvwc9eZf0+QuYy2H4jCwWNXRi95FhHlc6yAd4pJD8gqIYek/QdfOm6qIUgzgi1KDd1UraIHSNhY5ALP0BNRUsvQ0u3QdmuHn5uYPcGEdoyBJ9qUVLsoD1e6eNbbWMV5SXsMzHHtPqkhzJuDDRtHbKPvXS7d7ugWf+ZW9T1pxZq84HYo0Ssf8DJXYf6r+sD/lgT3iscsJu58s8+PDCh7USayP/8p4dupcAnw/sNQdIYnZQnOJgzdpzLflJ3ueBs9uVcTDT9NFeH0aIHb+tlsEwqFDzXUDUMmu1lwzFlH42M46P4sOOwQRxn0L3aavrC5/J2mhkQ1p4vVt///zUyxk3BQW8txeHJxQNpz1/3r2T96S4vbrR1wuf2ySsu98Zy/Ikd9lNuGJpYLubVoE9SvQ8J1qBFJgprVklcrV38GefkW2XMheT1uuldRtaTG+PCQTECLKr3pgHAV0VubmNST/EpFNXvpX+Y7+nkMOZQGGdoopnTmNnlnNjF1g14A/yeTLcha5jnZuL6Q34R3h3AY4uNSUkBNFIq6V0tS6vOr/Dw6/05Ct6X6EmytgCFEDL7fxpqYXUz5WOPYm0MS9SY/LwZvrBPnfONoLEJoi+mTcPnSfdzX+gRRpQMlQAxx/PIGwGSY0ZVul9y+p9uG/sP7jz9LLKvzrHsj3y0JA8G8jsCUxlk0t0NQyf1Zj2nKbYWp5c2zMRxuPNd0wKpvWVtgfJNAyRV1nIB3q5roGn9f2CmPkEHngbpcaDBY2eiKXhV9nH3UfI6DwNWNkT0lLtJM= 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:(13230016)(4636009)(346002)(396003)(39860400002)(136003)(376002)(36840700001)(40470700004)(46966006)(26005)(426003)(186003)(16526019)(1076003)(2616005)(86362001)(82740400003)(40460700003)(356005)(336012)(83380400001)(81166007)(47076005)(4744005)(36860700001)(8936002)(5660300002)(82310400005)(2906002)(4326008)(70206006)(8676002)(70586007)(40480700001)(36756003)(316002)(6666004)(41300700001)(7696005)(478600001)(54906003)(110136005)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2022 16:38:01.8442 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6782ebec-704f-4faf-d7d4-08da7e135aca 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: BN8NAM11FT109.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3865 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Remove the white space and correct mixed-up indentation Acked-by: Viresh Kumar Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index b31bb5e6cefc..5cdef6638681 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -115,7 +115,7 @@ struct amd_cpudata { struct amd_aperf_mperf cur; struct amd_aperf_mperf prev; - u64 freq; + u64 freq; bool boost_supported; }; @@ -651,7 +651,7 @@ static struct cpufreq_driver amd_pstate_driver = { .resume = amd_pstate_cpu_resume, .set_boost = amd_pstate_set_boost, .name = "amd-pstate", - .attr = amd_pstate_attr, + .attr = amd_pstate_attr, }; static int __init amd_pstate_init(void) From patchwork Sun Aug 14 16:35:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 597457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A5F3C25B06 for ; Sun, 14 Aug 2022 16:51:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbiHNQvd (ORCPT ); Sun, 14 Aug 2022 12:51:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243564AbiHNQvD (ORCPT ); Sun, 14 Aug 2022 12:51:03 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2062d.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8a::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03390AA3E8; Sun, 14 Aug 2022 09:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VKtavY4los7J92NX9gWy8k3z2sX8fEHN9SJihzKUPReGWO7BjjmRtggA+VCQq1qyIUKAgHAQ53B5uqscljKMd2x9N0bZZ9YIBuzxjl5Y5Pc509tfEVXK/3OZBEPhQBbxuOGCLHB9KzW+Gti2Y00XDt+6hCez8V68vh6i4A/m9+Ost4kZMQnzW4ui/5BItYsHv3LRTPD/bLj5/ET+w4/fWNrDRLiCN+d1wneTlVETW3RyGZAhAZvLXC/+y0z1TiarMB78KRHYLhkHzzMpjj81bYQ1Yi3vEj72ZEYMchZmlc2uk2rP+0ix69ImzAlCRsczaodnCc6vjdf6WaV/osRH/Q== 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=ITP+xMcKn0k3zI9mRfi3CV1EbREoYmm1Lpq390wDadg=; b=B1rMzAdmiQLQ2/PKlLxpdXlZuBQKOZCmnH1l9IQ43UbUFnL60lp7K6cHuvMGuMIXYIxpJHQTsxwS+MmDTWouJDJbq7Fq53Z9b+ZBva6HwU1MEEInFYE2vdT2xetQu4nmYnPg0N/rz+D3/uyn9z2ksoTdtCH4NxXhcZXcKX1rS/qRjQ6vsnjwFHEjEJwxvHOBIN7iSzQ2pm89OhSrbf7TxbmBUPdTt8BC1ezqx7STWPOKPzdkhlY4XWt0kbOb8n4u/qOzwAClazHWG40Ssg0sT40oPj9HON3Moj579DTNW51ZP93QFNsghqBJ+SoaIV8RDRMvzIiBopB01KkJY8dbQw== 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=ITP+xMcKn0k3zI9mRfi3CV1EbREoYmm1Lpq390wDadg=; b=EK36ELO9f7QRUjTkW33dqDwsUaz6Oann5apLCE9VfeQOIIrUNUVOckTIxzyVjOftPdJLgRxl/4Fy+jbxXzUSobLjntDhqHop7F9RIo/eJN5zGlnKUa2IgzGbBuBQvmMdra4tgST3W0JDXeYhVx0f+019RFYRqWDC3swXdJugy/o= Received: from BN0PR10CA0020.namprd10.prod.outlook.com (2603:10b6:408:143::11) by BN7PR12MB2658.namprd12.prod.outlook.com (2603:10b6:408:25::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.10; Sun, 14 Aug 2022 16:38:44 +0000 Received: from BN8NAM11FT109.eop-nam11.prod.protection.outlook.com (2603:10b6:408:143:cafe::cd) by BN0PR10CA0020.outlook.office365.com (2603:10b6:408:143::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.18 via Frontend Transport; Sun, 14 Aug 2022 16:38:44 +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 BN8NAM11FT109.mail.protection.outlook.com (10.13.176.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5546.7 via Frontend Transport; Sun, 14 Aug 2022 16:38:44 +0000 Received: from aerithdevpyuan.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.28; Sun, 14 Aug 2022 11:37:59 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Su Jinzhou Subject: [PATCH v5 4/7] cpufreq: amd_pstate: fix wrong lowest perf fetch Date: Mon, 15 Aug 2022 00:35:45 +0800 Message-ID: <20220814163548.326686-5-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220814163548.326686-1-Perry.Yuan@amd.com> References: <20220814163548.326686-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: 78595ce0-55c4-437c-74d7-08da7e13744a X-MS-TrafficTypeDiagnostic: BN7PR12MB2658:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t1y8ZqFdHGvxHf5JYF7GWWbUN0mqnM85C6oKuMz0xXQLb/pnFlJCYJNszoDWNEwWAikTBIcIiFKKcf0DjrQdWHUREuX25hrjjVTWfkMIhqhux9s7enB8Gr0QkX4K+Ck8QCpb24hlJuYkng3vvXEu4CpKS+yUZf6MrGCgOb3TjBryctugnKQqu/F3kPmDfJ8zPLRGVsZDgG8j+uhHM/dvOB7mabZIOte9gP4RBdYESriJ2UprEAZRa3jk/M0gTqo25iN0AV6GZTQcpEsfYrs/IChDKBRMc6yjrNKj9LWDS1SRXPjjg5FE18BlHXshNX5COcINirllhCAtegOwjIn0tlKPb1RAkxu2tr93+POtr9K616CTTwNTULI4LTX4WU0AnSlv6Yjb9B/a9XCVkczm09wbrBCoRxkH4KkFy1YWakdV5ffZyTaeL6bt+AjX9o5WUS57Xz3bK+NEQ0PskId51H/0plg5vxiC/DCXXhL71kjOVjG3zYa0Ubq2Wf0PsyJsKNxnsDoXOnUx/7436feLjf3JOIUdZ0YRzHcEY2PExL/cHfvNFePi17je1YeAlwlMnglBCbYsHPiuYGVkyUzVRP8hWfu1N2HUJlshLC/S8AHrp4SCBSKf/Tjn/hDqUsco9jisqx4+gVedqGas+8BV8bw3BMI4Tix2zyGATFsFgm9d5FaTUHxUubn030ZAUdgrdIvFKVOQV8Pdup+hfH/IQAhbeQAAHQfAOah0dWz718pSg8f8O3W02LbmYi52fLRVg4iJMr4JQNVlYK7qq8JsSnse35cT5GH+PMMAP0/nrUhbKPhWJdOpHLjW/y0QPwOWtHmGM28Wc4A5XZvlY5USQ3rLBKtgHIi7BJnY0PBbZfU= 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:(13230016)(4636009)(39860400002)(396003)(136003)(376002)(346002)(36840700001)(46966006)(40470700004)(40460700003)(36860700001)(1076003)(336012)(2616005)(47076005)(82310400005)(426003)(186003)(81166007)(356005)(40480700001)(83380400001)(82740400003)(478600001)(16526019)(70586007)(316002)(6666004)(41300700001)(70206006)(5660300002)(54906003)(26005)(2906002)(110136005)(8936002)(7696005)(8676002)(4326008)(4744005)(86362001)(36756003)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2022 16:38:44.6080 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78595ce0-55c4-437c-74d7-08da7e13744a 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: BN8NAM11FT109.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2658 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Fix the wrong lowest perf value reading which is used for new des_perf calculation by governor requested, the incorrect min_perf will get incorrect des_perf to be set , that will cause the system frequency changing unexpectedly. Reviewed-by: Huang Rui Acked-by: Viresh Kumar Signed-off-by: Perry Yuan Signed-off-by: Su Jinzhou --- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 5cdef6638681..183cdd4ba00e 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -307,7 +307,7 @@ static int amd_pstate_target(struct cpufreq_policy *policy, return -ENODEV; cap_perf = READ_ONCE(cpudata->highest_perf); - min_perf = READ_ONCE(cpudata->lowest_nonlinear_perf); + min_perf = READ_ONCE(cpudata->lowest_perf); max_perf = cap_perf; freqs.old = policy->cur; From patchwork Sun Aug 14 16:35:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 597250 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5F1FC25B06 for ; Sun, 14 Aug 2022 16:51:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242424AbiHNQvu (ORCPT ); Sun, 14 Aug 2022 12:51:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243767AbiHNQva (ORCPT ); Sun, 14 Aug 2022 12:51:30 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2059.outbound.protection.outlook.com [40.107.237.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9E3661137; Sun, 14 Aug 2022 09:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nHFAoDFckEDsAsGPIaYxTIdC3+U+g1FfV9mx3Dugz4js8mNKsqCoYZL5LVqKnSBBQioNCvEUrQGBuITmhDUQY1zf8Br6RtO10fvKbeLFs9Y+EpRJ+2waT2DqCQ8ybTFgXOOWO8EXogNiaaAqKFxRCF15e8JfC0t6NS78tovVUjgD0LErRyZg0EjibWNQEhQoTLmVFtrVNGsZlhNn0VYSeKihsXAkB2DwqQARrhuKQEmmOsUnIn83Mfh076jY3/mTNI8ByZ60MqK1ER7YgpTDI+s0YCvfmbA1QZDyms3lzU7CNQWjTwyiH5Ne55+LQGFB8EOOBnjGssrUgzh7ph23zQ== 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=ZM+R2mC8GBtxj5rLDlxGAcV4rBT4sWbzfKQkPyc5TtI=; b=LTNjAquK3Vf0qGedm5081bXFYMtygZ/D75rDcG/8mNoBTZaUuT6Fc1pbUvd9GX06jQFb+kbKiFI2LyUTBXTymajknKm3//YxxZao/JfDwRVTH/0cqqevY2HNMQwY8Ig3TVnteilXO2koFAPzrf5EDnjqCrZm0lgoBZV8/tQY8vdaOWJrKtWAVfN5KhBPQzjSuLSFZN/LZXyyXbSIIXVkuhmOUF97XvPZcQm2qQ6ttBkX5G0ZvDc3DpyNVmtzA2tiAZuHnr+io+2jzH1WgOYqsEWZxLygckEGcrtUfHRerwlwsS649/Mx4gt/N0lJpeXNwb6cRLcE1fhufK9AkS7RYw== 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=ZM+R2mC8GBtxj5rLDlxGAcV4rBT4sWbzfKQkPyc5TtI=; b=nLCP+yZaJXpKjMRqfhbUjXMwOZDuP8LS/jzGmYPRngWLVHBMAAtsuNh9vJriCveS59uXuF3869dsIDlJgx+lRWRHKINsA4zNrl73Xx/Oe1CZTBQoJzPNOS02H4IXVN3VXPdl3wdm1NRU/W8VO6y64jNCa+vGokmbd3+WzQBF414= Received: from BN9PR03CA0275.namprd03.prod.outlook.com (2603:10b6:408:f5::10) by SJ0PR12MB5486.namprd12.prod.outlook.com (2603:10b6:a03:3bb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Sun, 14 Aug 2022 16:38:48 +0000 Received: from BN8NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f5:cafe::b0) by BN9PR03CA0275.outlook.office365.com (2603:10b6:408:f5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.16 via Frontend Transport; Sun, 14 Aug 2022 16:38:47 +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 BN8NAM11FT021.mail.protection.outlook.com (10.13.177.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5525.11 via Frontend Transport; Sun, 14 Aug 2022 16:38:47 +0000 Received: from aerithdevpyuan.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.28; Sun, 14 Aug 2022 11:38:03 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v5 5/7] cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor Date: Mon, 15 Aug 2022 00:35:46 +0800 Message-ID: <20220814163548.326686-6-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220814163548.326686-1-Perry.Yuan@amd.com> References: <20220814163548.326686-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: 6fd6be10-1d06-4e54-c03e-08da7e13761a X-MS-TrafficTypeDiagnostic: SJ0PR12MB5486:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3tdLo9QsUumFDfNlGsGJmdToUMfSASAXzLeHwqHkivkZm+Tqv+sTiQHBemSOdU5VM4b3aZUOONSLgbX7qKyLsEXR4IlKnwkKYRRE5SPj9WUd7oAvDmm7sZvEWq7iFMx0dWRHg7JcgXvvvdee5I4gOI07ZmOqKmfo1cNYuGXR5HNTg/yTN8NEYsBtV8XmxB8QeEpfrbMyCnEynD+BVpmG0PiAeMwYvTdz3r0NdnoVF45spIDwoRdt65Qm1sRxnEyVK24tPhAgagiFuIQh1pRljumCiDMAai8TJN4TIEb8FTr3a+2wl4WTgn0VNb/qJ9BmCqYxRJ/MvdMh/tNX1tj9TanjiJvcgCzeFWBkc6nt7LbZP2D8p/IwDQhqJeiYmoLGheqqqEs35IlNiAtXNbyrdta1StlG/F5T6aHV9KLEs6M+VrHT2CdU43q0Yef1QRnv29xKa2geIDepEGGXQk+i9a24CmK89ePf85tqYPP5U1Ej+lkdvu/iNHTXITFdgrC1Z2zfiXuzR/+N9BEuxzNvQoYUYPpBWycAoB/s4iWcK7dGS4gkMqROitMijguFgdj712HOsQYpLNzhA8G32i4cACOq7VXHvhiOKm61tyHqUMBH5ByGF0LnRg2NT68v4cHL/JoIzJJJEezMFtR54ovRVR08+tzWASuv+R52WwL+JZMZppqIunHkDFKecodSrCJci9riSXlVzIz0Q8L8oq+3cRV8cI65BbjTHh3XYdXVKwq4AsGdQ+5a6bi4Xjl6TmQHS3Nw7hTy9xfWiOovjbGOTGDiR+CFLHPh5KKTDNAqksXN9bkznMwVaysG1Hkw9PTes2TzLlLKuI5wECVMmdQ62iwbKzYMpdsM1my36sv1ALw= 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:(13230016)(4636009)(39860400002)(396003)(346002)(136003)(376002)(40470700004)(46966006)(36840700001)(36860700001)(1076003)(6666004)(16526019)(5660300002)(82740400003)(41300700001)(82310400005)(426003)(83380400001)(40480700001)(2906002)(336012)(47076005)(26005)(2616005)(7696005)(54906003)(110136005)(316002)(86362001)(40460700003)(356005)(478600001)(186003)(81166007)(70206006)(70586007)(8936002)(8676002)(36756003)(4326008)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2022 16:38:47.6508 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6fd6be10-1d06-4e54-c03e-08da7e13761a 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: BN8NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5486 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The patch will fix the invalid desired perf value for powersave governor. This issue is found when testing on one AMD EPYC system, the actual des_perf is smaller than the min_perf value, that is invalid value. because the min_perf is the lowest_perf system can support in idle state. Reviewed-by: Huang Rui Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 183cdd4ba00e..e40177d14310 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -264,6 +264,7 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, u64 prev = READ_ONCE(cpudata->cppc_req_cached); u64 value = prev; + des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf); value &= ~AMD_CPPC_MIN_PERF(~0L); value |= AMD_CPPC_MIN_PERF(min_perf); @@ -352,8 +353,6 @@ static void amd_pstate_adjust_perf(unsigned int cpu, if (max_perf < min_perf) max_perf = min_perf; - des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf); - amd_pstate_update(cpudata, min_perf, des_perf, max_perf, true); } From patchwork Sun Aug 14 16:35:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 597456 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1BC7C25B06 for ; Sun, 14 Aug 2022 16:52:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243215AbiHNQwI (ORCPT ); Sun, 14 Aug 2022 12:52:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243315AbiHNQvx (ORCPT ); Sun, 14 Aug 2022 12:51:53 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2062f.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F23FC1D0CA; Sun, 14 Aug 2022 09:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MZQXzAZ/sj6D7eeCfO71NFN3RRhJEnUfQymGn+KmZb4GPRUocjtaKVKdX9omVqRQQVDPPcQd8gbFG9FtkKoAdK5y6B2pBT8XmAqZDcJ1TU0L9ozQW95jLkd6vrxvYML1QcylDLs7kIpwkLWIfC4iARWCinqhd3ksYYG7kMkMsWO1/H47Uq76S4NhtYnhbnHKAJrvrZ8gec/AhUIqvsJlys7Ew6DRgVnnf2/oFebG7r+hNVCL+9U3h5fFNbYu+AlOEHhMCFeF1kSg08wVIpq4fF3+dBfnXNK2rdT6B/lLjN7TP5R4cWliCIzwRvTgOhPQtySvTzFq1ce5zYsYSeKF8g== 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=ksJ89ZFCpodpAJmrKMzze3A5go4HN0tv+M2GH4g2o3o=; b=j+kCSWsGqptrp4Nadt88tARvKkSgw1jUPnE5Z6kq+KHUNWw9RqrgGWDosRKp/HXUqpu0mahndLL2Ptlje5WuqxHayRQIMzifHcWhQM0A0qE3TN6RJnNjCR//enkPCC/OqDHZlus57aq04wgqtfsDMr1PdZq7Jm4/gtFny2zHmaUW7pzlc5ETa+yFvs5OkKVqAw88zRFzDmDAWnz3jMkqg7Q+pRkZu9noy6O9KDgUeC/4xuWuiWVsYyN91HtEi4tljsMN94HasYSMO1QyTbaQuYxulaLL6cAZzQSW3NP/5cKV+WxX5L4h4cqeyBa3xGJ3k11yoCX+ZEssDwkXR+0vyQ== 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=ksJ89ZFCpodpAJmrKMzze3A5go4HN0tv+M2GH4g2o3o=; b=xP4PLkG2jQNOJJ0WIvTEuwU6glEAMxLScJveDo6F80CsNd9xViQXgA2wpf+D8TAZxLTAcPYWK8v+k7FGNo5zYR93UzFgG/qMzS3nwk42SDOEOZHAvUXdvW+0T09DDp4RIekyp5lXqr3Ph/Ffj/i3MaPWGmKWnvLPp9Z5NT1Z1YE= Received: from BN9PR03CA0329.namprd03.prod.outlook.com (2603:10b6:408:112::34) by BN6PR1201MB0067.namprd12.prod.outlook.com (2603:10b6:405:57::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.10; Sun, 14 Aug 2022 16:39:20 +0000 Received: from BN8NAM11FT040.eop-nam11.prod.protection.outlook.com (2603:10b6:408:112:cafe::bd) by BN9PR03CA0329.outlook.office365.com (2603:10b6:408:112::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.19 via Frontend Transport; Sun, 14 Aug 2022 16:39:20 +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 BN8NAM11FT040.mail.protection.outlook.com (10.13.177.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5525.11 via Frontend Transport; Sun, 14 Aug 2022 16:39:20 +0000 Received: from aerithdevpyuan.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.28; Sun, 14 Aug 2022 11:38:47 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v5 6/7] cpufreq: amd-pstate: update pstate frequency transition delay time Date: Mon, 15 Aug 2022 00:35:47 +0800 Message-ID: <20220814163548.326686-7-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220814163548.326686-1-Perry.Yuan@amd.com> References: <20220814163548.326686-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: 47ab9ae4-40c4-41fb-7ec5-08da7e1389d5 X-MS-TrafficTypeDiagnostic: BN6PR1201MB0067:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ISRHcjr6h8MrMB4ViefYBW1YeriBKbVUHOEVYearZ0LhvNfvfq++KebH+Jyaw4zgbDAy/Yw2x7dgJuiT3l/pZAHTZGDpZsF4bPmBda6+CbbhtcUL1z7EpbBrngM9/9L0oFvPnlHjx77mSCHHuqu3DZWMltwANg76H7bE3NdxmSs8nHVuwWxKNTixQjeZXbY2JbsGBBPs4cLjwBzN+lQ3s8w+7u1IXo5hvC72+I9JFm2mf/i+zw2TOOog+DeZFmpQtVkbOfLHAiGhW23d9P4eyxczcfCorENbOSy76Y6QTGNkAUhSmQpG6qK2tKGZzfqdKqmS8rxkRHwHIujUf9KqusAU1blLyYrW7HfYkIkOGPjhEzH37z3O+qnXiXgNycza151BeX5HJX9g3DkgGYSTXQRdEf4sOFij4puJ9BS/fK+LqZybfYngu26MiEBFT3SU+La45Bm0VbxYHNEnhL7WpAtCVUF2s/pGdbu6fbrBdWVeiM25OIgGs3RMlG3qztUd9AF+5gDAxQlX8jKe9yLVyAQ2brT8yXPyqBsPjysKFZruVz3X1UmhKnm0YYdSm2/qtPuVuN38703PyncmB+rq1eCApfa5N9S4cqJwJWJUDoFynuLbTDbqVUwCMcXlfraKxGW6lA+inA8Bnl+kGNpfeGSwhzCE6I2pJNnmDyXdhoi1KkxMnPPc3YbWd2ccClQ0/GO7qLT31jarh2TadYaVAM6GDds+Y5EzhLMXk0rqKGJgSQDybde6j6Ky3804PHqs3cBuNS6pAh/zFD3cwWH03tSQRSYA2UIUE2bGDtiE7CNB7UY3ecCj0Wl/LgHK9/ncq68+/87xon7K99sKX713cKrVNK92IlCXUaXCXLfgaXw= 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:(13230016)(4636009)(39860400002)(346002)(376002)(136003)(396003)(46966006)(40470700004)(36840700001)(81166007)(82310400005)(356005)(26005)(5660300002)(40460700003)(7696005)(478600001)(8936002)(86362001)(15650500001)(83380400001)(41300700001)(40480700001)(8676002)(2906002)(4326008)(316002)(82740400003)(36860700001)(110136005)(16526019)(426003)(54906003)(1076003)(2616005)(47076005)(186003)(36756003)(336012)(70586007)(70206006)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2022 16:39:20.7513 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 47ab9ae4-40c4-41fb-7ec5-08da7e1389d5 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: BN8NAM11FT040.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0067 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Change the default transition latency to be 20ms that is more reasonable transition delay for AMD processors in non-EPP driver mode. Update transition delay time to 1ms, in the AMD CPU autonomous mode and non-autonomous mode, CPPC firmware will decide frequency at 1ms timescale based on the workload utilization. Acked-by: Viresh Kumar Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index e40177d14310..9cb051d61422 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -41,8 +41,8 @@ #include #include "amd-pstate-trace.h" -#define AMD_PSTATE_TRANSITION_LATENCY 0x20000 -#define AMD_PSTATE_TRANSITION_DELAY 500 +#define AMD_PSTATE_TRANSITION_LATENCY 20000 +#define AMD_PSTATE_TRANSITION_DELAY 1000 /* * TODO: We need more time to fine tune processors with shared memory solution From patchwork Sun Aug 14 16:35:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 597249 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 142CDC25B06 for ; Sun, 14 Aug 2022 16:53:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241432AbiHNQxM (ORCPT ); Sun, 14 Aug 2022 12:53:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241337AbiHNQwy (ORCPT ); Sun, 14 Aug 2022 12:52:54 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2061.outbound.protection.outlook.com [40.107.244.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 817D21F2F0; Sun, 14 Aug 2022 09:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c/WX1dBlx0coQ36sMgicXMCqPK0dxmvOqyHxdD6hBktmddecdOMr7LEnykebz8yjXXzKIxI13rKj9oWFv5BrY7C0IUnaDLJeyyBn0aNY+7j0Sb7XLntD/FyG5slSXWt9F5Gpr02WoJD7D17/8lFzvqV+xNWND4YfIjA97QJsrPWsnQvZBpYJ2yHU2C/OFmE1ih5qzr6N8TkFWG0nXHmS0EUS2lKhRCISyNNSw2F6XA7qP1PFr++Kormd2tjausb8oHNTJFwIECer/hwj7I9abZfMsn6ZE/ijTD0r7MIoJQ8lsmEQ+f1tonI8dcJFuf6qT6oBgmFMTw/y9aj3D9ySrg== 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=Ff3ndFWIZBqDVEj8f4uYGUSDA/HodWJS6C9fUnChvhg=; b=mC3NU7FftRte1jBtoeaNHGk0ebY8qup0I8I8O6NalWKgatGsiSrXG1hOsDqPKztvqmeiTBuw4g5/LJn2ck/a9dyfFZWaZefA0J0eoxo14RcxjaPM/uDyGR3rWVh5sd/ygkhjj5P6i6hq6wnoKFBDocrLHRoL5O90BVwhg12q2NTpKPPRhNJNpOdD4R5dzSCPu86EaUHgzsSH818+4zxq7Vu0/XYaRHl31JM2KYtSCaJldvMJfC1/sFl+YaNlkXoYoPcGVK3Aft3bulhWvlo+nh9veN7Je8DUwp9G+/eR7kYtnA7Kuhpel/TPgyBRZdV4B9KhitaCvNnsNGi+Jj5FYA== 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=Ff3ndFWIZBqDVEj8f4uYGUSDA/HodWJS6C9fUnChvhg=; b=F0mYJuGgitz5dlV/TREoPpzrB08FcfkGsuVllyo78qpSlvZKzB77JnxrBz4G9eg0QUDM2jSdEC3XKggnKXbXunhnPSeU7nzjBS7BCErrKHevcDpyfYDHjUBGuZmmhr0Zp6TvCeTMfFcQQdtNh4w70d6XRGzOi+vbEBh8qO/4p8E= Received: from BN0PR02CA0047.namprd02.prod.outlook.com (2603:10b6:408:e5::22) by MN0PR12MB6271.namprd12.prod.outlook.com (2603:10b6:208:3c1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.20; Sun, 14 Aug 2022 16:40:11 +0000 Received: from BN8NAM11FT093.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e5:cafe::4b) by BN0PR02CA0047.outlook.office365.com (2603:10b6:408:e5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.16 via Frontend Transport; Sun, 14 Aug 2022 16:40:11 +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 BN8NAM11FT093.mail.protection.outlook.com (10.13.177.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5546.7 via Frontend Transport; Sun, 14 Aug 2022 16:40:11 +0000 Received: from aerithdevpyuan.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.28; Sun, 14 Aug 2022 11:39:20 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v5 7/7] cpufreq: amd-pstate: add ACPI disabled check in acpi_cpc_valid() Date: Mon, 15 Aug 2022 00:35:48 +0800 Message-ID: <20220814163548.326686-8-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220814163548.326686-1-Perry.Yuan@amd.com> References: <20220814163548.326686-1-Perry.Yuan@amd.com> MIME-Version: 1.0 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: 26ac1cdd-478d-4108-df36-08da7e13a7ce X-MS-TrafficTypeDiagnostic: MN0PR12MB6271:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 54UuinXxIs2rwkKeC1c77NUVJgU2DaE9orDknMJDNwVIUa7Jpdx+zcIpQe8IfL2kbug8m2Htwj7qtmxwpp/BuqVMbwSc7mw7UbeZYpBEVIU4J1QFqi7gyVP1pUmFSvDCjRziNhQInh3P+QeVBEhEfUAohxSY3Nwxdip+jStjSSrQqsnUl6rpmLD3vR5wXfvLq27qODLCD0WQ1aWk53q8+2pj5WDLFM39f0+duB+kWqRuTZ3SnIsnlJMcoo6Ro7j66HN/gjkXz6NcyNrWuQW3jE6g13go9Hd5hEb+jwjo7zhfFa5Mt2LoxBWrrAQIObwLUHJu+X5aSD9VIL0fm/LScgADWssAODg/nbKIpebjtCdBlkXVh1JMJ9zxzD0BHf4JVRRWCgqTWx2pSHlGxNDMwBD2WqOC0JjM7XJBQ7KnBzVm+vyh/rR9ijCaPb8LqkLk+0Q29fvWw/JebthswAxKamS9/A0vjv6zfiOJkbk84NRpl4oZNLudb68f7rYoa3uPL2k/yBQdEU1hdE/7fi4EuC1hMJIZhsahA+IUuSAgmBPVAqjqblHnxKE1/ftfmTf7uyNoOGqBffpNBAi95LEEhqBBYwd+3S9ABF53GZVlDYq7+JCvUK6gEe+K0+Ja+rgnxqHRfie3mXH5tLerhWE6J1Yo8ML7tk/BhLSwOsbuYyObZ5QTS793tPK+OWgMvWRQ3bCoZp1hhdPye94OHN9sIm+tcBzHaMZnXi9XeYIT/4NgB04eEeYz2RW+JD/dCJXkLFCsSn/cnbfsG0/GPEsNb6zrejEmOMEZS+VOlh005b7RNgEGLI+QWRcrTH2jIoy/I/T50QTD/JO+mfBa6Ri9h/6UlEkSonYKoydtuiS1QLI= 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:(13230016)(4636009)(136003)(39860400002)(346002)(376002)(396003)(40470700004)(46966006)(36840700001)(7696005)(83380400001)(70586007)(41300700001)(186003)(8676002)(6666004)(4326008)(40480700001)(70206006)(16526019)(1076003)(2616005)(54906003)(110136005)(426003)(82740400003)(47076005)(26005)(336012)(2906002)(316002)(86362001)(5660300002)(36756003)(82310400005)(8936002)(81166007)(356005)(40460700003)(478600001)(36860700001)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2022 16:40:11.0552 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 26ac1cdd-478d-4108-df36-08da7e13a7ce 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: BN8NAM11FT093.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6271 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add acpi function check in case ACPI is not enabled, that will cause pstate driver failed to call cppc acpi to change perf or update epp value for shared memory solution processors. When CPPC or ACPI is invalid, warning log will be needed to tell user that AMD pstate driver failed to load and what is wrong. Signed-off-by: Perry Yuan --- drivers/acpi/cppc_acpi.c | 3 +++ drivers/base/arch_topology.c | 2 +- drivers/cpufreq/amd-pstate.c | 2 +- drivers/cpufreq/cppc_cpufreq.c | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 1e15a9f25ae9..c2309429146f 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -424,6 +424,9 @@ bool acpi_cpc_valid(void) struct cpc_desc *cpc_ptr; int cpu; + if (acpi_disabled) + return false; + for_each_present_cpu(cpu) { cpc_ptr = per_cpu(cpc_desc_ptr, cpu); if (!cpc_ptr) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 579c851a2bd7..73a8cb31529d 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -352,7 +352,7 @@ void topology_init_cpu_capacity_cppc(void) struct cppc_perf_caps perf_caps; int cpu; - if (likely(acpi_disabled || !acpi_cpc_valid())) + if (likely(!acpi_cpc_valid())) return; raw_capacity = kcalloc(num_possible_cpus(), sizeof(*raw_capacity), diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 9cb051d61422..96e4ecddf3f6 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -661,7 +661,7 @@ static int __init amd_pstate_init(void) return -ENODEV; if (!acpi_cpc_valid()) { - pr_debug("the _CPC object is not present in SBIOS\n"); + pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n"); return -ENODEV; } diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 24eaf0ec344d..9adb7612993e 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -947,7 +947,7 @@ static int __init cppc_cpufreq_init(void) { int ret; - if ((acpi_disabled) || !acpi_cpc_valid()) + if (!acpi_cpc_valid()) return -ENODEV; cppc_check_hisi_workaround();