opnsense-src/sys/dev/acpica
Bartosz Fabianowski 3c59c4453f ACPI: Treat all 20-element _BIX entires as revision 0
Some Fujitsu Lifebooks return an invalid _BIX object. The first element
of _BIX is a revision number, which indicates what elements will follow:
* ACPI 4.0 defined _BIX revision 0 with 20 elements.
* ACPI 6.0 introduced _BIX revision 1 with 21 elements.
The problem is that the offending Lifebooks have the a non-zero _BIX
revision, but provide 20 fields only.

The ACPICA parser chokes on this [1], but that seems to be
inconsequential. More importantly, our own battery info handling code
also verifies that for revision > 0, there are at least 21 fields - and
refuses to process the invalid _BIX. One workaround would be to
introduce special case / quirk handling for Fujitsu Lifebooks. A better
one is to relax the requirements check: If there are only 20 elements,
treat the _BIX as revision 0, no matter what revision number was
provided by the device.

Linux doesn't run into this problem by the way because it only supports
the 20 fields defined in the ACPI 4.0 spec [3]. It never looks at the
revision number or the 21st field added in ACPI 6.0.

[1] https://cgit.freebsd.org/src/tree/sys/contrib/dev/acpica/components/namespace/nsprepkg.c#n815
[2] https://cgit.freebsd.org/src/tree/sys/dev/acpica/acpi_cmbat.c#n371
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/acpi/battery.c#n418

PR: 252030
Reviewed by: imp
MFC After: 2 weeks

(cherry picked from commit cd8c3af747cc300c8257c315c7576644e2bb86ff)
2024-12-06 17:11:27 -07:00
..
Osd pci_cfgreg: Add a PCI domain argument to the low-level register API 2024-01-18 14:44:51 -08:00
acpi.c acpica: add domain ivar 2024-12-03 02:39:22 +02:00
acpi_acad.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_apei.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_battery.c acpi_battery: avoid divide-by-zero when no devices have capacity info 2024-04-19 03:16:52 +00:00
acpi_bus_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_button.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_cmbat.c ACPI: Treat all 20-element _BIX entires as revision 0 2024-12-06 17:11:27 -07:00
acpi_container.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_cpu.c acpi_cpu: Reduce BUS_MASTER_RLD manipulations 2024-01-19 11:29:21 -05:00
acpi_dock.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_ec.c acpi: Use device_set_descf() 2024-06-09 09:37:55 -04:00
acpi_ged.c acpi_ged: Handle events directly 2024-10-28 19:02:24 -04:00
acpi_hpet.c acpi_hpet: Make use of enum for vm_guest to improve readability 2024-03-31 23:54:48 +08:00
acpi_hpet.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_isab.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_lid.c acpi_lid: Remove duplicate events 2024-01-19 11:39:28 -05:00
acpi_package.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pci.c acpica: add domain ivar 2024-12-03 02:39:22 +02:00
acpi_pci_link.c acpi: Use device_set_descf() 2024-06-09 09:37:55 -04:00
acpi_pcib.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pcib_acpi.c pci_cfgreg: Add a PCI domain argument to the low-level register API 2024-01-18 14:44:51 -08:00
acpi_pcib_pci.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pcibvar.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_pcivar.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_perf.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_powerres.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pxm.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_quirk.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_quirks sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_resource.c acpi: Narrow workaround for broken interrupt settings on x86 2024-07-22 15:54:14 -04:00
acpi_smbat.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_smbus.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_thermal.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_throttle.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_timer.c acpi: Use device_set_descf() 2024-06-09 09:37:55 -04:00
acpi_video.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpiio.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpivar.h acpica: add domain ivar 2024-12-03 02:39:22 +02:00