From patchwork Thu Jun 10 06:47:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1490205 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=I6UDMXM/; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0vgm5FyYz9sX5; Thu, 10 Jun 2021 16:48:20 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lrEUD-0002ah-5w; Thu, 10 Jun 2021 06:48:17 +0000 Received: from mail-pf1-f176.google.com ([209.85.210.176]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lrEUA-0002Xr-W5 for kernel-team@lists.ubuntu.com; Thu, 10 Jun 2021 06:48:15 +0000 Received: by mail-pf1-f176.google.com with SMTP id u18so772766pfk.11 for ; Wed, 09 Jun 2021 23:48:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bWx6KbwgBvFCl7R0/CRyByKUZh/CxxSVDZ0AMvMKdm0=; b=I6UDMXM/AfQqIFEo7yfIelm5uGBcwaenVbQ+lpqATTF+IaGGsjRaziOZCjs8ecV1NX QkGSA89T36MiiWxu9ZqCg8XbkywF/RqizN9xlZ5JEjYX0gD1m4cm2UdOJ7I0jQDmzgXP q138IdUXRIROWMHrtto8HtVlAmac2jugZvnFaehR7qYSyeJ2p/cFJ/I7p6SJSfV40UHD oxpvgnDXzO+hq+qjKYI5a5UmiP7jLuEMjnNS6+NPtfvrPol/0eW5RaPgtX/i9txtmqew yyOZegDbirEWXKVQsABiChL9n+Gq9lff7iyVpGBsrFyWjsD56COaDgK6yaFed5RXczrp hgVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=bWx6KbwgBvFCl7R0/CRyByKUZh/CxxSVDZ0AMvMKdm0=; b=QdvVdWxoYCMb0tKEc1Gs2De3CL/oBOHrR3TURFiEkC+oWt3H5jSL4iaCeDpeovvNhf n7Wdq6HSpfOQG4/v+vvv5eFiEIDx0yCTDlW9T1yHM5T1bRYDZnNHs057+r8bID7JSXiH Hx78902diz5hXxUMkNbZLeDjjfOhgGwbBJpPQf/JIelrE6qRWeuagbsV5bJZSvkClG7Y OSJK8+F8jngHMvtcPcPOZXgItmuJjV8v8yFv0rjj6OGZbldNYcUYlz32WolS4ca8dsFT WYh+LLoLuZKHe7k5RbqG4NoR1AGFm9u0X19q+c3o6RnAtrSDiQTBNYgcKTF3F04dxOJU p+Yw== X-Gm-Message-State: AOAM5327NgebrXWTh3WD/EYejfH8X6BKJZF31BvXvZGyD68YmlOdCP+S ZY8qfRZcTicTUz86jX6/0+kuY/PX/dEDy+sZ X-Google-Smtp-Source: ABdhPJyZsF/Sm1hjOJ50SBmSx/bSE/4q+3yQs8RDQgWpqfTIQ9Fq5pOAVxE805CQRRdFNCar+sKMcg== X-Received: by 2002:a63:3603:: with SMTP id d3mr3506266pga.346.1623307692192; Wed, 09 Jun 2021 23:48:12 -0700 (PDT) Received: from localhost (220-135-95-34.HINET-IP.hinet.net. [220.135.95.34]) by smtp.gmail.com with ESMTPSA id d24sm1510242pjv.49.2021.06.09.23.48.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 23:48:11 -0700 (PDT) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/7][SRU][OEM-5.10] platform/x86: dell-wmi-sysman: Make sysman_init() return -ENODEV of the interfaces are not found Date: Thu, 10 Jun 2021 14:47:52 +0800 Message-Id: <20210610064754.1061717-6-acelan.kao@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210610064754.1061717-1-acelan.kao@canonical.com> References: <20210610064754.1061717-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.176; envelope-from=acelan@gmail.com; helo=mail-pf1-f176.google.com 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: Hans de Goede BugLink: https://bugs.launchpad.net/bugs/1931509 When either the attributes or the password interface is not found, then unregister the 2 wmi drivers again and return -ENODEV from sysman_init(). Fixes: e8a60aa7404b ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems") Cc: Divya Bharathi Cc: Mario Limonciello Reported-by: Alexander Naumann Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20210321115901.35072-7-hdegoede@redhat.com (cherry picked from commit 9b95665a83ec555f441f5681daa58f75828d0255) Signed-off-by: Chia-Lin Kao (AceLan) --- drivers/platform/x86/dell/dell-wmi-sysman/sysman.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c index 99dc2f3bdf49e..5dd9b29d939c7 100644 --- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c +++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c @@ -506,15 +506,17 @@ static int __init sysman_init(void) } ret = init_bios_attr_set_interface(); - if (ret || !wmi_priv.bios_attr_wdev) { - pr_debug("failed to initialize set interface\n"); + if (ret) return ret; - } ret = init_bios_attr_pass_interface(); - if (ret || !wmi_priv.password_attr_wdev) { - pr_debug("failed to initialize pass interface\n"); + if (ret) goto err_exit_bios_attr_set_interface; + + if (!wmi_priv.bios_attr_wdev || !wmi_priv.password_attr_wdev) { + pr_debug("failed to find set or pass interface\n"); + ret = -ENODEV; + goto err_exit_bios_attr_pass_interface; } ret = class_register(&firmware_attributes_class);