FYI, this is resolved now for those Getac devices (or at least looks
like it). I've started a separate thread a while back in @tech to try
and document this issue more in-depth. Turned out to be a "division"
issue in sys/dev/acpi/dsdt.c., would be great if someone more
knowledgeable could check the findings and patch included here
https://marc.info/?l=openbsd-tech&m=174228399414357
Potentially could also solve other issues where this type of AML
division is used in DSDT.

Adding the patch here also for reference:
Index: sys/dev/acpi/dsdt.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v
diff -u -p -u -p -r1.273 dsdt.c
--- sys/dev/acpi/dsdt.c    23 Jan 2025 13:40:26 -0000    1.273
+++ sys/dev/acpi/dsdt.c    18 Mar 2025 07:43:40 -0000
@@ -4037,12 +4037,12 @@ aml_parse(struct aml_scope *scope, int r
             break;
         }
         ival = aml_evalexpr(opargs[0]->v_integer,
-            opargs[1]->v_integer, AMLOP_MOD);
-        aml_store(scope, opargs[2], ival, NULL);
-
-        ival = aml_evalexpr(opargs[0]->v_integer,
             opargs[1]->v_integer, AMLOP_DIVIDE);
         aml_store(scope, opargs[3], ival, NULL);
+
+        ival = aml_evalexpr(opargs[0]->v_integer,
+            opargs[1]->v_integer, AMLOP_MOD);
+        aml_store(scope, opargs[2], ival, NULL);
         break;
     case AMLOP_NOT:
     case AMLOP_TOBCD:

PS: apologies for spamming both lists with this issue.

On Wed, Oct 16, 2024 at 7:24 AM Peter Toth <peter.toth...@gmail.com> wrote:
>
> Hi all,
>
> Looking for some clues on acpibat and partial sensor info. Some of the
> sensor data is populated while others are missing.
>
> Current situation:
> hw.sensors.acpibat0.volt0=11.10 VDC (voltage)
> hw.sensors.acpibat0.volt1=12.51 VDC (current voltage)
> hw.sensors.acpibat0.current0=0.00 A (rate)
> hw.sensors.acpibat0.amphour0=4.00 Ah (last full capacity)
> hw.sensors.acpibat0.amphour1=0.00 Ah (warning capacity)
> hw.sensors.acpibat0.amphour2=0.00 Ah (low capacity)
> hw.sensors.acpibat0.amphour3=0.00 Ah (remaining capacity), OK
> hw.sensors.acpibat0.amphour4=4.20 Ah (design capacity)
> hw.sensors.acpibat0.raw0=1 (battery discharging), OK
>
> Most work OK even hw.sensors.acpibat0.current0 reports both charge and
> discharge rates.
>
> Skimmed through acpibat and sensors code a bit and perhaps the battery
> parsing of DSDT properties could be causing this. Manufacturer is
> Getac. Looking for some clues where else to look.

Reply via email to