From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e6.ny.us.ibm.com ([32.97.182.146]:48491 "EHLO e6.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753693Ab2FEGfr (ORCPT ); Tue, 5 Jun 2012 02:35:47 -0400 Received: from /spool/local by e6.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Jun 2012 02:35:46 -0400 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id A788238C8054 for ; Tue, 5 Jun 2012 02:35:43 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q556ZhqG122210 for ; Tue, 5 Jun 2012 02:35:43 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q556ZgvF028943 for ; Tue, 5 Jun 2012 03:35:43 -0300 Date: Tue, 5 Jun 2012 14:35:38 +0800 From: Ram Pai 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: <20120605063538.GE6637@ram-ThinkPad-T61> Reply-To: Ram Pai 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: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 */ get_device(&bridge->dev); RP