Skip to content

Commit

Permalink
core/pci: Make the conditions for device type quirk obvious
Browse files Browse the repository at this point in the history
The device type should be fixed to downstream port when it seats
behinds behind a upstream port, which is connected to root port
directly and its VDID is 0x874810b5.

This reorders the conditions to make it a bit obvious: parent,
parent's device type, device's VDID and device type in sequence.
No logicial changes.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
Gavin Shan authored and stewartsmith committed Jun 15, 2017
1 parent f3105cb commit b1065ed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/pci.c
Expand Up @@ -171,9 +171,8 @@ static void pci_init_pcie_cap(struct phb *phb, struct pci_device *pd)
*/
pci_cfg_read16(phb, pd->bdfn, ecap + PCICAP_EXP_CAPABILITY_REG, &reg);
pd->dev_type = GETFIELD(PCICAP_EXP_CAP_TYPE, reg);
if (pd->parent && pd->dev_type == PCIE_TYPE_SWITCH_UPPORT &&
pd->parent->dev_type == PCIE_TYPE_SWITCH_UPPORT &&
pd->vdid == 0x874810b5) {
if (pd->parent && pd->parent->dev_type == PCIE_TYPE_SWITCH_UPPORT &&
pd->vdid == 0x874810b5 && pd->dev_type == PCIE_TYPE_SWITCH_UPPORT) {
PCIDBG(phb, pd->bdfn, "Fixing up bad PLX downstream port !\n");
pd->dev_type = PCIE_TYPE_SWITCH_DNPORT;
}
Expand Down

0 comments on commit b1065ed

Please sign in to comment.