From patchwork Fri Jun 17 11:19:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Chi X-Patchwork-Id: 1644810 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=Oh5mzyOZ; 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 4LPc704wnSz9sGY for ; Fri, 17 Jun 2022 21:21:15 +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 1o2A2F-0000D9-8o; Fri, 17 Jun 2022 11:21:07 +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 1o2A2D-0000Cx-Lz for kernel-team@lists.ubuntu.com; Fri, 17 Jun 2022 11:21:05 +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 AAA31402A4 for ; Fri, 17 Jun 2022 11:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1655464865; bh=vuOSdlJpmt3GKkoU/qAFUpBzXG/4zh5OVkBpy9yYFyY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Oh5mzyOZ6OwJ6HfIepZjRV3C/6O3rHGJoCo7tqEhjK3NtTN0xt7ucYuaEhCnMd3VU pZvZ3pw8hdRyVbURj458oHYEMYCYGzBy5ePBynSyVyFSDGmITPUsXbtGosqWj56//f Q9jtF0vYQE2d8O4jYnmQfsSKfP5j+rv+OI4NWL2TbMaphsmELXV1Ak7AEZNm5309a1 6RxtpSVfzjh4vpcUBZuuJWWtKNmZF9ehUUMxgPw61HaUWnh2jCLOlUXjeoOn1kIcqY XVxREC7zDDmowek6qPpGWL/mfzPcIifb6n6YOcTp097l/BPvJnamm5Pymb64IRNy4y /18qbN1BeRyLg== From: Andy Chi To: kernel-team@lists.ubuntu.com Subject: [SRU][OEM-5.14][PATCH 1/1] platform/x86: hp-wmi: Fix hp_wmi_read_int() reporting error (0x05) Date: Fri, 17 Jun 2022 19:19:22 +0800 Message-Id: <20220617111923.64110-3-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 027a1467d009..0495a31a9cee 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -284,7 +284,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;