From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e28smtp02.in.ibm.com ([122.248.162.2]:44909 "EHLO e28smtp02.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750885Ab2FFH6w (ORCPT ); Wed, 6 Jun 2012 03:58:52 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Jun 2012 13:28:47 +0530 Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q567wXMc2228514 for ; Wed, 6 Jun 2012 13:28:33 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q56DRmwp024602 for ; Wed, 6 Jun 2012 23:27:49 +1000 Date: Wed, 6 Jun 2012 15:58:30 +0800 From: Richard Yang To: Richard Yang Cc: Yinghai Lu , Ram Pai , Bjorn Helgaas , linux-pci@vger.kernel.org, Gavin Shan Subject: Re: One chart on pci bridge and its bus and their children Message-ID: <20120606075830.GC17042@richard> Reply-To: Richard Yang References: <20120605032627.GA23271@richard> <20120605041146.GD6637@ram-ThinkPad-T61> <20120605063538.GE6637@ram-ThinkPad-T61> <20120606052835.GB17042@richard> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 In-Reply-To: <20120606052835.GB17042@richard> Sender: linux-pci-owner@vger.kernel.org List-ID: On Wed, Jun 06, 2012 at 01:28:35PM +0800, Richard Yang wrote: >On Tue, Jun 05, 2012 at 12:38:52PM -0700, Yinghai Lu wrote: >>> >>> 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 */ >>>   get_device(&bridge->dev); >> >>self is pointer to pci_dev bridge. >> >>and for root bus, it is NULL. that mean no pci bridge device related. >> >>bridge is device, and have that assigned from host bridge dev, or pci >>bridge dev. >> >>also for virtfn of iov, new bus from there will not have self assigned too. >>for it even bridge is not assigned. >> >>so bridge is just generic way to save bridge (pci, host) device ... > I did a summarize, we have three types of pci_bus. Can we identify the type by following method? +--------------------+--------------------------------------------------+ | bus type | identification | +--------------------+--------------------------------------------------+ | root_bus |parent is NULL, bridge point to host_bridge dev | +--------------------+--------------------------------------------------+ | general_bus |parent to parent bus, bridge point to the bridge | +--------------------+--------------------------------------------------+ | iov_bus |parent to parent bus, bridge point to NULL | +--------------------+--------------------------------------------------+ Hmm... if we can determine which type a pci_bus is from this criteria. Sounds we don't need the self in pci_bus? -- Richard Yang Help you, Help me