From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e23smtp02.au.ibm.com ([202.81.31.144]:40871 "EHLO e23smtp02.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751161Ab2FEGlN (ORCPT ); Tue, 5 Jun 2012 02:41:13 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Jun 2012 05:43:40 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q555sl0F62324952 for ; Tue, 5 Jun 2012 15:54:48 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q55624wM001483 for ; Tue, 5 Jun 2012 16:02:05 +1000 Date: Tue, 5 Jun 2012 14:02:02 +0800 From: Richard Yang To: Yinghai Lu Cc: Bjorn Helgaas , Ram Pai , Richard Yang , linux-pci@vger.kernel.org, Gavin Shan Subject: Re: One chart on pci bridge and its bus and their children Message-ID: <20120605060202.GC24358@richard> Reply-To: Richard Yang References: <20120605032627.GA23271@richard> <20120605041146.GD6637@ram-ThinkPad-T61> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 In-Reply-To: Sender: linux-pci-owner@vger.kernel.org List-ID: On Mon, Jun 04, 2012 at 10:18:46PM -0700, 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 Agree, root_pci_bus->self is NULL, and root_pci_bus->bridge point to a solo device structure, not in hostbridge. BTW, if the dev is the hostbrige->dev, why not pci_host_bridge contain a field "dev"? And, why root bus differs with other bus a lot? Both root bus and other bus use self/bridge point to the "PCI BRIDGE" device. I think we can determine whether this is a root bus by bus->parent? -- Richard Yang Help you, Help me