Re: [PATCH 1/2] pci: Fix root port bus->self is NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2014/1/7 17:51, Dongsheng.Wang@xxxxxxxxxxxxx wrote:
>>>> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index
>>>> 38e403d..7f2d1ab 100644
>>>> --- a/drivers/pci/probe.c
>>>> +++ b/drivers/pci/probe.c
>>>> @@ -1472,6 +1472,9 @@ int pci_scan_slot(struct pci_bus *bus, int devfn)
>>>>  	if (!dev->is_added)
>>>>  		nr++;
>>>>
>>>> +	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
>>>> +		bus->self = dev;
>>>
>>> In this case, bus is the pci root bus I think, so why set bus->self = root
>> port ?
>>> "bus->self" should pointer to the pci device that bridge out this bus.
>> Yes, this patch seems wrong. If dev is root port, bus should be root bus, so we
>> shouldn't set root_bus->self = pci_dev_of_root_port.
>>
> Why the root bus->self pointer to the bridge?
> If child bus create from root bus, the child->self will get the bridge(root port) pci device.
> 
>> Actually PCI core has correctly setup pci_bus->self for secondary bus of PCIe
>> root port.
> Yes, right. But the root-bus->self is NULL. I think the root bus should get root port
> pci device for itself. If there is no bridge at board how to get the root port device?
Hi Dongsheng,
	PCI root bus represents PCI host bridge, which has no
corresponding PCI device.

> 
> -Dongsheng
> 
>>
>> Thanks!
>> Gerry
>>
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux