Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

acpi_reset(): direct IO writes

2 views
Skip to first unread message

Paul Irofti

unread,
Aug 4, 2016, 11:22:29 AM8/4/16
to
Hi,

I came across this bit when trying to fix the random boot freezes after
rebooting OpenBSD on the Skylake x260. It does not seem to improve things
on this particular machine but it might help others according to Linux.

I do not know if we should commit this, I am mostly sending this for
reference. If it fixes your machine or you think it is worth putting it
in let me know.

Paul


Index: dev/acpi/acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.313
diff -u -p -u -p -r1.313 acpi.c
--- dev/acpi/acpi.c 28 Jul 2016 21:57:56 -0000 1.313
+++ dev/acpi/acpi.c 4 Aug 2016 14:56:12 -0000
@@ -1793,6 +1793,17 @@ acpi_reset(void)
!(fadt->flags & FADT_RESET_REG_SUP) || fadt->reset_reg.address == 0)
return;

+ /*
+ * Bypass gasio validation mechanism for I/O space for it may block
+ * valid writes to the reset register.
+ *
+ * Force register width as it fixes BIOS code with bad registers.
+ */
+ if (fadt->reset_reg.address_space_id == GAS_SYSTEM_IOSPACE) {
+ outb(fadt->reset_reg.address, fadt->reset_value);
+ return;
+ }
+
value = fadt->reset_value;

reset_as = fadt->reset_reg.register_bit_width / 8;

0 new messages