Page MenuHomeFreeBSD

acpi: Narrow workaround for broken interrupt settings on x86
ClosedPublic

Authored by jhb on Jun 10 2024, 10:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 31, 8:31 AM
Unknown Object (File)
Fri, Oct 25, 6:52 AM
Unknown Object (File)
Sun, Oct 20, 7:17 AM
Unknown Object (File)
Oct 2 2024, 10:28 AM
Unknown Object (File)
Sep 28 2024, 9:27 AM
Unknown Object (File)
Sep 28 2024, 9:25 AM
Unknown Object (File)
Sep 27 2024, 12:23 PM
Unknown Object (File)
Sep 27 2024, 2:42 AM

Details

Summary

Commit 9a7bf07ccdc1 from 2016 introduced a workaround for some broken
BIOSes that specified active-lo instead of active-hi polarity for ISA
IRQs for UARTs. The workaround assumed that edge-sensitive ISA IRQs
on x86 should always be active-hi. However, some recent AMD systems
actually use active-lo edge-sensitive ISA IRQs (and not just for
UARTs, but also for the keyboard and PS/2 mouse devices) and the
override causes interrupts to be dropped resulting in boot time hangs,
non-working keyboards, etc.

Add a hw.acpi.override_isa_irq_polarity tunable (readable as a sysctl
post-boot) to control this quirk. It can be set to 1 to force enable
the override and 0 to disable it. The log of original message
mentions an Intel motherboard as the sample case, so default the
tunable to 1 on systems with an Intel CPU and 0 otherwise.

Special thanks to Matthias Lanter <freebsd@lanter-it.ch> for tracking
down boot time issues on recent AMD systems to mismatched interrupt
polarity.

PR: 270707
Reported by: aixdroix_OSS@protonmail.com, Michael Dexter
Reported by: mfw_burn@pm.me, Hannes Hauswedell <h2+fbsdports@fsfe.org>
Reported by: Matthias Lanter <freebsd@lanter-it.ch>
Reported by: William Bulley <web@umich.edu>
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58605
Build 55493: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Jun 10 2024, 10:08 PM
jhb created this revision.

It's like OKish as is, but a tuneable would let our future selves have an easy-to-deploy diagnostic workaround should this guess become incorrect in the future.

sys/dev/acpica/acpi_resource.c
163

maybe add a 'chicken bit' here so one can turn it on/off via sysctl / tuneable?

This revision is now accepted and ready to land.Jun 10 2024, 11:25 PM
sys/dev/acpica/acpi_resource.c
163

I think having chicken bits per IRQ is probably a bit much to manage, but having a single hw.acpi.isa_irq_override_polarity that is -1 (default, only override for Intel), 0 (never override), 1 (always override) seems sensible to me?

sys/dev/acpica/acpi_resource.c
163

Yea. Do it or do not globally. If there's a big problem, then we can tailor the solution to what we find.

Add a tunable to control the override

This revision now requires review to proceed.Jul 10 2024, 5:55 PM

Is there a nan page that needs to be updated for tye new tuneable?
Otherwise looks good

This revision is now accepted and ready to land.Jul 10 2024, 7:46 PM
emaste added a subscriber: emaste.

What about printing a message when the workaround is applied? It might be useful if non-broken Intel systems show up in the future?

What about printing a message when the workaround is applied? It might be useful if non-broken Intel systems show up in the future?

That is hard to do usefully. We have no device name to print when that happens. I guess we could print the ACPI handle though.

That is hard to do usefully. We have no device name to print when that happens. I guess we could print the ACPI handle though.

Even if someone can report on a mailing list that the last thing they see before the hang is applying ACPI ISA IRQ polarity workaround there's a breadcrumb to follow; if the ACPI handle is the most detail we could provide that's fine. Anyhow I'd be happy for this to land soon with or without the additional log.

Add printf and tunable to man page

This revision now requires review to proceed.Jul 15 2024, 2:16 PM
This revision is now accepted and ready to land.Jul 15 2024, 2:37 PM

Liked it before, love it now...