From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f182.google.com (mail-dy1-f182.google.com [74.125.82.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E93412E7BD6 for ; Sun, 10 May 2026 04:26:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778387165; cv=none; b=X75ln8lOjuy6Y8hMSOfjUumvIL3wnFof+Wml+x4Q1iUjodlAW3ZAOqoHveWzVf95PJZ36bY0Bbn/92vpjto1nLgSIYMMYygJWWux2tq30JZFClfj+GJiCyLyA3G+SRd6e9I1MjKQ60+rvncq7bFZq/TxlmYdmTz5Mms+qIh3ba8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778387165; c=relaxed/simple; bh=cMLvcCzRf16Fy4OllrJfM9VTUlGAhvt/d2WJ+ZYZj/I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Og5HVCkBAzt8UvGKGdst1r6ODkagQAQEmWSnmcZBY00afpCM/5/r5QjME5mDG4BTWUPfurgSjpqCAiRzK0mf1k44Drwu7i60xT7chMxEJj01WWOjR5rzEh5Gvf8GQd834Pp15kyrhhu4y1ketpzeL0du4oLFAMUYDRuhNjsDJ5s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kARFxBVi; arc=none smtp.client-ip=74.125.82.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kARFxBVi" Received: by mail-dy1-f182.google.com with SMTP id 5a478bee46e88-2f3c623322bso5361496eec.0 for ; Sat, 09 May 2026 21:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778387161; x=1778991961; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UwkFBGvTENMc4sGLGliEmbZKBhpnHayO4oiqQfRUuMk=; b=kARFxBVilkFJZsKlFCpaPVYnRNMeZPsPPC8xXYDzSZlE15sq0HexUjD/5vqfbcqigN 8QfqkHoFFivrmLchgntOd1tEpN8aPlYC24iNgBKTTEY5XESUKGeOzg7YVPUtnhLIkee4 8jd0ig2oaoaC1QJ8xMUjTcMkOErL4MYt0YT+eU5wOsbHaY70h+Zn1j5GT18amwxoF0Zu N9WWZPPxqUL+uZi/1fBw4Z9blBETsXCpBWQW/b1z+yf2xjRmfoZYOsuhrEwFQxXJxOY9 PlGd0AWXavXIO+X9gRubxvNTY3gZE7fz/0fIWydDpSCb0PIfu7NG5QlPSaq359i5fHZZ m8Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778387161; x=1778991961; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=UwkFBGvTENMc4sGLGliEmbZKBhpnHayO4oiqQfRUuMk=; b=HEXoHqPTttUWMeCNIT26gak5EDdzn2Q4HVu1fEPPu+OfQ94+H0xLfkGT0fyDyW0Gr5 SLuhrllquEe1DLR0KqbDQtH5SsKP4S7eVmGZUyDz9fuUH13CKPwa5MYzBFqr5B99GGzc wSDG9cXftfr0JO0eeUWf4hsvCCG/Ws1zM943CjNcFxVOaksZNWZWIFDKFuV1GljBGICn WQPGzYY+4uQJshl+GfqlVU+SZasGmxTC6znW979kZqk9e0Scg3VPKS5t9zjU3tlfT9mP IdmpFtKdDEDwzm6PXoEQBObBD6Y5d3/uH9XmU4I39VGb9/1dPjnLFqBpq8XD4RZptWxN +iUQ== X-Forwarded-Encrypted: i=1; AFNElJ/21cJKiY9V+UNxd2zbFXV0ABs7u9/mBfUfh0o6wGuE5pbW291qTumDEWsY4dRjilMvGxSUznX/3YfmOxg=@vger.kernel.org X-Gm-Message-State: AOJu0YxSRT0mONSeGzXU06SVVGaxXm+/+jizEz7KQCvLB/QHPXJpZiDJ zns8LrqXj2VbZ/LKtPE62h4kOVEAkqNK38r001WGPfy2mOkpxfraEMws X-Gm-Gg: Acq92OFfJTQgPc7Ts73ue0HUGA3PM7mCp/DiB1iUoFw98WPUHvrE9eZZ322lxQMMzi2 aDgaoKey9PEXt1FOLTtlZi2SJj6wGr0ea5yubwPssg3uUNLJcVphH1fHmOAJHt9nB5VGTGsYwmk LeQ9finAJblR3VBGbNhVnzDWR/yJ96VVOqpGDX85n3T9e1AFzGPfvUKHJ3m3iLKiwZzLYWt8uKh TFdCg61iT89+EdIuam+VSTVH5hAjEIoSDpCW3TXos1ya8GDsFpc57wyLP82S3Qu+qksA+QNmEIW y1Uq3aTv6M/btc0kTMSwvt/Q6Y4fvVG+1Zemnw4ht4H/kP4ooIuAXF3odm7pvRG3JGw/04QYVP/ 9ZRg/Rwarqv9AJr5JlN0efhacFXpMEuu5HFDworSmRwalGvB6bYHxkFUtJNyns/09eglSKsnMcH IIzCDz6XGDHZXnnzZpZyPLKBHA57duzsQWmT/EUoUZFu2xF/ioXLNhyJqmxiDs8G5E6SgY9w/6t ZGQ X-Received: by 2002:a05:7300:3b08:b0:2c7:3a7:c7a7 with SMTP id 5a478bee46e88-2f54d15fe7amr8804109eec.25.1778387161244; Sat, 09 May 2026 21:26:01 -0700 (PDT) Received: from lappy (108-228-232-20.lightspeed.sndgca.sbcglobal.net. [108.228.232.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2f8862d3047sm10069960eec.10.2026.05.09.21.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2026 21:26:01 -0700 (PDT) From: "Derek J. Clark" To: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Hans de Goede Cc: Mark Pearson , Armin Wolf , Jonathan Corbet , Rong Zhang , Kurt Borja , "Derek J . Clark" , "Pierre-Loup A . Griffais" , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , marshall@shzj.cc, hyacinth@shzj.cc, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v12 14/16] platform/x86: lenovo-wmi-other: Add force_load_psy_ext module parameter Date: Sun, 10 May 2026 04:25:44 +0000 Message-ID: <20260510042546.436874-15-derekjohn.clark@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260510042546.436874-1-derekjohn.clark@gmail.com> References: <20260510042546.436874-1-derekjohn.clark@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Some Lenovo BIOS have been shown to have incomplete and/or broken capability data and WMI attribute IDs. In some cases the capability data reports that a feature is not supported when the get/set methods are fully implemented. It is also possible that the ACPI methods from the ideapad_laptop driver we defer to could be bugged while the WMI method is fully working. To aid end users in submitting more complete bug reports in these situations, add an override to skip the ACPI and compatibility checks to force load the power supply extension as if it is fully supported and has no conflicts. Signed-off-by: Derek J. Clark --- v12: - Move the force_load_psy_ext into its own distinct patch. --- drivers/platform/x86/lenovo/wmi-other.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/platform/x86/lenovo/wmi-other.c b/drivers/platform/x86/lenovo/wmi-other.c index 4d95a9109f5e..007fef658bfe 100644 --- a/drivers/platform/x86/lenovo/wmi-other.c +++ b/drivers/platform/x86/lenovo/wmi-other.c @@ -185,6 +185,16 @@ MODULE_PARM_DESC(relax_fan_constraint, "Enabling this may results in HWMON attributes being out-of-sync, " "and setting a too low RPM stops the fan. Use with caution."); +/* Visibility of power supply extensions */ +static bool force_load_psy_ext; +module_param(force_load_psy_ext, bool, 0444); +MODULE_PARM_DESC(force_load_psy_ext, + "This option will skip checking if the ideapad_laptop driver will conflict " + "with adding an extension to set the battery charge behavior and battery charge " + "control end threshold. It will also skip checking if the BIOS reports that " + "those features are fully supported. It is recommended to blacklist the ideapad " + "driver before using this option."); + /* ======== HWMON (component: lenovo-wmi-capdata 00 & fan) ======== */ /** @@ -898,6 +908,11 @@ static void lwmi_om_psy_ext_init(struct lwmi_om_priv *priv) priv->bh_registered = false; + if (force_load_psy_ext) { + props = LWMI_PSY_PROP_BEHAVIOUR | LWMI_PSY_PROP_THRESHOLD; + goto load_psy_ext; + } + /* Deconflict ideapad_laptop driver */ ret = acpi_get_devices(ideapad_hid, lwmi_acpi_match, &handle, NULL); if (ret) @@ -915,6 +930,7 @@ static void lwmi_om_psy_ext_init(struct lwmi_om_priv *priv) if (!props) return; +load_psy_ext: /* Add battery hooks */ priv->battery_ext = lwmi_psy_exts[props]; priv->battery_hook.add_battery = lwmi_add_battery; -- 2.53.0