From owner-freebsd-current@FreeBSD.ORG Thu Feb 6 19:47:10 2014 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCDAE423; Thu, 6 Feb 2014 19:47:10 +0000 (UTC) Received: from mail-ve0-x22b.google.com (mail-ve0-x22b.google.com [IPv6:2607:f8b0:400c:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9521D3C; Thu, 6 Feb 2014 19:47:10 +0000 (UTC) Received: by mail-ve0-f171.google.com with SMTP id pa12so1904932veb.16 for ; Thu, 06 Feb 2014 11:47:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nFEIo8s3qI9tyQVsfxfzZGdfECpuSDpDs3NFgb4+OMQ=; b=MJ0c2BL8tIJ5Xm7D64yUYTDiDpKhpyRc9TC0wqtBUQ9571irX9RIaXFNNyl48jDaim 4E3A5Y+G068cf7eCVawH34IGmIXP/t3MQ2jhgllBaEp6Fj5+BJg2oMhpiwmYI6xW8PfY oJ//rMIp8Lu6rBWw/nplSMvsS1aww9CaEXQ66Vq2an9JigmgaRUvDANJvMVr25hxZiyt oDAT6nmoheXlaMkRvDLsWL8zHIGusgsPEK9KdPq2bEJiinoNXUcmpf8ruaLkjz9dOYJF BB/EbgBjbjXBnKTAeyOeN1mdwExKeptoz3VM8bFolDGKrAEWTfl32w3E5CSboaZwYn2E 1irQ== MIME-Version: 1.0 X-Received: by 10.58.37.232 with SMTP id b8mr2673762vek.27.1391716029361; Thu, 06 Feb 2014 11:47:09 -0800 (PST) Received: by 10.220.168.135 with HTTP; Thu, 6 Feb 2014 11:47:09 -0800 (PST) In-Reply-To: <201402061437.53355.jhb@freebsd.org> References: <201402061437.53355.jhb@freebsd.org> Date: Thu, 6 Feb 2014 14:47:09 -0500 Message-ID: Subject: Re: [PATCH] PCI bus number management From: Thomas Hoffmann To: current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2014 19:47:10 -0000 On Thu, Feb 6, 2014 at 2:37 PM, John Baldwin wrote: > I have a patch to teach the PCI bus code and PCI-PCI bridge driver to > manage > PCI bus numbers. The approach is somewhat similar to how NEW_PCIB manages > I/O > windows for briges. Each bridge creates an rman to manage the bus numbers > for > all buses and bridges that live below it. Each bus allocates a bus > resource > from its parent bridge, and child bridges allocate their ranges from their > parent devices. At the "top" of the PCI tree, the Host-PCI bridges > allocate > their respective bus ranges from their PCI domain/segment. There isn't > really > a device node for PCI domains, so I created a helper API that basically > auto- > creates a PCI bus rman for each domain on first use and then sub-allocates > from that for Host-PCI bridges. > > The current patch (with some extra debugging) is at > http://people.FreeBSD.org/~jhb/patches/pci_bus_rman.3.patch > > I would like to commit this to HEAD soon but thought I would post it for > some > pre-commit testing for the brave. :) If you are really brave, try booting > with 'hw.pci.clear_buses=1' which will force the kernel to renumber all > buses > in the system. If you are really, really brave, try booting with > 'hw.pci.clear_bars=1', 'hw.pci.clear_buses=1', and 'hw.pci.clear_pcib=1'. > (My > laptop survives with all those set) > > Note that the patch only enables bus number management on amd64 and i386. > I > believe ia64 just needs to define PCI_RES_BUS for this to work since it > mandates ACPI. Porting this to other platforms requires handling > PCI_RES_BUS > rseources for Host-PCI bridges in bus_alloc_resource(), > bus_adjust_resource(), > and bus_release_resource(). > > -- > John Baldwin > I get a "404 - Not Found" trying to follow the link.