Re: [RFC PATCH v2, part3 07/11] PCI, xen-pcifront: use new PCI interfacesto simplify implementation
From: Jiang Liu
Date: Fri Jun 07 2013 - 11:18:17 EST
On Fri 07 Jun 2013 10:50:24 PM CST, Konrad Rzeszutek Wilk wrote:
> On Thu, May 16, 2013 at 11:50:55PM +0800, Jiang Liu wrote:
>> Use new PCI interfaces to simplify xen-pcifront implementation:
>> 1) Use pci_create_root_bus() instead of pci_scan_bus_parented()
>> because pci_scan_bus_parented() is marked as __deprecated.This
>> also gets rid of a duplicated call of pci_bus_start_devices().
>> 2) Use pci_stop_root_bus() and pci_remove_root_bus() instead of
>> open-coded private implementation.
>> 3) Use pci_set_host_bridge_release() to release data structures
>> associated with PCI root buses.
>> 4) Use pci_bus_get()/pci_bus_put() to manage PCI root bus reference
>> count.
>>
>> This is also a preparation for coming PCI bus lock enhancement.
>>
>> Signed-off-by: Jiang Liu <jiang.liu@xxxxxxxxxx>
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
>> Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
>> Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
>> Cc: virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
>> Cc: linux-pci@xxxxxxxxxxxxxxx
>> Cc: linux-kernel@xxxxxxxxxxxxxxx
>> ---
>> drivers/pci/xen-pcifront.c | 81 ++++++++++++++++++++++------------------------
>> 1 file changed, 39 insertions(+), 42 deletions(-)
>>
>> diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
>> index 816cf94..6aa2c0f 100644
>> --- a/drivers/pci/xen-pcifront.c
>> +++ b/drivers/pci/xen-pcifront.c
......
>> @@ -480,12 +490,14 @@ static int pcifront_scan_root(struct pcifront_device *pdev,
>> goto err_out;
>> }
>>
>> - bus_entry->bus = b;
>> + pci_set_host_bridge_release(to_pci_host_bridge(b->bridge),
>> + pcifront_release_sd, sd);
>>
>> - list_add(&bus_entry->list, &pdev->root_buses);
>> -
>> - /* pci_scan_bus_parented skips devices which do not have a have
>> - * devfn==0. The pcifront_scan_bus enumerates all devfn. */
>> + /*
>> + * Every PCI physical device should have function 0, but that's not
>> + * true for xen.
>
> That is incorrect. There are two types of backends - one of them will
> start at zero, but the other might not.
Hi Konrad,
Forgive my poor knowledge about Xen:(, so I will skip this change.
Regards!
Gerry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/