• Logan Gunthorpe's avatar
    PCI: Fix Switchtec DMA aliasing quirk dmesg noise · 742bbe1e
    Logan Gunthorpe authored
    Currently the Switchtec quirk runs on all endpoints in the switch,
    including all the upstream and downstream ports.  These other functions do
    not contain BARs, so the quirk fails when trying to map the BAR and prints
    the error "Cannot iomap Switchtec device".  The user will see a few of
    these useless and scary errors, one for each port in the switch.
    
    At most, the quirk should only run on either a management endpoint
    (PCI_CLASS_MEMORY_OTHER) or an NTB endpoint (PCI_CLASS_BRIDGE_OTHER).
    However, the quirk is useless except in NTB applications, so we will
    only run it when the class is PCI_CLASS_BRIDGE_OTHER.
    
    Switch to using DECLARE_PCI_FIXUP_CLASS_FINAL and only match
    PCI_CLASS_BRIDGE_OTHER.
    Reported-by: default avatarStephen Bates <sbates@raithlin.com>
    Fixes: ad281ecf ("PCI: Add DMA alias quirk for Microsemi Switchtec NTB")
    Signed-off-by: default avatarLogan Gunthorpe <logang@deltatee.com>
    [bhelgaas: split SWITCHTEC_QUIRK() introduction to separate patch]
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Cc: Doug Meyer <dmeyer@gigaio.com>
    Cc: Kurt Schwemmer <kurt.schwemmer@microsemi.com>
    742bbe1e
quirks.c 179 KB