From: anton Date: Tue, 21 Dec 2021 06:09:47 +0000 (+0000) Subject: Do not attach com at acpi when there's no address or irq present. Fixes X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=13d9046141627041dbc9b6940ea8996feb1c6c31;p=openbsd Do not attach com at acpi when there's no address or irq present. Fixes a regression caused by the recent change to start attaching com at acpi as it turns out that Libreboot exposes console devices lacking crucial data in their acpi tables. The same console attaches fine over isa, therefore restore this behavior. Problem reported by on bugs@ ok deraadt@ kettenis@ --- diff --git a/sys/dev/acpi/com_acpi.c b/sys/dev/acpi/com_acpi.c index 12e61288181..0cddb4f5529 100644 --- a/sys/dev/acpi/com_acpi.c +++ b/sys/dev/acpi/com_acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com_acpi.c,v 1.3 2021/12/16 08:03:17 anton Exp $ */ +/* $OpenBSD: com_acpi.c,v 1.4 2021/12/21 06:09:47 anton Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -63,6 +63,8 @@ com_acpi_match(struct device *parent, void *match, void *aux) struct acpi_attach_args *aaa = aux; struct cfdata *cf = match; + if (aaa->aaa_naddr < 1 || aaa->aaa_nirq < 1) + return 0; return acpi_matchhids(aaa, com_hids, cf->cf_driver->cd_name); } @@ -77,16 +79,6 @@ com_acpi_attach(struct device *parent, struct device *self, void *aux) sc->sc_node = aaa->aaa_node; printf(" %s", sc->sc_node->name); - if (aaa->aaa_naddr < 1) { - printf(": no registers\n"); - return; - } - - if (aaa->aaa_nirq < 1) { - printf(": no interrupt\n"); - return; - } - printf(" addr 0x%llx/0x%llx", aaa->aaa_addr[0], aaa->aaa_size[0]); printf(" irq %d", aaa->aaa_irq[0]);