summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2014-11-27 19:03:45 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2014-11-27 19:03:45 +0000
commitecfe7fa418e95705a652be4f3acbb33f6f0247f4 (patch)
treee4fb60f7720dd33a0c76fc3ba40ea710e4852f71 /sys/dev
parentc6cf3930f61feed15a05318e2b67b95a28d17a3a (diff)
Previous change wasn't quite right and broke "classic' PCI sparc64 machines.
Undo the code rearrangement in rev. 1.108 but keep the sparc64-specific code dealing with non-prefetchable 64-bit BARs. Found out the hard way by stsp@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/pci.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 65aae5d7ca8..4105ac49969 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci.c,v 1.108 2014/11/26 09:29:17 kettenis Exp $ */
+/* $OpenBSD: pci.c,v 1.109 2014/11/27 19:03:44 kettenis Exp $ */
/* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */
/*
@@ -847,10 +847,6 @@ pci_reserve_resources(struct pci_attach_args *pa)
base, size, EX_NOWAIT) == 0) {
break;
}
- if (pa->pa_memex && extent_alloc_region(pa->pa_memex,
- base, size, EX_NOWAIT) == 0) {
- break;
- }
#ifdef __sparc64__
/*
* Certain SPARC T5 systems assign
@@ -868,21 +864,22 @@ pci_reserve_resources(struct pci_attach_args *pa)
break;
}
#endif
- printf("%d:%d:%d: mem address conflict 0x%lx/0x%lx\n",
- bus, dev, func, base, size);
- pci_conf_write(pc, tag, reg, 0);
- if (type & PCI_MAPREG_MEM_TYPE_64BIT)
- pci_conf_write(pc, tag, reg + 4, 0);
+ if (pa->pa_memex && extent_alloc_region(pa->pa_memex,
+ base, size, EX_NOWAIT)) {
+ printf("%d:%d:%d: mem address conflict 0x%lx/0x%lx\n",
+ bus, dev, func, base, size);
+ pci_conf_write(pc, tag, reg, 0);
+ if (type & PCI_MAPREG_MEM_TYPE_64BIT)
+ pci_conf_write(pc, tag, reg + 4, 0);
+ }
break;
case PCI_MAPREG_TYPE_IO:
if (pa->pa_ioex && extent_alloc_region(pa->pa_ioex,
- base, size, EX_NOWAIT) == 0) {
- break;
+ base, size, EX_NOWAIT)) {
+ printf("%d:%d:%d: io address conflict 0x%lx/0x%lx\n",
+ bus, dev, func, base, size);
+ pci_conf_write(pc, tag, reg, 0);
}
-
- printf("%d:%d:%d: io address conflict 0x%lx/0x%lx\n",
- bus, dev, func, base, size);
- pci_conf_write(pc, tag, reg, 0);
break;
}