[Bug 245778] ACPI not detecting battery properly on HP Spectre x360 13-ap0053dx 13-CURRENT between base r359837 and base r360134
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Thu Apr 23 02:13:29 UTC 2020
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245778
--- Comment #11 from Conrad Meyer <cem at freebsd.org> ---
(In reply to Neel Chauhan from comment #6)
The acpidump seems to be missing disassembled DSDT, unfortunately.
@Neel, @Evilham, please try the following change.
--- a/sys/dev/acpica/acpi_ec.c
+++ b/sys/dev/acpica/acpi_ec.c
@@ -443,6 +443,8 @@ acpi_ec_probe(device_t dev)
if (buf.Pointer)
AcpiOsFree(buf.Pointer);
+
+ ret = rc;
out:
if (ret <= 0) {
snprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s",
In the case where there was no error when we got to 'out', r360131
inadvertently left 'ret' with the initial ENXIO value. The patch above
restores the pre-r360131 return value if no errors occurred.
If that change doesn't work, here's one with further debugging in all of the
error cases:
--- a/sys/dev/acpica/acpi_ec.c
+++ b/sys/dev/acpica/acpi_ec.c
@@ -397,6 +397,7 @@ acpi_ec_probe(device_t dev)
*/
peer = devclass_get_device(acpi_ec_devclass, params->uid);
if (peer != NULL && device_is_alive(peer)) {
+ device_printf(dev, "XXX duplicate case\n");
device_disable(dev);
goto out;
}
@@ -417,8 +418,10 @@ acpi_ec_probe(device_t dev)
}
obj = (ACPI_OBJECT *)buf.Pointer;
- if (obj == NULL)
+ if (obj == NULL) {
+ device_printf(dev, "XXX _GPE NULL result\n");
goto out;
+ }
switch (obj->Type) {
case ACPI_TYPE_INTEGER:
@@ -426,12 +429,16 @@ acpi_ec_probe(device_t dev)
params->gpe_bit = obj->Integer.Value;
break;
case ACPI_TYPE_PACKAGE:
- if (!ACPI_PKG_VALID(obj, 2))
+ if (!ACPI_PKG_VALID(obj, 2)) {
+ device_printf(dev, "XXX _GPE invalid PKG\n");
goto out;
+ }
params->gpe_handle = acpi_GetReference(NULL,
&obj->Package.Elements[0]);
if (params->gpe_handle == NULL ||
- acpi_PkgInt32(obj, 1, ¶ms->gpe_bit) != 0)
+ acpi_PkgInt32(obj, 1, ¶ms->gpe_bit) != 0) {
+ device_printf(dev, "XXX _GPE NULL handle or bad bit\n");
goto out;
+ }
break;
default:
device_printf(dev, "_GPE has invalid type %d\n", obj->Type);
@@ -443,6 +450,8 @@ acpi_ec_probe(device_t dev)
if (buf.Pointer)
AcpiOsFree(buf.Pointer);
+
+ ret = rc;
out:
if (ret <= 0) {
snprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s",
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the freebsd-acpi
mailing list