From patchwork Fri Jun 17 11:19:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Chi X-Patchwork-Id: 1644813 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=v1S9IlUh; dkim-atps=neutral Authentication-Results: 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LPc711kpbz9sG0 for ; Fri, 17 Jun 2022 21:21:16 +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 1o2A2H-0000E3-EN; Fri, 17 Jun 2022 11:21:09 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1o2A2F-0000DT-Su for kernel-team@lists.ubuntu.com; Fri, 17 Jun 2022 11:21:07 +0000 Received: from localhost.localdomain (unknown [10.101.197.31]) (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-canonical-1.canonical.com (Postfix) with ESMTPSA id A277A402A4 for ; Fri, 17 Jun 2022 11:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1655464867; bh=PuHoCfiJ/OxGlPWXe0WBf4pmIdcOq4IB353rGqMIEOY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=v1S9IlUhhMKcFJrXlabRtlPZ1Ck/P7JTPFNtvtkc3tmei4PKVyffYmUJMpMi0yfPJ aHbqvXvyvCn9Mftbp/HqFlc2xQIAjqYB4g5TZnu8SDZnFTyCVQ27QwfWY9Cfuo4mpn lDmmv1xqUrUjRhW4Hkgn7h0Nb+U8L+Nc51yNElAxK5eSPnxAqtbR4IUlz2Y9D7V9aA 382BKcFry5MxX5Lt690sLD2Kmff9Tab4hPAtx2mT+21QkU1Vpl0gUfO6d3IwXDsD1W XMbTeel2CjBFjIBMCbiF8W4tBn4il2LfutOw/0+DQ6gKhbBprk6Q18gWQvFK57j7J0 0PFrLEkDjv+CQ== From: Andy Chi To: kernel-team@lists.ubuntu.com Subject: [SRU][OEM-5.17][PATCH] platform/x86: hp-wmi: Fix hp_wmi_read_int() reporting error (0x05) Date: Fri, 17 Jun 2022 19:19:23 +0800 Message-Id: <20220617111923.64110-4-andy.chi@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220617111923.64110-1-andy.chi@canonical.com> References: <20220617111923.64110-1-andy.chi@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: Jorge Lopez BugLink: http://bugs.launchpad.net/bugs/1979051 The purpose of this patch is to introduce a fix to hp_wmi_read_int() and eliminate failure error (0x05). Several WMI queries leverage hp_wmi_read_int() to read their data and were failing with error 0x05. HPWMI_DISPLAY_QUERY HPWMI_HDDTEMP_QUERY HPWMI_ALS_QUERY HPWMI_HARDWARE_QUERY HPWMI_WIRELESS_QUERY HPWMI_POSTCODEERROR_QUERY The failure occurs because hp_wmi_read_int() calls hp_wmi_perform_query() with input parameter of size greater than zero. Invoking those WMI commands with an input buffer size greater than zero causes the command to be rejected and error 0x05 be returned. All changes were validated on a HP ZBook Workstation notebook, HP EliteBook x360, and HP EliteBook 850 G8. Signed-off-by: Jorge Lopez Link: https://lore.kernel.org/r/20220310210853.28367-2-jorge.lopez2@hp.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede (cherry picked from commit 12b19f14a21a2ee6348825d95b642ef2cd16794f) Signed-off-by: Andy Chi --- drivers/platform/x86/hp-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 88f0bfd6ecf1..29ae35d15a41 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -347,7 +347,7 @@ static int hp_wmi_read_int(int query) int val = 0, ret; ret = hp_wmi_perform_query(query, HPWMI_READ, &val, - sizeof(val), sizeof(val)); + 0, sizeof(val)); if (ret) return ret < 0 ? ret : -EINVAL;