From owner-svn-src-stable@FreeBSD.ORG Mon Feb 13 19:35:39 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36FC3106566C; Mon, 13 Feb 2012 19:35:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25B368FC08; Mon, 13 Feb 2012 19:35:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1DJZd76058508; Mon, 13 Feb 2012 19:35:39 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1DJZckg058506; Mon, 13 Feb 2012 19:35:38 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202131935.q1DJZckg058506@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 13 Feb 2012 19:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231604 - stable/9/sys/dev/cxgb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 19:35:39 -0000 Author: np Date: Mon Feb 13 19:35:38 2012 New Revision: 231604 URL: http://svn.freebsd.org/changeset/base/231604 Log: MFC r231175: Allocate the BAR for userspace doorbells after the is_offload check is functional. Modified: stable/9/sys/dev/cxgb/cxgb_main.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_main.c Mon Feb 13 19:35:35 2012 (r231603) +++ stable/9/sys/dev/cxgb/cxgb_main.c Mon Feb 13 19:35:38 2012 (r231604) @@ -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