From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 16:54:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19E76106566C; Sun, 5 Feb 2012 16:54:27 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08B508FC1C; Sun, 5 Feb 2012 16:54:27 +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 q15GsQ2m092139; Sun, 5 Feb 2012 16:54:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15GsQcc092137; Sun, 5 Feb 2012 16:54:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051654.q15GsQcc092137@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:54:27 -0000 Author: nwhitehorn Date: Sun Feb 5 16:54:26 2012 New Revision: 231026 URL: http://svn.freebsd.org/changeset/base/231026 Log: Make sure to remap adjusted resources. Modified: head/sys/powerpc/ofw/ofw_pci.c Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 16:53:02 2012 (r231025) +++ head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 16:54:26 2012 (r231026) @@ -431,6 +431,7 @@ ofw_pci_adjust_resource(device_t bus, de { struct rman *rm = NULL; struct ofw_pci_softc *sc = device_get_softc(bus); + int error; switch (type) { case SYS_RES_MEMORY: @@ -445,7 +446,22 @@ ofw_pci_adjust_resource(device_t bus, de if (!rman_is_region_manager(res, rm)) return (EINVAL); - return (rman_adjust_resource(res, start, end)); + + error = rman_adjust_resource(res, start, end); + if (error) + return (error); + + if (rman_get_flags(res) & RF_ACTIVE) { + /* Remap memory resources */ + error = ofw_pci_deactivate_resource(bus, child, type, + rman_get_rid(res), res); + if (error) + return (error); + error = ofw_pci_activate_resource(bus, child, type, + rman_get_rid(res), res); + } + + return (error); }