Module Name: src Committed By: jmcneill Date: Sat Aug 29 19:17:44 UTC 2009
Modified Files: src/sys/dev/acpi: pckbc_acpi.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/dev/acpi/pckbc_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/acpi/pckbc_acpi.c diff -u src/sys/dev/acpi/pckbc_acpi.c:1.31 src/sys/dev/acpi/pckbc_acpi.c:1.32 --- src/sys/dev/acpi/pckbc_acpi.c:1.31 Tue Feb 17 12:46:01 2009 +++ src/sys/dev/acpi/pckbc_acpi.c Sat Aug 29 19:17:44 2009 @@ -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); }