[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 3 Mar 2015 16:41:54 +0800
From: Yijing Wang <wangyijing@...wei.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>
CC: Jiang Liu <jiang.liu@...ux.intel.com>, <linux-pci@...r.kernel.org>,
Yinghai Lu <yinghai@...nel.org>,
<linux-kernel@...r.kernel.org>,
Marc Zyngier <marc.zyngier@....com>,
<linux-arm-kernel@...ts.infradead.org>,
Russell King <linux@....linux.org.uk>, <x86@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Tony Luck <tony.luck@...el.com>, <linux-ia64@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
"Guan Xuetao" <gxt@...c.pku.edu.cn>, <linux-alpha@...r.kernel.org>,
<linux-m68k@...ts.linux-m68k.org>, Liviu Dudau <liviu@...au.co.uk>,
"Arnd Bergmann" <arnd@...db.de>,
Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: Re: [PATCH v4 12/30] PCI: Introduce pci_host_bridge_ops to support
host specific operations
On 2015/3/3 11:03, Bjorn Helgaas wrote:
> On Thu, Feb 26, 2015 at 04:12:06PM +0800, Yijing Wang wrote:
>> Now we have weak functions like pcibios_root_bridge_prepare()
>> to setup pci host bridge, We could introduce pci_host_bridge_ops
>> which contain host bridge specific ops to setup pci_host_bridge.
>> Then host bridge driver could add pci_host_bridge_ops hooks
>> intead of weak function to setup pci_host_bridge.
>> This patch add following pci_host_bridge_ops hooks:
>>
>> pci_host_bridge_ops {
>> /* set root bus speed, some platform need this like powerpc */
>> void (*phb_set_root_bus_speed)(struct pci_host_bridge *host);
>> /* setup pci_host_bridge before pci_host_bridge be added to driver core */
>> int (*phb_prepare)(struct pci_host_bridge *host);
>> /* platform specific of scan hook to scan pci device */
>> void (*phb_of_scan_bus)(struct pci_host_bridge *);
>> }
>> We could easily extend it to support different host bridge
>> specific operations.
>>
>> Signed-off-by: Yijing Wang <wangyijing@...wei.com>
>> ...
>
>> @@ -2050,10 +2052,13 @@ static struct pci_bus *__pci_scan_root_bus(
>> pci_bus_insert_busn_res(b, b->number, 255);
>> }
>>
>> - max = pci_scan_child_bus(b);
>> -
>> - if (!found)
>> - pci_bus_update_busn_res_end(b, max);
>> + if (host->ops && host->ops->phb_of_scan_bus) {
>> + host->ops->phb_of_scan_bus(host);
>
> The important thing here is not the use of OF (Open Firmware/Device Tree),
> is it? Why would we want "_of_" in the function name? I assume the intent
> is that this host bridge op performs the same function as
> pci_scan_child_bus(), so I think the op should be called "scan_bus".
Yes, because now only OF code need the private scan_child_bus, so I named it
phb_of_scan_bus(). I agree that rename it to scan_bus.
>
>> + } else {
>> + max = pci_scan_child_bus(b);
>> + if (!found)
>> + pci_bus_update_busn_res_end(b, max);
>> + }
>>
>> return b;
>> }
>
> .
>
--
Thanks!
Yijing
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists