From patchwork Fri May 5 13:25:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13232680 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 4F6C2C77B7F for ; Fri, 5 May 2023 13:25:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231936AbjEENZi (ORCPT ); Fri, 5 May 2023 09:25:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbjEENZh (ORCPT ); Fri, 5 May 2023 09:25:37 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FAAA1F4B9; Fri, 5 May 2023 06:25:36 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id CD56E5C0314; Fri, 5 May 2023 09:25:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 05 May 2023 09:25:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=squebb.ca; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1683293135; x= 1683379535; bh=7t+/lIxhqlgnlEBYwfT2xXhyCdqZvuaeWIN7vpHYLAI=; b=k oAn0tSE2cwE/I/11d2hDIDF/GVjIvJOP1byJzpKIad9fJSaTOcuSEYY9MO299OYn /WkYaLXUt9uH9viJXopHdVupX59beGHD+RNMrtjFo+HIMq5D9EtssPim8CGh+gp7 8ACTf9KpAgSNNTqiqoQnXkXEgfpVvZY2MzDMuIE68AdaCQgt8WfRDvBxYOEe2QKK F9XBLpt3BYXoEkSXEUXi6brJozAL5XNm/iJ3TyXCuQko2iRAy9ivx5s4za83Ij1A 725wTxeUOkdWBRjhtd+CPkn06uvDrbmHozeKmf4v6MNIiWRRfwK6jfEsVZomMMs0 vWZdeNXA5XCK4r2l2qgyA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1683293135; x= 1683379535; bh=7t+/lIxhqlgnlEBYwfT2xXhyCdqZvuaeWIN7vpHYLAI=; b=J 1RgSkhR5Vd4V3MJiHcGT3pIsADbScMo7opwlybEp1qzKeaJ/ufEKT+kwGW7hR9wp ywk8QbvzwbJ2gdg0WrqSCXzcZW9MH5WvXAWkV0a/3kraHL2AgQmnYvKjvtg2Q4Zw /1oYhMZZ2RNglx+s/81I0kFb/G4e7Cj4cinKlzXWGmD5d1qZjOmwEO6SOYOrgX0A jWbfNIXbb7kl6ujUqH1YACBPi64YHFPC2ZiQiTtqDJ9BTiL8doHF51rWbIxm45dk bvTLKgk1B0qTQ4Qnc/RBAeLErCxZJMOwTY181B3v9xaDWQBwiYrQ5ISOIwoaS7Xz uhfdXBqfJmtPkLfzDEOMQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefvddgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoteeftdduqddtudculdduhedmnecujfgurhephf fvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrrhhkucfrvggrrhhs ohhnuceomhhpvggrrhhsohhnqdhlvghnohhvohesshhquhgvsggsrdgtrgeqnecuggftrf grthhtvghrnhepvedvtdejlefgvdeffeefgfefieduvdejledtgfeludffleeivedugeei jedtuedtnecuffhomhgrihhnpehrvgguhhgrthdrtghomhenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmphgvrghrshhonhdqlhgvnhhovhho sehsqhhuvggssgdrtggr X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 May 2023 09:25:35 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 1/2] platform/x86: thinkpad_acpi: Fix platform profiles on T490 Date: Fri, 5 May 2023 09:25:22 -0400 Message-Id: <20230505132523.214338-1-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org I had incorrectly thought that PSC profiles were not usable on Intel platforms so had blocked them in the driver initialistion. This broke platform profiles on the T490. After discussion with the FW team PSC does work on Intel platforms and should be allowed. Note - it's possible this may impact other platforms where it is advertised but special driver support that only Windows has is needed. But if it does then they will need fixing via quirks. Please report any issues to me so I can get them addressed - but I haven't found any problems in testing...yet Fixes: bce6243f767f ("platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms") Link: https://bugzilla.redhat.com/show_bug.cgi?id=2177962 Cc: stable@vger.kernel.org Signed-off-by: Mark Pearson --- drivers/platform/x86/thinkpad_acpi.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 826c522ed1c0..d84a4c7e3c35 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -10585,11 +10585,6 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm) dytc_mmc_get_available = true; } } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */ - /* Support for this only works on AMD platforms */ - if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) { - dbg_printk(TPACPI_DBG_INIT, "PSC not support on Intel platforms\n"); - return -ENODEV; - } pr_debug("PSC is supported\n"); } else { dbg_printk(TPACPI_DBG_INIT, "No DYTC support available\n"); From patchwork Fri May 5 13:25:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Pearson X-Patchwork-Id: 13232681 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 B1365C7EE22 for ; Fri, 5 May 2023 13:25:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232531AbjEENZj (ORCPT ); Fri, 5 May 2023 09:25:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232260AbjEENZh (ORCPT ); Fri, 5 May 2023 09:25:37 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 377601F4A1; Fri, 5 May 2023 06:25:37 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A4F2B5C033F; Fri, 5 May 2023 09:25:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 05 May 2023 09:25:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=squebb.ca; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1683293136; x= 1683379536; bh=QOaw7XzCs4L0ES0o3JcSmPFtMCXKaf9+L8kg0dTL+xI=; b=d yqj9mN46RdQVEWAWdVSTrour+rzDZsXGmc1OD2nNYb56pUcjGbFArpnbwY5xyUTK GCEjCMM1GfXWxGCYRowiJ7+u6ubAensAoHK92dcevPHz/CIA2HLzE1oGXSfes7yM 4MIa74DsegTQ2SLJnpbfThndQSbiid/FcBEf9yibAwHCmtL/D4iCE2rm2Av/5vg+ th0UK0WTHgEZ3gW6JbMiWfwHSF69s856y2alD2KsEzOyftTJtyCv92t0nTnhXPpA XL1UDLNl1TTWpa7CuHwSJwQ98OQGaewuSoehOooS6Ot6wWvZNw/Z/D7k6guHQcXe D+c5Rfx/xuHyGfk6lp2UQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1683293136; x= 1683379536; bh=QOaw7XzCs4L0ES0o3JcSmPFtMCXKaf9+L8kg0dTL+xI=; b=f hupG2IZTwpE9q0xW6szhWt4sE1zXUj8HugoGWlqURkIzWGFT6fdaUD1E+thRNR5L O5ojvesw5tyCWFQGFmtwfxr+ZqwWSmIs4Xm2tffdYgj+dGbSTPAlxfNrfd5+lV79 rn4kGNXu3SohOiY/iJ5/CUpWPGt3aIZTo7WvoJLQUeNIJG9HPBK4Sl4eRnMOSxgQ V1kKkzh9K6LDYgLeKSzChn7BlWtOuJ9l7L6jeB+G9tTZrAtHuaYz41M8A56efejV PnZp/OkATO0yjSzZCNODQPGOVEFp/O//bVFXGzpMsfHl0UDujeg+T0qobIBIXfJX MIRBERaQ87QxtoXwobLqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefvddgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoteeftdduqddtudculdduhedmnecujfgurhephf fvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrrhhkucfrvggrrhhs ohhnuceomhhpvggrrhhsohhnqdhlvghnohhvohesshhquhgvsggsrdgtrgeqnecuggftrf grthhtvghrnhepfedtvdejfeelffevhffgjeejheduteetieeguefgkefhhfegjeduueet hefgvdffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhhpvggrrhhsohhnqdhlvghnohhvohesshhquhgvsggsrdgtrg X-ME-Proxy: Feedback-ID: ibe194615:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 May 2023 09:25:35 -0400 (EDT) From: Mark Pearson To: mpearson-lenovo@squebb.ca Cc: hdegoede@redhat.com, markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] platform/x86: thinkpad_acpi: Add profile force ability Date: Fri, 5 May 2023 09:25:23 -0400 Message-Id: <20230505132523.214338-2-mpearson-lenovo@squebb.ca> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230505132523.214338-1-mpearson-lenovo@squebb.ca> References: <20230505132523.214338-1-mpearson-lenovo@squebb.ca> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org There has been a lot of confusion around which platform profiles are supported on various platforms and it would be useful to have a debug method to be able to override the profile mode that is selected. I don't expect this to be used in anything other than debugging in conjunction with Lenovo engineers - but it does give a way to get a system working whilst we wait for either FW fixes, or a driver fix to land upstream, if something is wonky in the mode detection logic Signed-off-by: Mark Pearson --- drivers/platform/x86/thinkpad_acpi.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index d84a4c7e3c35..2bbb10ac8066 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -10310,6 +10310,7 @@ static atomic_t dytc_ignore_event = ATOMIC_INIT(0); static DEFINE_MUTEX(dytc_mutex); static int dytc_capabilities; static bool dytc_mmc_get_available; +static int profile_force; static int convert_dytc_to_profile(int funcmode, int dytcmode, enum platform_profile_option *profile) @@ -10572,6 +10573,21 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm) if (err) return err; + /* Check if user wants to override the profile selection */ + if (profile_force) { + switch (profile_force) { + case -1: + dytc_capabilities = 0; + break; + case 1: + dytc_capabilities = BIT(DYTC_FC_MMC); + break; + case 2: + dytc_capabilities = BIT(DYTC_FC_PSC); + break; + } + pr_debug("Profile selection forced: 0x%x\n", dytc_capabilities); + } if (dytc_capabilities & BIT(DYTC_FC_MMC)) { /* MMC MODE */ pr_debug("MMC is supported\n"); /* @@ -11633,6 +11649,9 @@ MODULE_PARM_DESC(uwb_state, "Initial state of the emulated UWB switch"); #endif +module_param(profile_force, int, 0444); +MODULE_PARM_DESC(profile_force, "Force profile mode. -1=off, 1=MMC, 2=PSC"); + static void thinkpad_acpi_module_exit(void) { struct ibm_struct *ibm, *itmp;