Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756077Ab2B0WYg (ORCPT ); Mon, 27 Feb 2012 17:24:36 -0500 Received: from mail-we0-f174.google.com ([74.125.82.174]:61794 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755926Ab2B0WYc convert rfc822-to-8bit (ORCPT ); Mon, 27 Feb 2012 17:24:32 -0500 Authentication-Results: mr.google.com; spf=pass (google.com: domain of bhelgaas@google.com designates 10.180.92.229 as permitted sender) smtp.mail=bhelgaas@google.com; dkim=pass header.i=bhelgaas@google.com MIME-Version: 1.0 In-Reply-To: References: <1330299202-3838-1-git-send-email-yinghai@kernel.org> <1330299202-3838-6-git-send-email-yinghai@kernel.org> From: Bjorn Helgaas Date: Mon, 27 Feb 2012 15:24:11 -0700 Message-ID: Subject: Re: [PATCH 5/8] PCI: add generic device into pci_host_bridge struct To: Yinghai Lu Cc: Jesse Barnes , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1717 Lines: 44 On Mon, Feb 27, 2012 at 1:49 PM, Yinghai Lu wrote: > On Mon, Feb 27, 2012 at 11:17 AM, Bjorn Helgaas wrote: >> On Mon, Feb 27, 2012 at 12:08 PM, Yinghai Lu wrote: > >>>> This doesn't feel right to me. ?You're allocating a new struct device >>>> here, but the arch likely already has one. ?In fact, I think we even >>>> passed it in to pci_create_root_bus(). >>> >>> no. >>> >>> original pci_create_root_bus() will create one dummy struct device and >>> use it as parent for bus->dev. >>> >>>> >>>> On x86, we already have an ACPI device for the host bridge, and now >>>> we'll have a second one. ?(Actually a *third* one, because PNPACPI >>>> also has one, but that's a long-standing problem.) >>> >>> not related. >> >> OK. ?Can you educate me? ?What is the device we pass in, what does the >> dummy one correspond to, why do we have two, what's the difference, >> etc., etc.? > > for every bus will have ->bridge, and that is device pointer. to ?pci > bridge dev. > > for root bus, there is not pci bridge for that. So create_root_bus > allocate local dummy one. > > that dummy device will be bus->dev's parent. > > Now pci_host_bridge is added, and it is allocated, so just put the > struct device into that pci_host_bridge. > > and use pci_host_bridge->dev as parent of root bus->dev's parent. What's the device passed in to pci_create_root_bus()? Why is that different than the root bus dev's parent? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/