diff options
author | Damien Zammit <damien@zamaudio.com> | 2024-10-23 00:34:54 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-10-24 01:02:18 +0200 |
commit | a03f464aaac2767f0560f272f832e0bf0560e61d (patch) | |
tree | 2279db8d7f2d65f9a148c243f4929da9c8e3382f | |
parent | eafdd4d871e4bd96db7e1524976dbecf5c292461 (diff) | |
download | hurd-a03f464aaac2767f0560f272f832e0bf0560e61d.tar.gz hurd-a03f464aaac2767f0560f272f832e0bf0560e61d.tar.bz2 hurd-a03f464aaac2767f0560f272f832e0bf0560e61d.zip |
irqhelp: Dont bail when cannot connect to acpi
As the acpi translator requires libirqhelp, we cannot fail when
libirqhelp cannot connect to acpi translator, break the egg/chicken.
acpi translator will only call the irqhelp api with fixed gsi during startup,
so won't require itself to be started yet.
Message-ID: <20241023003446.2994643-1-damien@zamaudio.com>
-rw-r--r-- | libirqhelp/irqhelp.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libirqhelp/irqhelp.c b/libirqhelp/irqhelp.c index 985885b9..814fd71c 100644 --- a/libirqhelp/irqhelp.c +++ b/libirqhelp/irqhelp.c @@ -51,6 +51,7 @@ struct irq { static mach_port_t irqdev = MACH_PORT_NULL; static mach_port_t acpidev = MACH_PORT_NULL; +static bool acpi_missing = false; static error_t get_acpi(void) @@ -72,7 +73,10 @@ get_acpi(void) tryacpi = file_name_lookup (_SERVERS_ACPI, O_RDONLY, 0); if (tryacpi == MACH_PORT_NULL) - return ENODEV; + { + acpi_missing = true; + return ENODEV; + } acpidev = tryacpi; return 0; @@ -129,10 +133,7 @@ irqhelp_init(void) err = get_acpi(); if (err) - { - log_error("cannot grab acpi device\n"); - return err; - } + log_error("cannot grab acpi device, continuing\n"); inited = true; return 0; @@ -320,6 +321,12 @@ irqhelp_install_interrupt_handler(int gsi, if (gsi < 0) { + if (acpi_missing) + { + log_error("requires valid gsi when acpi device is missing\n"); + return NULL; + } + if ((bus < 0) || (dev < 0) || (fun < 0)) { log_error("invalid b/d/f\n"); |