Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi PR# port-i386/39671: panic while booting with a...



details:   https://anonhg.NetBSD.org/src/rev/b1d0f64e31f6
branches:  trunk
changeset: 747042:b1d0f64e31f6
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Aug 29 19:17:44 2009 +0000

description:
PR# port-i386/39671: panic while booting with an acpi kernel on a 790GX board

If the firmware describes duplicate keyboard controller nodes, don't panic
when the driver fails to map registers.

diffstat:

 sys/dev/acpi/pckbc_acpi.c |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (46 lines):

diff -r e381b1a992b8 -r b1d0f64e31f6 sys/dev/acpi/pckbc_acpi.c
--- a/sys/dev/acpi/pckbc_acpi.c Sat Aug 29 14:18:34 2009 +0000
+++ b/sys/dev/acpi/pckbc_acpi.c Sat Aug 29 19:17:44 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pckbc_acpi.c,v 1.31 2009/02/17 12:46:01 jmcneill Exp $ */
+/*     $NetBSD: pckbc_acpi.c,v 1.32 2009/08/29 19:17:44 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pckbc_acpi.c,v 1.31 2009/02/17 12:46:01 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbc_acpi.c,v 1.32 2009/08/29 19:17:44 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -206,8 +206,11 @@
                        if (bus_space_map(aa->aa_iot, io0->ar_base,
                                          io0->ar_length, 0, &ioh_d) ||
                            bus_space_map(aa->aa_iot, io1->ar_base,
-                                         io1->ar_length, 0, &ioh_c))
-                               panic("pckbc_acpi_attach: couldn't map");
+                                         io1->ar_length, 0, &ioh_c)) {
+                               aprint_error_dev(self,
+                                   "unable to map registers\n");
+                               goto out;
+                       }
 
                        t = malloc(sizeof(struct pckbc_internal),
                            M_DEVBUF, M_WAITOK|M_ZERO);
@@ -228,9 +231,11 @@
 
                first->sc_pckbc.intr_establish = pckbc_acpi_intr_establish;
                config_defer(first->sc_pckbc.sc_dv, pckbc_acpi_finish_attach);
-       } else if (!pmf_device_register(self, NULL, NULL))
+       }
+
+out:
+       if (!pmf_device_register(self, NULL, NULL))
                aprint_error_dev(self, "couldn't establish power handler\n");
- out:
        acpi_resource_cleanup(&res);
 }
 



Home | Main Index | Thread Index | Old Index