[Bug 227191] Cannot check battery status after upgrading to 12-CURRENT from r330529 to r331748 (ACPI problems)
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Apr 6 15:27:17 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227191
--- Comment #4 from Conrad Meyer <cem at freebsd.org> ---
Your dmesg line seems related (BAT0):
ACPI Error: Method parse/execution failed \134_SB.PCI0.LPCB.EC0.BAT0._STA,
AE_NOT_EXIST
Nothing changed in any of the dmesg-mentioned files (evregion, exfldio,
psparse) in that commit. Hmm.
However, these changes are suspect:
sys/contrib/dev/acpica/components/namespace/nsxfname.c
- * For Device and Processor objects, run the Device _HID, _UID, _CID, _STA,
+ * For Device and Processor objects, run the Device _HID, _UID, _CID,
...
- * this was the fate of the _SUB method which was found to cause such
- * problems and was removed (11/2015).
+ * Because of this reason support for the following methods has been removed:
+ * 1) _SUB method was removed (11/2015)
+ * 2) _STA method was removed (02/2018)
- *
- * For _STA, if the method does not exist, then (as per the ACPI
- * specification), the returned CurrentStatus flags will indicate
- * that the device is present/functional/enabled. Otherwise, the
- * CurrentStatus flags reflect the value returned from _STA.
*/
- /* Execute the Device._STA method */
-
- Status = AcpiUtExecute_STA (Node, &Info->CurrentStatus);
- if (ACPI_SUCCESS (Status))
- {
- Valid |= ACPI_VALID_STA;
- }
sys/contrib/dev/acpica/changes.txt
+AcpiGetObjectInfo - removed support for the _STA method. This was causing
+problems on some platforms.
And removing it clearly causes problems on others, so...
sys/dev/acpica/acpi.c
BOOLEAN
acpi_DeviceIsPresent(device_t dev)
{
- ACPI_DEVICE_INFO *devinfo;
- ACPI_HANDLE h;
- BOOLEAN present;
+ ACPI_HANDLE h;
+ UINT32 s;
+ ACPI_STATUS status;
- if ((h = acpi_get_handle(dev)) == NULL ||
- ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo)))
- return (FALSE);
+ h = acpi_get_handle(dev);
+ if (h == NULL)
+ return (FALSE);
+ status = acpi_GetInteger(h, "_STA", &s);
- /* If no _STA method, must be present */
- present = (devinfo->Valid & ACPI_VALID_STA) == 0 ||
- ACPI_DEVICE_PRESENT(devinfo->CurrentStatus) ? TRUE : FALSE;
+ /* If no _STA method, must be present */
+ if (ACPI_FAILURE(status))
+ return (status == AE_NOT_FOUND ? TRUE : FALSE);
...
+ return (ACPI_DEVICE_PRESENT(s) ? TRUE : FALSE);
Ok, this function should behave more or less the same as before...
A similar change was made to acpi_BatteryIsPresent(), but again I don't see the
problem.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-acpi
mailing list