Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi Poll only if we don't have an IRQ resource.



details:   https://anonhg.NetBSD.org/src/rev/0cc9bc4b28e0
branches:  trunk
changeset: 990011:0cc9bc4b28e0
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Oct 23 17:46:26 2021 +0000

description:
Poll only if we don't have an IRQ resource.

diffstat:

 sys/dev/acpi/com_acpi.c |  20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diffs (58 lines):

diff -r 00382be4484f -r 0cc9bc4b28e0 sys/dev/acpi/com_acpi.c
--- a/sys/dev/acpi/com_acpi.c   Sat Oct 23 17:45:55 2021 +0000
+++ b/sys/dev/acpi/com_acpi.c   Sat Oct 23 17:46:26 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: com_acpi.c,v 1.43 2021/10/21 00:56:52 jmcneill Exp $ */
+/* $NetBSD: com_acpi.c,v 1.44 2021/10/23 17:46:26 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2002 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.43 2021/10/21 00:56:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.44 2021/10/23 17:46:26 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -150,8 +150,7 @@
        /* find our IRQ */
        irq = acpi_res_irq(&res, 0);
        if (irq == NULL) {
-               aprint_error_dev(self, "unable to find irq resource\n");
-               goto out;
+               sc->sc_poll_ticks = 1;
        }
 
        if (!com_is_console(iot, base, &ioh))
@@ -175,13 +174,9 @@
 
        sc->sc_type = dce->value;
 
-       if (sc->sc_type == COM_TYPE_DW_APB) {
-               sc->sc_poll_ticks = 1;  /* XXX */
-       } else {
-               if (com_probe_subr(&sc->sc_regs) == 0) {
-                       aprint_error(": com probe failed\n");
-                       goto out;
-               }
+       if (com_probe_subr(&sc->sc_regs) == 0) {
+               aprint_error(": com probe failed\n");
+               goto out;
        }
 
        rv = acpi_dsd_integer(aa->aa_node->ad_handle, "clock-frequency",
@@ -193,10 +188,11 @@
 
        com_attach_subr(sc);
 
-       if (sc->sc_poll_ticks == 0)
+       if (sc->sc_poll_ticks == 0) {
                asc->sc_ih = acpi_intr_establish(self,
                    (uint64_t)(uintptr_t)aa->aa_node->ad_handle,
                    IPL_SERIAL, true, comintr, sc, device_xname(self));
+       }
 
        if (!pmf_device_register(self, NULL, com_resume))
                aprint_error_dev(self, "couldn't establish a power handler\n");



Home | Main Index | Thread Index | Old Index