Skip to content

Commit

Permalink
pci-slot: Allow to create slot for downstream port of any switch
Browse files Browse the repository at this point in the history
System vendor may build systems with large PCIe tree with
deeper switch topologies. Currenlty downstream ports slot
creation is limited to first switch. Patch allows to use any.

Signed-off-by: Ilya Kuznetsov <ilya@yadro.com>
[oliver: added pci-slot prefix]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
srdolor authored and oohal committed Jul 19, 2019
1 parent 067de39 commit dab352e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions core/pcie-slot.c
Expand Up @@ -544,13 +544,8 @@ struct pci_slot *pcie_slot_create_dynamic(struct phb *phb,
if (!phb || !pd || pd->slot)
return NULL;

/* Try to create slot whose details aren't provided by platform.
* We only care the downstream ports of PCIe switch that connects
* to root port.
*/
if (pd->dev_type != PCIE_TYPE_SWITCH_DNPORT ||
!pd->parent || !pd->parent->parent ||
pd->parent->parent->parent)
/* Try to create slot whose details aren't provided by platform. */
if (pd->dev_type != PCIE_TYPE_SWITCH_DNPORT)
return NULL;

ecap = pci_cap(pd, PCI_CFG_CAP_ID_EXP, false);
Expand Down

0 comments on commit dab352e

Please sign in to comment.