From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e31.co.us.ibm.com ([32.97.110.149]:50925 "EHLO e31.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327Ab2FFB6k (ORCPT ); Tue, 5 Jun 2012 21:58:40 -0400 Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Jun 2012 19:58:39 -0600 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 8F36619D804E for ; Wed, 6 Jun 2012 01:58:23 +0000 (WET) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q561wNTr256724 for ; Tue, 5 Jun 2012 19:58:24 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q561wMVs017284 for ; Tue, 5 Jun 2012 19:58:23 -0600 Date: Wed, 6 Jun 2012 09:58:18 +0800 From: Ram Pai To: Ram Pai Cc: Jiang Liu , Yinghai Lu , Bjorn Helgaas , Richard Yang , linux-pci@vger.kernel.org, Gavin Shan Subject: Re: One chart on pci bridge and its bus and their children Message-ID: <20120606015818.GG6637@ram-ThinkPad-T61> Reply-To: Ram Pai References: <20120605032627.GA23271@richard> <20120605041146.GD6637@ram-ThinkPad-T61> <20120605063538.GE6637@ram-ThinkPad-T61> <4FCE1AA3.5070601@gmail.com> <20120605164019.GF6637@ram-ThinkPad-T61> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20120605164019.GF6637@ram-ThinkPad-T61> Sender: linux-pci-owner@vger.kernel.org List-ID: On Wed, Jun 06, 2012 at 12:40:19AM +0800, Ram Pai wrote: > On Tue, Jun 05, 2012 at 10:41:39PM +0800, Jiang Liu wrote: > > On 06/05/2012 02:35 PM, Ram Pai wrote: > > > On Mon, Jun 04, 2012 at 10:20:51PM -0700, Yinghai Lu wrote: > > >> On Mon, Jun 4, 2012 at 10:18 PM, Yinghai Lu wrote: > > >>> On Mon, Jun 4, 2012 at 9:37 PM, Bjorn Helgaas wrote: > > >>>> That's true, but I don't think it answers the question. If we have: > > >>>> > > >>>> pci_bus->bridge == pci_bus->self->dev > > >>>> > > >>>> why would we need both "self" and "bridge"? It would be interesting > > >>>> to try to remove "bridge" and replace uses of it with "self->dev". > > >>> > > >>> then how about root bus? > > >>> > > >>> root bus ->self should be NULL. > > >>> > > >>> root bus ->bridge is to the hostbridge->dev. > > > > > > Yinghai, > > > > > > is there a reason why this can't be fixed in > > > pci_create_root_bus() by having > > > bus->self = bridge; /* 'bridge' is the pci_device of the corresponding host bridge */ > > Hi Ram, > > A host bridge has no associated pci_device because it's out of the > > PCI domain. PCI domain only covers the hierarchy starting from the host bridge, > > but doesn't include the host bridge itself. > > That makes it even easier to kill pci_bus->bridge. > > for non-root buses, we can access the bridge's device using > bus->self->dev and for root bridges we can silently ignore > the bridge's dev since we know that it does not exist; because > pci_bus->self is null. hmm..ok. I realize the struct device of the host bridge exists and needs to be accessed, even though it is not a pci_device. So killing bus->bridge is not trivial. RP