All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Hu <ivan.hu@canonical.com>
To: s.shravan@intel.com, linuxwwan@intel.com, hdegoede@redhat.com,
	markgross@kernel.org, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] platform/x86: intel: int1092: intel_sar: fix _DSM argument4 type mismatch issue
Date: Tue, 15 Aug 2023 18:24:45 +0800	[thread overview]
Message-ID: <20230815102445.7101-1-ivan.hu@canonical.com> (raw)

Encountered a type mismatch as described below:
\_SB.WCCD._DSM: Argument #4 type mismatch - Found [Integer], ACPI requires
[Package]
This is because the argument#4(arg3) is integer.
According to the ACPI specification, the arg3 should be a package.
_DSM (Device Specific Method)
This optional object is a control method that enables devices to provide device
specific control functions that are consumed by the device driver.
Arguments: (4)
Arg0 - A Buffer containing a UUID
Arg1 - An Integer containing the Revision ID
Arg2 - An Integer containing the Function Index
Arg3 - A Package that contains function-specific arguments

The solution involves rectifying arg3 to be a package for the _DSM method.
Furthermore, the firmware needs to ensure that ACPI table arg3 is a package as
well. The suggested amendment is as follows:
If ((Arg3 == Zero))
{
    WDMC [0x02] = WCS0
}
should modify as,
If (((ToInteger(Derefof (Arg3 [Zero]))) == Zero))
{
    WDMC [0x02] = WCS0
}

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 drivers/platform/x86/intel/int1092/intel_sar.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/intel/int1092/intel_sar.c b/drivers/platform/x86/intel/int1092/intel_sar.c
index 6246c066ade2..8fffdce994aa 100644
--- a/drivers/platform/x86/intel/int1092/intel_sar.c
+++ b/drivers/platform/x86/intel/int1092/intel_sar.c
@@ -215,13 +215,17 @@ static void sar_notify(acpi_handle handle, u32 event, void *data)
 
 static void sar_get_data(int reg, struct wwan_sar_context *context)
 {
-	union acpi_object *out, req;
+	union acpi_object *out, req, argv4;
 	u32 rev = 0;
 
-	req.type = ACPI_TYPE_INTEGER;
+	argv4.type = ACPI_TYPE_PACKAGE;
+	argv4.package.count = 1;
+	argv4.package.elements = &req;
+	req.integer.type = ACPI_TYPE_INTEGER;
 	req.integer.value = reg;
+
 	out = acpi_evaluate_dsm_typed(context->handle, &context->guid, rev,
-				      COMMAND_ID_CONFIG_TABLE, &req, ACPI_TYPE_PACKAGE);
+				      COMMAND_ID_CONFIG_TABLE, &argv4, ACPI_TYPE_PACKAGE);
 	if (!out)
 		return;
 	if (out->package.count >= 3 &&
-- 
2.34.1


             reply	other threads:[~2023-08-15 10:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15 10:24 Ivan Hu [this message]
2023-08-21 10:18 ` [PATCH] platform/x86: intel: int1092: intel_sar: fix _DSM argument4 type mismatch issue Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230815102445.7101-1-ivan.hu@canonical.com \
    --to=ivan.hu@canonical.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxwwan@intel.com \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=s.shravan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.