Skip to content

Commit a44e3f9

Browse files
committed
PCI: Add PCI_BRIDGE_NO_ALIASES quirk for ASPEED AST1150
ASPEED BMC controllers have VGA and USB functions behind a PCIe-to-PCI bridge that causes them to share the same stream ID: [e0]---00.0-[e1-e2]----00.0-[e2]--+-00.0 ASPEED Graphics Family \-02.0 ASPEED USB Controller Both devices get stream ID 0x5e200 due to bridge aliasing, causing the USB controller to be rejected with 'Aliasing StreamID unsupported'. Per ASPEED, the AST1150 doesn't use a real PCI bus and always forwards the original requester ID from downstream devices rather than replacing it with any alias. Add a new PCI_DEV_FLAGS_PCI_BRIDGE_NO_ALIASES flag and apply it to the AST1150. Suggested-by: Jason Gunthorpe <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Signed-off-by: Nirmoy Das <[email protected]> (backported from https://lore.kernel.org/linux-iommu/[email protected]/) [nirmoy: set PCI_DEV_FLAGS_PCI_BRIDGE_NO_ALIASES to (1 << 15) instead of (1 << 14)] Signed-off-by: Nirmoy Das <[email protected]>
1 parent 3ca3487 commit a44e3f9

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

drivers/pci/quirks.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4476,6 +4476,16 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000,
44764476
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084,
44774477
quirk_bridge_cavm_thrx2_pcie_root);
44784478

4479+
/*
4480+
* AST1150 doesn't use a real PCI bus and always forwards the requester ID
4481+
* from downstream devices.
4482+
*/
4483+
static void quirk_aspeed_pci_bridge_no_aliases(struct pci_dev *pdev)
4484+
{
4485+
pdev->dev_flags |= PCI_DEV_FLAGS_PCI_BRIDGE_NO_ALIASES;
4486+
}
4487+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ASPEED, 0x1150, quirk_aspeed_pci_bridge_no_aliases);
4488+
44794489
/*
44804490
* Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
44814491
* class code. Fix it.

drivers/pci/search.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ int pci_for_each_dma_alias(struct pci_dev *pdev,
8686
case PCI_EXP_TYPE_DOWNSTREAM:
8787
continue;
8888
case PCI_EXP_TYPE_PCI_BRIDGE:
89+
if (tmp->dev_flags & PCI_DEV_FLAGS_PCI_BRIDGE_NO_ALIASES)
90+
continue;
8991
ret = fn(tmp,
9092
PCI_DEVID(tmp->subordinate->number,
9193
PCI_DEVFN(0, 0)), data);

include/linux/pci.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ enum pci_dev_flags {
249249
PCI_DEV_FLAGS_MSIX_TOUCH_ENTRY_DATA_FIRST = (__force pci_dev_flags_t) (1 << 13),
250250
/* Do not use Configuration Request Retry Status polling in pci_dev_wait() */
251251
PCI_DEV_FLAGS_NO_RRS_SV = (__force pci_dev_flags_t) (1 << 14),
252+
/*
253+
* PCIe to PCI bridge does not create RID aliases because the bridge is
254+
* integrated with the downstream devices and doesn't use real PCI.
255+
*/
256+
PCI_DEV_FLAGS_PCI_BRIDGE_NO_ALIASES = (__force pci_dev_flags_t) (1 << 15),
252257
};
253258

254259
enum pci_irq_reroute_variant {

0 commit comments

Comments
 (0)