7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rong Zhang [ Upstream commit 3b53e691e907086672b72d0544e4bf27efd4250d ] Returning NOTIFY_BAD to the AC notifier chain stops it by preventing later notifier blocks from being called, but our error is non-fatal for other AC notifier blocks, which should continue to consume the event. Return NOTIFY_DONE and add a dev_warn() on error, so that the AC notifier chain continues. This also aligns with hp-wmi. The function documentation was copied from elsewhere and makes no sense here, so correct it as well. Fixes: e1a5fe662b59 ("platform/x86: Add Lenovo Capability Data 01 WMI Driver") Cc: stable@vger.kernel.org Tested-by: Navon John Lukose Reviewed-by: Derek J. Clark Reviewed-by: Mark Pearson Signed-off-by: Rong Zhang Link: https://patch.msgid.link/20261019-lwmi-wmi-new-api-v5-2-71557d28d058@rong.moe Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen Signed-off-by: Sasha Levin --- drivers/platform/x86/lenovo/wmi-capdata.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/lenovo/wmi-capdata.c b/drivers/platform/x86/lenovo/wmi-capdata.c index d5e9615661364..58787da959b4a 100644 --- a/drivers/platform/x86/lenovo/wmi-capdata.c +++ b/drivers/platform/x86/lenovo/wmi-capdata.c @@ -774,13 +774,11 @@ static int lwmi_cd_setup(struct lwmi_cd_priv *priv, enum lwmi_cd_type type) /** * lwmi_cd01_notifier_call() - Call method for cd01 notifier. - * block call chain. - * @nb: The notifier_block registered to lenovo-wmi-events driver. + * @nb: The cd01 ACPI notifier_block. * @action: Unused. * @data: The ACPI event. * - * For LWMI_EVENT_THERMAL_MODE, set current_mode and notify platform_profile - * of a change. + * Refresh cached capdata on AC status change. * * Return: notifier_block status. */ @@ -799,8 +797,16 @@ static int lwmi_cd01_notifier_call(struct notifier_block *nb, unsigned long acti switch (event->type) { case ACPI_AC_NOTIFY_STATUS: ret = lwmi_cd_cache(priv); - if (ret) - return NOTIFY_BAD; + if (ret) { + dev_warn(&priv->wdev->dev, + "failed to refresh capdata on AC change: %d\n", ret); + + /* + * Our error is non-fatal for others, and we still want + * the other event consumers to process it. + */ + return NOTIFY_DONE; + } return NOTIFY_OK; default: -- 2.53.0