Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys/dev/pci Pull up following revision(s) (requested by m...
details: https://anonhg.NetBSD.org/src/rev/329a351271d2
branches: netbsd-6
changeset: 774011:329a351271d2
user: riz <riz%NetBSD.org@localhost>
date: Mon Apr 16 15:34:49 2012 +0000
description:
Pull up following revision(s) (requested by macallan in ticket #182):
sys/dev/pci/ohci_pci.c: revision 1.49
abort attach if memory access is not enabled
this avoids a panic later on when trying to attach to an unconfigured ohci
found for example in later iBooks when DIAGNOSTIC is set
diffstat:
sys/dev/pci/ohci_pci.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diffs (43 lines):
diff -r 32149271f292 -r 329a351271d2 sys/dev/pci/ohci_pci.c
--- a/sys/dev/pci/ohci_pci.c Mon Apr 16 15:28:19 2012 +0000
+++ b/sys/dev/pci/ohci_pci.c Mon Apr 16 15:34:49 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci_pci.c,v 1.48 2012/01/30 19:41:22 drochner Exp $ */
+/* $NetBSD: ohci_pci.c,v 1.48.2.1 2012/04/16 15:34:49 riz Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci_pci.c,v 1.48 2012/01/30 19:41:22 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci_pci.c,v 1.48.2.1 2012/04/16 15:34:49 riz Exp $");
#include "ehci.h"
@@ -96,6 +96,16 @@
pci_aprint_devinfo(pa, "USB Controller");
+ /* check if memory space access is enabled */
+ csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
+#ifdef DEBUG
+ printf("csr: %08x\n", csr);
+#endif
+ if ((csr & PCI_COMMAND_MEM_ENABLE) == 0) {
+ aprint_error_dev(self, "memory access is disabled\n");
+ return;
+ }
+
/* Map I/O registers */
if (pci_mapreg_map(pa, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc.iot, &sc->sc.ioh, NULL, &sc->sc.sc_size)) {
@@ -113,7 +123,6 @@
sc->sc.sc_bus.dmatag = pa->pa_dmat;
/* Enable the device. */
- csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG,
csr | PCI_COMMAND_MASTER_ENABLE);
Home |
Main Index |
Thread Index |
Old Index