summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2012-02-08 03:02:12 +0000
committernp <np@FreeBSD.org>2012-02-08 03:02:12 +0000
commite200cb94e2d78cce4e4c50a9a5ee26334c9ebe71 (patch)
treea2baaaf47a52ea629d61a94c56a035fa258c53f8
parent95e056511ef5d8f6f2c0a75c4e7f8bec0c5ba769 (diff)
downloadFreeBSD-src-e200cb94e2d78cce4e4c50a9a5ee26334c9ebe71.zip
FreeBSD-src-e200cb94e2d78cce4e4c50a9a5ee26334c9ebe71.tar.gz
Allocate the BAR for userspace doorbells after the is_offload check
is functional. MFC after: 3 days
-rw-r--r--sys/dev/cxgb/cxgb_main.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c
index c7c1df0..82008e8 100644
--- a/sys/dev/cxgb/cxgb_main.c
+++ b/sys/dev/cxgb/cxgb_main.c
@@ -473,15 +473,6 @@ cxgb_controller_attach(device_t dev)
device_printf(dev, "Cannot allocate BAR region 0\n");
return (ENXIO);
}
- sc->udbs_rid = PCIR_BAR(2);
- sc->udbs_res = NULL;
- if (is_offload(sc) &&
- ((sc->udbs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
- &sc->udbs_rid, RF_ACTIVE)) == NULL)) {
- device_printf(dev, "Cannot allocate BAR region 1\n");
- error = ENXIO;
- goto out;
- }
snprintf(sc->lockbuf, ADAPTER_LOCK_NAME_LEN, "cxgb controller lock %d",
device_get_unit(dev));
@@ -510,6 +501,17 @@ cxgb_controller_attach(device_t dev)
error = ENODEV;
goto out;
}
+
+ sc->udbs_rid = PCIR_BAR(2);
+ sc->udbs_res = NULL;
+ if (is_offload(sc) &&
+ ((sc->udbs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &sc->udbs_rid, RF_ACTIVE)) == NULL)) {
+ device_printf(dev, "Cannot allocate BAR region 1\n");
+ error = ENXIO;
+ goto out;
+ }
+
/* Allocate the BAR for doing MSI-X. If it succeeds, try to allocate
* enough messages for the queue sets. If that fails, try falling
* back to MSI. If that fails, then try falling back to the legacy
OpenPOWER on IntegriCloud