From patchwork Mon Nov 28 16:38:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Pisati X-Patchwork-Id: 1709870 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=g1yMeq4S; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NLWQ51gfKz23mg for ; Tue, 29 Nov 2022 03:39:09 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ozh9o-0004ef-9d; Mon, 28 Nov 2022 16:39:00 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ozh9j-0004Za-Hn for kernel-team@lists.ubuntu.com; Mon, 28 Nov 2022 16:38:55 +0000 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id C8BCD3F120 for ; Mon, 28 Nov 2022 16:38:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1669653534; bh=1XpZW1BceFWZO5j9f4QNnRxPqZRP7eYWE2+ghPYgci0=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=g1yMeq4SYfBslL2MDKHt02EYvVtPLFU8qzvDDULmLBQ0Bjj+gdw8gU5vL3rquPy9p FAN3BdQs7xzbA8yaiTO8mHKVfzbebRfSdAC1qbcmRkocOd1Nx9tiIDigjiWHYJx+a9 coLfDf2Esf4acAY5zUuMB2ACjjO0p+2f6OdAA95HSi1SebVcxtIQ5Qjp+zyma6L69/ O/+62TJpTHKcLYCHmbfcSlf5HWlGnmPEsErZ0f28HVKDkkVSZfORJFOSe4ptLcKo6c YHvGh12dHBWv7T4R6wp7Jvf9f0VIEb8NMOnXI4Yqq5yeVFsRN52UiVyWqLonpCYXJ0 78bZBc01ZHtNA== Received: by mail-wm1-f70.google.com with SMTP id o5-20020a05600c510500b003cfca1a327fso6492099wms.8 for ; Mon, 28 Nov 2022 08:38:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1XpZW1BceFWZO5j9f4QNnRxPqZRP7eYWE2+ghPYgci0=; b=T4OP1P6iVI0xK1tB3W4J9B0AzP3zyKZyYAoiv327jfGRtvk+u6aP/WB1f8SIDu9O9I PXZN5yXbpFtsAOTKSzXuUIalQTZclS/BG2aTjYJdgkfq5gnV/COHilWRYS9K6RkEloJ0 nBC7oHoIPXDtWg+ND06BwxZHic/2NcPEEobKgsNZ0S062c12ZQWN3LV5FAffuraZpkLV rFvRaJritJCXHMytWd4YhfjtmQUk4ZjYvlbP/lb8W5wvErYk0NgHPHY6hZm5mTCvYcaK MT89Hs4GV8+M0zxKEP4ZPisiA4qBpbmdh2kQRU5oOozTpfvpgiob22UWR9RoojMBLmiI uOYA== X-Gm-Message-State: ANoB5pljMr5qTgoV0Ihns5+CRE6fD9oHAktPi/w/ZyZARieK8aarvv8j scZEtTHAWLYPFziL+XUnEDCZtZVldQhYYIsvuGgCm69m2Qzcuo3dRd19lrOtbn7S27xh7cNyqLq Rep3wNE7H6dEJeHcfAeKAlXCSgE9xQt6YRejKmtmW1g== X-Received: by 2002:a05:600c:4f05:b0:3d0:3d33:a629 with SMTP id l5-20020a05600c4f0500b003d03d33a629mr15365688wmq.126.1669653534226; Mon, 28 Nov 2022 08:38:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf6nqHuawGdVlBdfK18zZG2kuN5m5RS0A7+O/ygQ+xH7AnOKqi6J6+kJnILcx4WrSN8uEHIjwA== X-Received: by 2002:a05:600c:4f05:b0:3d0:3d33:a629 with SMTP id l5-20020a05600c4f0500b003d03d33a629mr15365681wmq.126.1669653534028; Mon, 28 Nov 2022 08:38:54 -0800 (PST) Received: from canonical.com (net-93-65-52-3.cust.vodafonedsl.it. [93.65.52.3]) by smtp.gmail.com with ESMTPSA id h16-20020a05600c315000b003cfb7c02542sm16463257wmo.11.2022.11.28.08.38.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 08:38:53 -0800 (PST) From: Paolo Pisati To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/6] cpufreq: amd-pstate: change amd-pstate driver to be built-in type Date: Mon, 28 Nov 2022 17:38:45 +0100 Message-Id: <20221128163848.362359-4-paolo.pisati@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128163848.362359-1-paolo.pisati@canonical.com> References: <20221128163848.362359-1-paolo.pisati@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Perry Yuan BugLink: https://bugs.launchpad.net/bugs/1998106 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. Acked-by: Huang Rui Reviewed-by: Gautham R. Shenoy Tested-by: Wyes Karny Signed-off-by: Perry Yuan Fixes: ec437d71db77 ("cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors") Signed-off-by: Rafael J. Wysocki (cherry picked from commit 456ca88d8a5258fc66edc42a10053ac8473de2b1) Signed-off-by: Paolo Pisati --- 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 55516043b656..8184378f67ef 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 3147a53bd3a6..5b788492ce5e 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -728,16 +728,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");