Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752775AbbLCRAv (ORCPT ); Thu, 3 Dec 2015 12:00:51 -0500 Received: from mail-by2on0104.outbound.protection.outlook.com ([207.46.100.104]:43776 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752109AbbLCRAs convert rfc822-to-8bit (ORCPT ); Thu, 3 Dec 2015 12:00:48 -0500 X-Greylist: delayed 69647 seconds by postgrey-1.27 at vger.kernel.org; Thu, 03 Dec 2015 12:00:48 EST From: Jake Oshins To: Jiang Liu , "gregkh@linuxfoundation.org" , KY Srinivasan , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "olaf@aepfle.de" , "apw@canonical.com" , "vkuznets@redhat.com" , "tglx@redhat.com" , Haiyang Zhang , "marc.zyngier@arm.com" , "bhelgaas@google.com" , "linux-pci@vger.kernel.org" Subject: RE: [PATCH v6 4/7] PCI: Add fwnode_handle to pci_sysdata Thread-Topic: [PATCH v6 4/7] PCI: Add fwnode_handle to pci_sysdata Thread-Index: AQHRFbYhWGoSXf4JQEGDivEoXvaDHp65AzEAgACoFSA= Date: Thu, 3 Dec 2015 17:00:46 +0000 Message-ID: References: <1446499996-1350-1-git-send-email-jakeo@microsoft.com> <1446499996-1350-5-git-send-email-jakeo@microsoft.com> <565FE6E6.8000700@linux.intel.com> In-Reply-To: <565FE6E6.8000700@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=jakeo@microsoft.com; x-originating-ip: [2001:4898:80e8:8::349] x-microsoft-exchange-diagnostics: 1;DM2PR0301MB0781;5:9hyRegVjIPBuw6f2/s0/lbS51GanoEntJwUfze8ZHypjK0yh5VmWBe1GKfQNYvtLGIGrIgw62IA1k+Svg+6KDj7RYrIs7Ymap0tkfQSoDomDNegnsS40uJaZ/de1iHkNzZYuUKb9zV8M7vclz4Rpdg==;24:HzFwX++2Oo4pif+RO/h+4sQyvZgohU9dwNrKeYxv20J65M3k9v2xsDNjyIpIiHbMB4pEMkThQqUWXxJ6dWyCBJOw8MMYMCfljtnI/lV9J28= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0781; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(211936372134217)(108003899814671)(180628864354917)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(601004)(2401047)(520078)(5005006)(8121501046)(10201501046)(3002001)(61426038)(61427038);SRVR:DM2PR0301MB0781;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0781; x-forefront-prvs: 077929D941 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(479174004)(24454002)(189002)(13464003)(164054003)(43784003)(377454003)(199003)(2201001)(5003600100002)(106116001)(105586002)(2501003)(106356001)(122556002)(86612001)(99286002)(1511001)(10400500002)(2421001)(86362001)(87936001)(76576001)(5005710100001)(33656002)(8990500004)(5008740100001)(2561002)(101416001)(10290500002)(11100500001)(586003)(19580405001)(19580395003)(1220700001)(81156007)(76176999)(50986999)(5002640100001)(1096002)(92566002)(40100003)(5001770100001)(5004730100002)(102836003)(2900100001)(2950100001)(10090500001)(189998001)(6116002)(97736004)(107886002)(54356999)(74316001)(77096005)(5001960100002)(921003)(3826002)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB0781;H:DM2PR0301MB1232.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2015 17:00:46.2324 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0781 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3103 Lines: 64 > -----Original Message----- > From: Jiang Liu [mailto:jiang.liu@linux.intel.com] > Sent: Wednesday, December 2, 2015 10:53 PM > To: Jake Oshins ; gregkh@linuxfoundation.org; KY > Srinivasan ; linux-kernel@vger.kernel.org; > devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com; > vkuznets@redhat.com; tglx@redhat.com; Haiyang Zhang > ; marc.zyngier@arm.com; > bhelgaas@google.com; linux-pci@vger.kernel.org > Subject: Re: [PATCH v6 4/7] PCI: Add fwnode_handle to pci_sysdata > > On 2015/11/3 5:33, jakeo@microsoft.com wrote: > > From: Jake Oshins > > > > +#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN > > +static inline void *_pci_root_bus_fwnode(struct pci_bus *bus) > > +{ > > + struct pci_sysdata *sd = bus->sysdata; > > + return sd->fwnode; > > +} > > + > > +#define pci_root_bus_fwnode _pci_root_bus_fwnode > > +#endif > > + > > /* Can be used to override the logic in pci_scan_bus for skipping > > already-configured bus numbers - to be used for buggy BIOSes > > or architectures with incomplete PCI setup by the loader */ > > diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h > > index f24bc51..3fde985 100644 > > --- a/include/asm-generic/pci.h > > +++ b/include/asm-generic/pci.h > > @@ -21,4 +21,8 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev > *dev, int channel) > > #define PCI_DMA_BUS_IS_PHYS (1) > > #endif > > > > +#ifndef pci_root_bus_fwnode > > +#define pci_root_bus_fwnode(bus) ((void)(bus),NULL) > > +#endif > Hi Jakeo, > For x86, all PCI devices share the same MSI controller. But I'm > not sure whether it may have per-bus/per-device MSI controllers on other > archs. If there may be multiple MSI controllers serving PCI devices > under the same PCI root, it would be better to use some thing like > pci_get_msi_fwnode(bus) or similar. > Thanks, > Gerry > Certainly other architectures have per-bus MSI controllers, though usually it's per root complex. In case you're not familiar with PCI Express terms (and I apologize for this if you are) a root complex is one instance of PCI Express, where traffic is defined between every part of it. If your traffic leaves PCI Express and goes onto some processor-specific bus, it has left the root complex. The root complex is usually modeled as a root PCI bus, a set of root port, and a set of legacy and/or embedded endpoints, which amounts to saying that some PCI/E devices are built into the root complex and not connected with links. I don't have a use case at the moment for anything other than an MSI controller for a root complex. If you'd like me to change this so that it more naturally extends to a situation where you'd want to use it for a specific bus, I can do that. Please let me know. And thanks again for your review. -- Jake Oshins -- 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/