I hear a lot about PCI quirks when reading about the Linux kernel, but no website explains or defines PCI quirks. What are PCI quirks?
What are PCI quirks?
linux kernel;pci
Quirks are attributes of a device that are considered to be noncompliant with expected operation.Here's an example from quirks.c:/* The Mellanox Tavor device gives false positive parity errors * Mark this device with a broken_parity_status, to allow * PCI scanning code to skip this now blacklisted device. */static void quirk_mellanox_tavor(struct pci_dev *dev){        dev->broken_parity_status = 1;  /* This device gives false positives */}This is a quirk as the device reports spurious errors. When this device is operative, the quirk sets certain attributes that make other parts of the kernel act differently (perhaps by ignoring spurious errors, or by working around a known issue).Not all quirks in the Linux kernel are like this, though. Instead of simply disabling the affected feature, some try to work around it, for example:/* * Some CS5536 BIOSes (for example, the Soekris NET5501 board w/ comBIOS * ver. 1.33  20070103) don't set the correct ISA PCI region header info. * BAR0 should be 8 bytes; instead, it may be set to something like 8k * (which conflicts w/ BAR1's memory range). */static void quirk_cs5536_vsa(struct pci_dev *dev){        if (pci_resource_len(dev, 0) != 8) {                struct resource *res = &dev->resource[0];                res->end = res->start + 8 - 1;                dev_info(&dev->dev, CS5536 ISA bridge bug detected                                 (incorrect header); workaround applied.\n);        }}