Skip to content

The AMI driver is not reporting "PCIe extended capability" correctly #37

@taraxacum45e9a

Description

@taraxacum45e9a

The current AMI driver is reporting every extended capability as "found", which is incorrect.

Details
$ journalctl -b -2 | grep -E "ami.*PCIe extended capability"
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_ERR
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_VC
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_DSN
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_PWR
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_RCLD
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_RCILC
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_RCEC
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_MFVC
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_VC9
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_RCRB
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_VNDR
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_CAC
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_ACS
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_ARI
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_ATS
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_SRIOV
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_MRIOV
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_MCAST
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_PRI
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_AMD_XXX
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_REBAR
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_DPA
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_TPH
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_LTR
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_SECPCI
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_PMUX
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_PASID
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_DPC
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_L1SS
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_PTM
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_DLF
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_PL_16GT
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_LANE_MERGE_REC
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_HIERARCHY_ID
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_NPEM
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_PHY_LAYER_32_GTS
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_ID_ALT_PROTOCOL
Jun 03 13:56:15 hostname kernel: ami 0000:41:00.0: VERBOSE DEBUG           : Found PCIe extended capability: PCI_EXT_CAP_SFI

The problem is in the function below, where pci_find_ext_capability is looking for a constant capability, instead of the cap argument.

#ifdef VERBOSE_DEBUG
void find_pci_ext_capability(struct pci_dev *dev, char *cap_name, int cap)
{
int ret = 0;
if (!dev || !cap_name)
return;
ret = pci_find_ext_capability(dev, PCI_CAP_ID_PM);
if (ret == CAP_NOT_FOUND)
DEV_VDBG(dev, "PCIe extended capability not found: %s", cap_name);
else
DEV_VDBG(dev, "Found PCIe extended capability: %s", cap_name);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions