Lines Matching +full:vp3 +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0
3 * This file contains work-arounds for many known PCI hardware bugs.
5 * should be handled in arch-specific code.
22 #include <linux/isa-dma.h> /* isa_dma_bridge_buggy */
106 int ret = -ENOTTY; in pcie_failed_link_retrain()
109 !pcie_cap_has_lnkctl2(dev) || !dev->link_active_reporting) in pcie_failed_link_retrain()
117 pci_info(dev, "broken device, retraining non-functional downstream link at 2.5GT/s\n"); in pcie_failed_link_retrain()
175 if ((f->class == (u32) (dev->class >> f->class_shift) || in pci_do_fixups()
176 f->class == (u32) PCI_ANY_ID) && in pci_do_fixups()
177 (f->vendor == dev->vendor || in pci_do_fixups()
178 f->vendor == (u16) PCI_ANY_ID) && in pci_do_fixups()
179 (f->device == dev->device || in pci_do_fixups()
180 f->device == (u16) PCI_ANY_ID)) { in pci_do_fixups()
183 hook = offset_to_ptr(&f->hook_offset); in pci_do_fixups()
185 hook = f->hook; in pci_do_fixups()
311 * key system devices. For devices that need to have mmio decoding always-on,
312 * we need to set the dev->mmio_always_on bit.
316 dev->mmio_always_on = 1; in quirk_mmio_always_on()
355 * The VIA VP2/VP3/MVP3 seem to have some 'features'. There may be a
357 * contacts at VIA ask them for me please -- Alan
404 /* Chipsets where PCI->PCI transfers vanish or hang */
442 * Made according to a Windows driver-based patch by George E. Breese;
444 * Also see http://www.au-ja.org/review-kt133a-1-en.phtml for the info on
463 * 0x40 - 0x4f == 686B, 0x10 - 0x2f == 686A; in quirk_vialatency()
467 if (p->revision < 0x40 || p->revision > 0x42) in quirk_vialatency()
475 if (p->revision < 0x10 || p->revision > 0x12) in quirk_vialatency()
512 /* VIA Apollo VP3 needs ETBF on BT848/878 */
567 dev->cfg_size = 0xA0; in quirk_citrine()
577 dev->cfg_size = 0x600; in quirk_nfp6000()
590 struct resource *r = &dev->resource[i]; in quirk_extend_bar_to_page()
593 if (r->flags & IORESOURCE_MEM && resource_size(r) < PAGE_SIZE) { in quirk_extend_bar_to_page()
595 r->flags |= IORESOURCE_UNSET; in quirk_extend_bar_to_page()
605 * If it's needed, re-allocate the region.
609 struct resource *r = &dev->resource[0]; in quirk_s3_64M()
611 if (!IS_ALIGNED(r->start, SZ_64M) || resource_size(r) != SZ_64M) { in quirk_s3_64M()
612 r->flags |= IORESOURCE_UNSET; in quirk_s3_64M()
624 struct resource *res = dev->resource + pos; in quirk_io()
632 res->name = pci_name(dev); in quirk_io()
633 res->flags = region & ~PCI_BASE_ADDRESS_IO_MASK; in quirk_io()
634 res->flags |= in quirk_io()
636 region &= ~(size - 1); in quirk_io()
640 bus_region.end = region + size - 1; in quirk_io()
641 pcibios_bus_to_resource(dev->bus, res, &bus_region); in quirk_io()
652 * CS553x's ISA PCI BARs may also be read-only (ref:
653 * https://bugzilla.kernel.org/show_bug.cgi?id=85991 - Comment #4 forward).
674 struct resource *res = dev->resource + nr; in quirk_io_region()
677 region &= ~(size - 1); in quirk_io_region()
682 res->name = pci_name(dev); in quirk_io_region()
683 res->flags = IORESOURCE_IO; in quirk_io_region()
687 bus_region.end = region + size - 1; in quirk_io_region()
688 pcibios_bus_to_resource(dev->bus, res, &bus_region); in quirk_io_region()
693 * non-standard resource. Printing "nr" or pci_resource_name() of in quirk_io_region()
702 * between 0x3b0->0x3bb or read 0x3d3
726 u32 class = pdev->class; in quirk_amd_dwc_class()
730 pdev->class = PCI_CLASS_SERIAL_USB_DEVICE; in quirk_amd_dwc_class()
732 "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n", in quirk_amd_dwc_class()
733 class, pdev->class); in quirk_amd_dwc_class()
744 * devices should use dwc3-haps driver. Change these devices' class code to
745 * PCI_CLASS_SERIAL_USB_DEVICE to prevent the xhci-pci driver from claiming
750 u32 class = pdev->class; in quirk_synopsys_haps()
752 switch (pdev->device) { in quirk_synopsys_haps()
756 pdev->class = PCI_CLASS_SERIAL_USB_DEVICE; in quirk_synopsys_haps()
757 …pci_info(pdev, "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhc… in quirk_synopsys_haps()
758 class, pdev->class); in quirk_synopsys_haps()
805 base &= -size; in piix4_io_quirk()
806 pci_info(dev, "%s PIO at %04x-%04x\n", name, base, base + size - 1); in piix4_io_quirk()
831 base &= -size; in piix4_mem_quirk()
832 pci_info(dev, "%s MMIO at %04x-%04x\n", name, base, base + size - 1); in piix4_mem_quirk()
884 * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at
958 base &= ~(size-1); in ich6_lpc_generic_decode()
964 pci_info(dev, "%s PIO at %04x-%04x\n", name, base, base+size-1); in ich6_lpc_generic_decode()
972 /* ICH6-specific generic IO decode */ in quirk_ich6_lpc()
991 /* IO base in bits 15:2, mask in bits 23:18, both are dword-based */ in ich7_lpc_generic_decode()
1003 /* ICH7-10 has the same common LPC generic IO decode registers */
1035 if (dev->revision & 0x10) in quirk_vt82c586_acpi()
1052 "vt82c686 HW-mon"); in quirk_vt82c686_acpi()
1071 * TI XIO2000a PCIe-PCI Bridge erroneously reports it supports fast
1072 * back-to-back: Disable fast back-to-back on the secondary bus segment
1079 pci_warn(dev, "TI XIO2000a quirk detected; secondary bus fast back-to-back transfers disabled\n"); in quirk_xio2000a()
1080 list_for_each_entry(pdev, &dev->subordinate->devices, bus_list) { in quirk_xio2000a()
1094 * VIA 686A/B: If an IO-APIC is active, we need to route all on-chip
1097 * TODO: When we have device-specific interrupt routers, this code will go
1107 tmp = 0x1f; /* all known bits (4-0) routed to external APIC */ in quirk_via_ioapic()
1119 * VIA 8237: Some BIOSes don't set the 'Bypass APIC De-Assert Message' Bit.
1131 pci_info(dev, "Bypassing VIA 8237 APIC De-Assert Message\n"); in quirk_via_vt8237_bypass_apic_deassert()
1139 * The AMD IO-APIC can hang the box when an APIC IRQ is masked.
1149 if (dev->revision >= 0x02) { in quirk_amd_ioapic()
1161 /* Fix for improper SR-IOV configuration on Cavium cn88xx RNM device */ in quirk_cavium_sriov_rnm_link()
1162 if (dev->subsystem_device == 0xa118) in quirk_cavium_sriov_rnm_link()
1163 dev->sriov->link = dev->devfn; in quirk_cavium_sriov_rnm_link()
1170 * See AMD 8131 HyperTransport PCI-X Tunnel Revision Guide
1174 if (dev->subordinate && dev->revision <= 0x12) { in quirk_amd_8131_mmrbc()
1175 pci_info(dev, "AMD8131 rev %x detected; disabling PCI-X MMRBC\n", in quirk_amd_8131_mmrbc()
1176 dev->revision); in quirk_amd_8131_mmrbc()
1177 dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MMRBC; in quirk_amd_8131_mmrbc()
1187 * -jgarzik
1197 d->irq = irq; in quirk_via_acpi()
1203 static int via_vlink_dev_lo = -1, via_vlink_dev_hi = 18;
1208 switch (dev->device) { in quirk_via_bridge()
1215 via_vlink_dev_lo = PCI_SLOT(dev->devfn); in quirk_via_bridge()
1216 via_vlink_dev_hi = PCI_SLOT(dev->devfn); in quirk_via_bridge()
1243 * quirk_via_vlink - VIA VLink IRQ number update
1258 if (via_vlink_dev_lo == -1) in quirk_via_vlink()
1261 new_irq = dev->irq; in quirk_via_vlink()
1268 if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) > via_vlink_dev_hi || in quirk_via_vlink()
1269 PCI_SLOT(dev->devfn) < via_vlink_dev_lo) in quirk_via_vlink()
1294 pci_read_config_word(dev, PCI_DEVICE_ID, &dev->device); in quirk_vt82c598_id()
1337 * DreamWorks-provided workaround for Dunord I-3000 problem
1345 struct resource *r = &dev->resource[1]; in quirk_dunord()
1347 r->flags |= IORESOURCE_UNSET; in quirk_dunord()
1353 * i82380FB mobile docking controller: its PCI-to-PCI bridge is subtractive
1355 * Unfortunately, the ProgIf value is wrong - 0x80 instead of 0x01.
1359 dev->transparent = 1; in quirk_transparent_bridge()
1394 if (pdev->revision != 0x04) /* Only C0 requires this */ in quirk_disable_pxb()
1408 /* set SBX00/Hudson-2 SATA in IDE mode to AHCI mode */ in quirk_amd_ide_mode()
1419 pdev->class = PCI_CLASS_STORAGE_SATA_AHCI; in quirk_amd_ide_mode()
1439 pdev->class &= ~5; in quirk_svwks_csb5ide()
1446 /* Intel 82801CAM ICH3-M datasheet says IDE modes must be the same */
1456 pdev->class &= ~5; in quirk_ide_samemode()
1465 pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3; in quirk_no_ata_d3()
1481 * This was originally an Alpha-specific thing, but it really fits here.
1482 * The i82375 PCI/EISA bridge appears as non-classified. Fix that.
1486 dev->class = PCI_CLASS_BRIDGE_EISA << 8; in quirk_eisa_bridge()
1499 * becomes necessary to do this tweak in two steps -- the chosen trigger
1500 * is either the Host bridge (preferred) or on-board VGA controller.
1513 * the DSDT and double-check that there is no code accessing the SMBus.
1519 if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) { in asus_hides_smbus_hostbridge()
1520 if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB) in asus_hides_smbus_hostbridge()
1521 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1522 case 0x8025: /* P4B-LX */ in asus_hides_smbus_hostbridge()
1528 else if (dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) in asus_hides_smbus_hostbridge()
1529 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1530 case 0x80b1: /* P4GE-V */ in asus_hides_smbus_hostbridge()
1532 case 0x8093: /* P4B533-V */ in asus_hides_smbus_hostbridge()
1535 else if (dev->device == PCI_DEVICE_ID_INTEL_82850_HB) in asus_hides_smbus_hostbridge()
1536 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1540 else if (dev->device == PCI_DEVICE_ID_INTEL_7205_0) in asus_hides_smbus_hostbridge()
1541 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1545 else if (dev->device == PCI_DEVICE_ID_INTEL_E7501_MCH) in asus_hides_smbus_hostbridge()
1546 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1547 case 0x80c9: /* PU-DLS */ in asus_hides_smbus_hostbridge()
1550 else if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB) in asus_hides_smbus_hostbridge()
1551 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1557 else if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) in asus_hides_smbus_hostbridge()
1558 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1563 else if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) in asus_hides_smbus_hostbridge()
1564 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1565 case 0x80f2: /* P4P800-X */ in asus_hides_smbus_hostbridge()
1568 else if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) in asus_hides_smbus_hostbridge()
1569 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1574 } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_HP)) { in asus_hides_smbus_hostbridge()
1575 if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) in asus_hides_smbus_hostbridge()
1576 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1581 else if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) in asus_hides_smbus_hostbridge()
1582 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1588 else if (dev->device == PCI_DEVICE_ID_INTEL_82875_HB) in asus_hides_smbus_hostbridge()
1589 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1593 } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG)) { in asus_hides_smbus_hostbridge()
1594 if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) in asus_hides_smbus_hostbridge()
1595 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1599 } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ)) { in asus_hides_smbus_hostbridge()
1600 if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) in asus_hides_smbus_hostbridge()
1601 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1605 else if (dev->device == PCI_DEVICE_ID_INTEL_82810_IG3) in asus_hides_smbus_hostbridge()
1606 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1607 case 0xB16C: /* Compaq Deskpro EP 401963-001 (PCA# 010174) */ in asus_hides_smbus_hostbridge()
1610 * its on-board VGA controller */ in asus_hides_smbus_hostbridge()
1613 else if (dev->device == PCI_DEVICE_ID_INTEL_82801DB_2) in asus_hides_smbus_hostbridge()
1614 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1619 * subvendor/subdevice IDs and on-board VGA in asus_hides_smbus_hostbridge()
1625 else if (dev->device == PCI_DEVICE_ID_INTEL_82815_CGC) in asus_hides_smbus_hostbridge()
1626 switch (dev->subsystem_device) { in asus_hides_smbus_hostbridge()
1630 * its on-board VGA controller */ in asus_hides_smbus_hostbridge()
1782 dev->device = devid; in quirk_sis_503()
1792 * -- bjd
1799 if (likely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) { in asus_hides_ac97_lpc()
1800 if (dev->device == PCI_DEVICE_ID_VIA_8237) in asus_hides_ac97_lpc()
1833 if (PCI_FUNC(pdev->devfn)) in quirk_jmicron_ata()
1839 conf1 &= ~0x00CFF302; /* Clear bit 1, 8, 9, 12-19, 22, 23 */ in quirk_jmicron_ata()
1842 switch (pdev->device) { in quirk_jmicron_ata()
1874 pdev->hdr_type = hdr & PCI_HEADER_TYPE_MASK; in quirk_jmicron_ata()
1875 pdev->multifunction = FIELD_GET(PCI_HEADER_TYPE_MFD, hdr); in quirk_jmicron_ata()
1878 pdev->class = class >> 8; in quirk_jmicron_ata()
1903 if (dev->multifunction) { in quirk_jmicron_async_suspend()
1904 device_disable_async_suspend(&dev->dev); in quirk_jmicron_async_suspend()
1905 pci_info(dev, "async suspend disabled to avoid multi-function power-on ordering issue\n"); in quirk_jmicron_async_suspend()
1918 if ((pdev->class >> 8) != 0xff00) in quirk_alder_ioapic()
1922 * The first BAR is the location of the IO-APIC... we must in quirk_alder_ioapic()
1927 insert_resource(&iomem_resource, &pdev->resource[0]); in quirk_alder_ioapic()
1934 memset(&pdev->resource[i], 0, sizeof(pdev->resource[i])); in quirk_alder_ioapic()
1942 dev->no_msi = 1; in quirk_no_msi()
1953 pdev->no_msi = 1; in quirk_pcie_mch()
1964 * SMMU stall feature, by setting dma-can-stall for ACPI platforms.
1967 * break the PCI requirement for free-flowing writes and may lead to
1969 * be fault-tolerant, so there's no ACPI binding to describe anything else,
1976 PROPERTY_ENTRY_BOOL("dma-can-stall"), in quirk_huawei_pcie_sva()
1980 if (pdev->revision != 0x21 && pdev->revision != 0x30) in quirk_huawei_pcie_sva()
1983 pdev->pasid_no_tlp = 1; in quirk_huawei_pcie_sva()
1986 * Set the dma-can-stall property on ACPI platforms. Device tree in quirk_huawei_pcie_sva()
1989 if (!pdev->dev.of_node && in quirk_huawei_pcie_sva()
1990 device_create_managed_software_node(&pdev->dev, properties, NULL)) in quirk_huawei_pcie_sva()
2002 * together on certain PXH-based systems.
2006 dev->no_msi = 1; in quirk_pcie_pxh()
2022 dev->no_d1d2 = 1; in quirk_intel_pcie_pm()
2048 if (dev->d3hot_delay >= delay) in quirk_d3hot_delay()
2051 dev->d3hot_delay = delay; in quirk_d3hot_delay()
2052 pci_info(dev, "extending delay after power-on from D3hot to %d msec\n", in quirk_d3hot_delay()
2053 dev->d3hot_delay); in quirk_d3hot_delay()
2058 if (dev->subsystem_vendor == PCI_VENDOR_ID_APPLE && in quirk_radeon_pm()
2059 dev->subsystem_device == 0x00e2) in quirk_radeon_pm()
2065 * NVIDIA Ampere-based HDA controllers can wedge the whole device if a bus
2083 * remain on in D3hot state. The D3hot-to-D0 transition then requires an
2098 pr_info("%s detected: disable boot interrupt reroute\n", d->ident); in dmi_disable_ioapicreroute()
2109 .ident = "ASUSTek Computer INC. M2N-LR",
2112 DMI_MATCH(DMI_PRODUCT_NAME, "M2N-LR"),
2130 dev->irq_reroute_variant = INTEL_IRQ_REROUTE_VARIANT; in quirk_reroute_to_boot_interrupts_intel()
2132 dev->vendor, dev->device); in quirk_reroute_to_boot_interrupts_intel()
2157 * IO-APIC1 on 6300ESB generates boot interrupts, see Intel order no
2158 * 300641-004US, section 5.7.3.
2160 * Core IO on Xeon E5 1600/2600/4600, see Intel order no 326509-003.
2161 * Core IO on Xeon E5 v2, see Intel order no 329188-003.
2162 * Core IO on Xeon E7 v2, see Intel order no 329595-002.
2163 * Core IO on Xeon E5 v3, see Intel order no 330784-003.
2164 * Core IO on Xeon E7 v3, see Intel order no 332315-001US.
2165 * Core IO on Xeon E5 v4, see Intel order no 333810-002US.
2166 * Core IO on Xeon E7 v4, see Intel order no 332315-001US.
2167 * Core IO on Xeon D-1500, see Intel order no 332051-001.
2184 switch (dev->device) { in quirk_disable_intel_boot_interrupt()
2195 case 0x6f28: /* Xeon D-1500 */ in quirk_disable_intel_boot_interrupt()
2207 dev->vendor, dev->device); in quirk_disable_intel_boot_interrupt()
2210 * Device 29 Func 5 Device IDs of IO-APIC
2246 /* Disable boot interrupts on HT-1000 */
2272 dev->vendor, dev->device); in quirk_disable_broadcom_boot_interrupt()
2281 * rev. A0 and B0, NOIOAMODE needs to be disabled anyway to fix IO-APIC mode
2295 if ((dev->revision == AMD_813X_REV_B1) || in quirk_disable_amd_813x_boot_interrupt()
2296 (dev->revision == AMD_813X_REV_B2)) in quirk_disable_amd_813x_boot_interrupt()
2304 dev->vendor, dev->device); in quirk_disable_amd_813x_boot_interrupt()
2323 dev->vendor, dev->device); in quirk_disable_amd_8111_boot_interrupt()
2328 dev->vendor, dev->device); in quirk_disable_amd_8111_boot_interrupt()
2335 * Toshiba TC86C001 IDE controller reports the standard 8-byte BAR0 size
2337 * Re-allocate the region if needed...
2341 struct resource *r = &dev->resource[0]; in quirk_tc86c001_ide()
2343 if (r->start & 0x8) { in quirk_tc86c001_ide()
2344 r->flags |= IORESOURCE_UNSET; in quirk_tc86c001_ide()
2357 * Re-allocate the regions to a 256-byte boundary if necessary.
2364 if (dev->revision >= 2) in quirk_plx_pci9050()
2369 struct resource *r = &dev->resource[bar]; in quirk_plx_pci9050()
2370 pci_info(dev, "Re-allocating PLX PCI 9050 BAR %u to length 256 to avoid bit 7 bug\n", in quirk_plx_pci9050()
2372 r->flags |= IORESOURCE_UNSET; in quirk_plx_pci9050()
2392 unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; in quirk_netmos()
2393 unsigned int num_serial = dev->subsystem_device & 0xf; in quirk_netmos()
2405 switch (dev->device) { in quirk_netmos()
2408 if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM && in quirk_netmos()
2409 dev->subsystem_device == 0x0299) in quirk_netmos()
2418 dev->device, num_parallel, num_serial); in quirk_netmos()
2419 dev->class = (PCI_CLASS_COMMUNICATION_OTHER << 8) | in quirk_netmos()
2420 (dev->class & 0xff); in quirk_netmos()
2433 switch (dev->device) { in quirk_e100_interrupt()
2458 * re-enable them when it's ready. in quirk_e100_interrupt()
2469 if (dev->pm_cap) { in quirk_e100_interrupt()
2470 pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); in quirk_e100_interrupt()
2524 * ASM1083/1085 PCIe-PCI bridge devices cause AER timeout errors on the
2531 * Some Pericom PCIe-to-PCI bridges in reverse mode need the PCIe Retrain
2540 dev->clear_retrain_link = 1; in quirk_enable_clear_retrain_link()
2549 u32 class = dev->class; in fixup_rev1_53c810()
2558 dev->class = PCI_CLASS_STORAGE_SCSI << 8; in fixup_rev1_53c810()
2559 pci_info(dev, "NCR 53c810 rev 1 PCI class overridden (%#08x -> %#08x)\n", in fixup_rev1_53c810()
2560 class, dev->class); in fixup_rev1_53c810()
2573 dev->io_window_1k = 1; in quirk_p64h2_1k_io()
2607 * VT6212L is found -- the CX700 core itself also contains a USB in quirk_via_cx700_pci_parking_caching()
2617 * p should contain the first (internal) VT6212L -- see if we have in quirk_via_cx700_pci_parking_caching()
2639 /* Set PCI Master Bus time-out to "1x16 PCLK" */ in quirk_via_cx700_pci_parking_caching()
2671 * DRBs - this is where we expose device 6.
2672 * http://www.x86-secret.com/articles/tweak/pat/patsecrets-2.htm
2714 if (dev->subordinate) { in quirk_disable_msi()
2716 dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI; in quirk_disable_msi()
2733 apc_bridge = pci_get_slot(host_bridge->bus, PCI_DEVFN(1, 0)); in quirk_amd_780_apc_msi()
2735 if (apc_bridge->device == 0x9602) in quirk_amd_780_apc_msi()
2752 while (pos && ttl--) { in msi_ht_cap_enabled()
2790 pdev = pci_get_slot(dev->bus, 0); in quirk_nvidia_ck804_msi_ht_cap()
2806 while (pos && ttl--) { in ht_enable_msi_mapping()
2827 * The P5N32-SLI motherboards from Asus have a problem with MSI
2836 (strstr(board_name, "P5N32-SLI PREMIUM") || in nvenet_msi_disable()
2837 strstr(board_name, "P5N32-E SLI"))) { in nvenet_msi_disable()
2838 pci_info(dev, "Disabling MSI for MCP55 NIC on P5N32-SLI\n"); in nvenet_msi_disable()
2839 dev->no_msi = 1; in nvenet_msi_disable()
2847 * PCIe spec r6.0 sec 6.1.4.3 says that if MSI/MSI-X is enabled, the device
2852 * INTx and MSI/MSI-X, it is required to disable MSI interrupts to avoid port
2857 dev->no_msi = 1; in pci_quirk_nvidia_tegra_disable_rp_msi()
2947 while (pos && ttl--) { in ht_check_msi_mapping()
2975 dev_no = host_bridge->devfn >> 3; in host_bridge_with_leaf()
2977 dev = pci_get_slot(host_bridge->bus, PCI_DEVFN(i, 0)); in host_bridge_with_leaf()
3033 dev_no = dev->devfn >> 3; in nv_ht_enable_msi_mapping()
3034 for (i = dev_no; i >= 0; i--) { in nv_ht_enable_msi_mapping()
3035 host_bridge = pci_get_slot(dev->bus, PCI_DEVFN(i, 0)); in nv_ht_enable_msi_mapping()
3070 while (pos && ttl--) { in ht_disable_msi_mapping()
3103 * a non-HyperTransport host bridge. Locate the host bridge. in __nv_msi_ht_cap_quirk()
3105 host_bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus), 0, in __nv_msi_ht_cap_quirk()
3152 dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; in quirk_msi_intx_disable_bug()
3169 if ((p->revision < 0x3B) && (p->revision >= 0x30)) in quirk_msi_intx_disable_ati_bug()
3170 dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; in quirk_msi_intx_disable_ati_bug()
3177 if (dev->revision < 0x18) { in quirk_msi_intx_disable_qca_bug()
3179 dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; in quirk_msi_intx_disable_qca_bug()
3243 * Amazon's Annapurna Labs 1c36:0031 Root Ports don't support MSI-X, so it
3247 * tested), since currently there is no standard way to disable only MSI-X.
3254 dev->no_msi = 1; in quirk_al_msi_disable()
3255 pci_warn(dev, "Disabling MSI/MSI-X\n"); in quirk_al_msi_disable()
3263 * pci=hpmemsize=nnM and pci=hpiosize=nnM parameters. For some PCI-PCI
3270 dev->is_hotplug_bridge = 1; in quirk_hotplug_bridge()
3287 * MMC controller - so the SDHCI driver never sees them.
3311 if (PCI_FUNC(dev->devfn)) in ricoh_mmc_fixup_rl5c476()
3342 if (PCI_FUNC(dev->devfn)) in ricoh_mmc_fixup_r5c832()
3349 * 0x150 - SD2.0 mode enable for changing base clock in ricoh_mmc_fixup_r5c832()
3351 * 0xe1 - Base clock frequency in ricoh_mmc_fixup_r5c832()
3352 * 0x32 - 50Mhz new clock frequency in ricoh_mmc_fixup_r5c832()
3353 * 0xf9 - Key register for 0x150 in ricoh_mmc_fixup_r5c832()
3354 * 0xfc - key register for 0xe1 in ricoh_mmc_fixup_r5c832()
3356 if (dev->device == PCI_DEVICE_ID_RICOH_R5CE822 || in ricoh_mmc_fixup_r5c832()
3357 dev->device == PCI_DEVICE_ID_RICOH_R5CE823) { in ricoh_mmc_fixup_r5c832()
3394 * This is a quirk for masking VT-d spec-defined errors to platform error
3397 * on the RAS config settings of the platform) when a VT-d fault happens.
3400 * VT-d spec-related errors are already handled by the VT-d OS code, so no
3416 u32 class = dev->class; in fixup_ti816x_class()
3419 dev->class = PCI_CLASS_MULTIMEDIA_VIDEO << 8; in fixup_ti816x_class()
3420 pci_info(dev, "PCI class overridden (%#08x -> %#08x)\n", in fixup_ti816x_class()
3421 class, dev->class); in fixup_ti816x_class()
3432 dev->pcie_mpss = 1; /* 256 bytes */ in fixup_mpss_256()
3447 * coalescing must be disabled. Unfortunately, it cannot be re-enabled because
3483 /* Intel 5000 series memory controllers and ports 2-7 */
3498 /* Intel 5100 series memory controllers and ports 2-7 */
3525 resource_set_size(&dev->resource[2], (resource_size_t)1 << val); in quirk_intel_ntb()
3531 resource_set_size(&dev->resource[4], (resource_size_t)1 << val); in quirk_intel_ntb()
3540 * and the interrupt ends up -somewhere-.
3580 dev->d3hot_delay = 0; in quirk_remove_d3hot_delay()
3586 /* Lynxpoint-H PCH devices do not need 10ms d3hot_delay */
3616 dev->broken_intx_masking = 1; in quirk_broken_intx_masking()
3631 * RTL8110SC - Fails under PCI device assignment using DisINTx masking.
3638 * DisINTx can be set but the interrupt status bit is non-functional.
3678 * Check ConnectX-4/LX FW version to see if it supports legacy interrupts.
3694 if (pdev->device == mellanox_broken_intx_devs[i]) { in mellanox_check_broken_intx_masking()
3695 pdev->broken_intx_masking = 1; in mellanox_check_broken_intx_masking()
3701 * Getting here means Connect-IB cards and up. Connect-IB has no INTx in mellanox_check_broken_intx_masking()
3704 if (pdev->device == PCI_DEVICE_ID_MELLANOX_CONNECTIB) in mellanox_check_broken_intx_masking()
3707 if (pdev->device != PCI_DEVICE_ID_MELLANOX_CONNECTX4 && in mellanox_check_broken_intx_masking()
3708 pdev->device != PCI_DEVICE_ID_MELLANOX_CONNECTX4_LX) in mellanox_check_broken_intx_masking()
3711 /* For ConnectX-4 and ConnectX-4LX, need to check FW support */ in mellanox_check_broken_intx_masking()
3719 pci_warn(pdev, "Can't map ConnectX-4 initialization segment\n"); in mellanox_check_broken_intx_masking()
3731 …pci_warn(pdev, "ConnectX-4: FW %u.%u.%u doesn't support INTx masking, disabling. Please upgrade FW… in mellanox_check_broken_intx_masking()
3732 fw_major, fw_minor, fw_subminor, pdev->device == in mellanox_check_broken_intx_masking()
3734 pdev->broken_intx_masking = 1; in mellanox_check_broken_intx_masking()
3747 dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET; in quirk_no_bus_reset()
3756 if ((dev->device & 0xffc0) == 0x2340) in quirk_nvidia_no_bus_reset()
3764 * The device will throw a Link Down error on AER-capable systems and
3799 if (!pci_is_root_bus(dev->bus)) in quirk_no_pm_reset()
3800 dev->dev_flags |= PCI_DEV_FLAGS_NO_PM_RESET; in quirk_no_pm_reset()
3804 * Some AMD/ATI GPUS (HD8570 - Oland) report that a D3hot->D0 transition
3805 * causes a reset (i.e., they advertise NoSoftRst-). This transition seems
3815 * Spectrum-{1,2,3,4} devices report that a D3hot->D0 transition causes a reset
3816 * (i.e., they advertise NoSoftRst-). However, this transition does not have
3834 if (pdev->is_hotplug_bridge && in quirk_thunderbolt_hotplug_msi()
3835 (pdev->device != PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C || in quirk_thunderbolt_hotplug_msi()
3836 pdev->revision <= 1)) in quirk_thunderbolt_hotplug_msi()
3837 pdev->no_msi = 1; in quirk_thunderbolt_hotplug_msi()
3884 bridge = ACPI_HANDLE(&dev->dev); in quirk_apple_poweroff_thunderbolt()
3915 * Following are device-specific reset methods which can be used to
3916 * reset a single function if other methods (e.g. FLR, PM D0->D3) are
3922 * http://www.intel.com/content/dam/doc/datasheet/82599-10-gbe-controller-datasheet.pdf in reset_intel_82599_sfp_virtfn()
3952 return -ENOMEM; in reset_ivb_igd()
3983 /* Device-specific reset method for Chelsio T4-based adapters */
3990 * If this isn't a Chelsio T4-based device, return -ENOTTY indicating in reset_chelsio_generic_dev()
3991 * that we have no device-specific reset method. in reset_chelsio_generic_dev()
3993 if ((dev->device & 0xf000) != 0x4000) in reset_chelsio_generic_dev()
3994 return -ENOTTY; in reset_chelsio_generic_dev()
4020 * T4 also suffers a Head-Of-Line blocking problem if MSI-X interrupts in reset_chelsio_generic_dev()
4021 * are disabled when an MSI-X interrupt message needs to be delivered. in reset_chelsio_generic_dev()
4022 * So we briefly re-enable MSI-X interrupts for the duration of the in reset_chelsio_generic_dev()
4024 * MSI-X state. in reset_chelsio_generic_dev()
4026 pci_read_config_word(dev, dev->msix_cap+PCI_MSIX_FLAGS, &msix_flags); in reset_chelsio_generic_dev()
4028 pci_write_config_word(dev, dev->msix_cap+PCI_MSIX_FLAGS, in reset_chelsio_generic_dev()
4051 * FLR where config space reads from the device return -1. We seem to be
4068 if (dev->class != PCI_CLASS_STORAGE_EXPRESS || in nvme_disable_and_flr()
4070 return -ENOTTY; in nvme_disable_and_flr()
4077 return -ENOTTY; in nvme_disable_and_flr()
4156 /* Device-specific reset method for Huawei Intelligent NIC virtual functions */
4168 return -ENOTTY; in reset_hinic_vf_dev()
4174 return -ENOTTY; in reset_hinic_vf_dev()
4231 * These device-specific reset methods are here rather than in a driver
4239 for (i = pci_dev_reset_methods; i->reset; i++) { in pci_dev_specific_reset()
4240 if ((i->vendor == dev->vendor || in pci_dev_specific_reset()
4241 i->vendor == (u16)PCI_ANY_ID) && in pci_dev_specific_reset()
4242 (i->device == dev->device || in pci_dev_specific_reset()
4243 i->device == (u16)PCI_ANY_ID)) in pci_dev_specific_reset()
4244 return i->reset(dev, probe); in pci_dev_specific_reset()
4247 return -ENOTTY; in pci_dev_specific_reset()
4252 if (PCI_FUNC(dev->devfn) != 0) in quirk_dma_func0_alias()
4253 pci_add_dma_alias(dev, PCI_DEVFN(PCI_SLOT(dev->devfn), 0), 1); in quirk_dma_func0_alias()
4270 if (PCI_FUNC(dev->devfn) != 1) in quirk_dma_func1_alias()
4271 pci_add_dma_alias(dev, PCI_DEVFN(PCI_SLOT(dev->devfn), 1), 1); in quirk_dma_func1_alias()
4329 DECLARE_PCI_FIXUP_HEADER(0x1c28, /* Lite-On */
4339 * processor. To software, this appears as a PCIe-to-PCI/X bridge with a
4364 pci_add_dma_alias(dev, id->driver_data, 1); in quirk_fixed_dma_alias()
4369 * A few PCIe-to-PCI bridges fail to expose a PCIe capability, resulting in
4374 * is for a non-root, non-PCIe bridge where the upstream device is PCIe and
4375 * is not a PCIe-to-PCI bridge, then @pdev is actually a PCIe-to-PCI bridge.
4379 if (!pci_is_root_bus(pdev->bus) && in quirk_use_pcie_bridge_dma_alias()
4380 pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE && in quirk_use_pcie_bridge_dma_alias()
4381 !pci_is_pcie(pdev) && pci_is_pcie(pdev->bus->self) && in quirk_use_pcie_bridge_dma_alias()
4382 pci_pcie_type(pdev->bus->self) != PCI_EXP_TYPE_PCI_BRIDGE) in quirk_use_pcie_bridge_dma_alias()
4383 pdev->dev_flags |= PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS; in quirk_use_pcie_bridge_dma_alias()
4400 * when IOMMU is enabled. Following devfns have to match RIT-LUT table
4413 * Intel Visual Compute Accelerator (VCA) is a family of PCIe add-in devices
4448 pdev->dev_flags |= PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT; in quirk_bridge_cavm_thrx2_pcie_root()
4456 * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
4461 u32 class = pdev->class; in quirk_tw686x_class()
4464 pdev->class = (PCI_CLASS_MULTIMEDIA_OTHER << 8) | 0x01; in quirk_tw686x_class()
4465 pci_info(pdev, "TW686x PCI class overridden (%#08x -> %#08x)\n", in quirk_tw686x_class()
4466 class, pdev->class); in quirk_tw686x_class()
4484 dev->dev_flags |= PCI_DEV_FLAGS_NO_RELAXED_ORDERING; in quirk_relaxedordering_disable()
4567 * Per PCIe r3.0, sec 2.2.9, "Completion headers must supply the same
4571 * If a non-compliant device generates a completion with a different
4573 * seems non-compliant based on sec 2.3.2), or it may handle it as a
4577 * If the non-compliant device generates completions with zero attributes
4599 dev_name(&pdev->dev)); in quirk_disable_root_port_attributes()
4617 if ((pdev->device & 0xff00) == 0x5400) in quirk_chelsio_T5_disable_root_port_attributes()
4624 * pci_acs_ctrl_enabled - compare desired ACS controls with those provided
4642 * AMD has indicated that the devices below do not support peer-to-peer
4645 * peer-to-peer between functions can claim to support a subset of ACS.
4673 if (!dev->multifunction || !pci_is_root_bus(dev->bus)) in pci_quirk_amd_sb_acs()
4674 return -ENODEV; in pci_quirk_amd_sb_acs()
4679 return -ENODEV; in pci_quirk_amd_sb_acs()
4688 return -ENODEV; in pci_quirk_amd_sb_acs()
4697 switch (dev->device) { in pci_quirk_cavium_acs_match()
4714 return -ENOTTY; in pci_quirk_cavium_acs()
4731 * X-Gene Root Ports matching this quirk do not allow peer-to-peer in pci_quirk_xgene_acs()
4741 * But the implementation could block peer-to-peer transactions between them
4742 * and provide ACS-like functionality.
4749 return -ENOTTY; in pci_quirk_zhaoxin_pcie_ports_acs()
4755 switch (dev->device) { in pci_quirk_zhaoxin_pcie_ports_acs()
4767 * Many Intel PCH Root Ports do provide ACS-like features to disable peer
4782 /* Lynxpoint-H PCH */
4785 /* Lynxpoint-LP PCH */
4804 /* Filter out a few obvious non-matches first */ in pci_quirk_intel_pch_acs_match()
4809 if (pci_quirk_intel_pch_acs_ids[i] == dev->device) in pci_quirk_intel_pch_acs_match()
4818 return -ENOTTY; in pci_quirk_intel_pch_acs()
4820 if (dev->dev_flags & PCI_DEV_FLAGS_ACS_ENABLED_QUIRK) in pci_quirk_intel_pch_acs()
4828 * These QCOM Root Ports do provide ACS-like features to disable peer
4832 * Hardware doesn't support peer-to-peer and each Root Port is a Root
4858 return -ENOTTY; in pci_quirk_al_acs()
4862 * but do include ACS-like functionality. The hardware doesn't support in pci_quirk_al_acs()
4863 * peer-to-peer transactions via the root port and each has a unique in pci_quirk_al_acs()
4883 * 0xa110-0xa11f Sunrise Point-H PCI Express Root Port #{0-16}
4884 * 0xa167-0xa16a Sunrise Point-H PCI Express Root Port #{17-20}
4892 * Hub, Specification Update, January 2017, Revision 001, Document# 335194-001,
4896 * 0xa290-0xa29f PCI Express Root port #{0-16}
4897 * 0xa2e7-0xa2ee PCI Express Root port #{17-24}
4903 * August 2017, Revision 002, Document#: 334660-002)[6]
4906 * Quad Core Platforms, Vol 1 of 2, August 2017, Document#: 334658-003)[7]
4908 * 0x9d10-0x9d1b PCI Express Root port #{1-12}
4910 * [1] https://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-2.html
4911 * [2] https://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-1.html
4912 * [3] https://www.intel.com/content/www/us/en/chipsets/100-series-chipset-spec-update.html
4913 * [4] https://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-spec-update.html
4914 * [5] https://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-datasheet-vol-1.html
4915 …ww.intel.com/content/www/us/en/processors/core/7th-gen-core-family-mobile-u-y-processor-lines-i-o-…
4916 …tel.com/content/www/us/en/processors/core/7th-gen-core-family-mobile-u-y-processor-lines-i-o-datas…
4923 switch (dev->device) { in pci_quirk_intel_spt_pch_acs_match()
4941 return -ENOTTY; in pci_quirk_intel_spt_pch_acs()
4943 pos = dev->acs_cap; in pci_quirk_intel_spt_pch_acs()
4945 return -ENOTTY; in pci_quirk_intel_spt_pch_acs()
4962 * in their ACS capability if they support peer-to-peer transactions. in pci_quirk_mf_endpoint_acs()
4964 * perform peer-to-peer with other functions, allowing us to mask out in pci_quirk_mf_endpoint_acs()
4976 * addresses. Refer to Intel VT-d specification, r3.1, sec 3.16, in pci_quirk_rciep_acs()
4977 * "Root-Complex Peer to Peer Considerations". in pci_quirk_rciep_acs()
4980 return -ENOTTY; in pci_quirk_rciep_acs()
4990 * they do not allow peer-to-peer transactions between Root Ports. in pci_quirk_brcm_acs()
5000 * multi-function devices, the hardware isolates the functions by
5001 * directing all peer-to-peer traffic upstream as though PCI_ACS_RR and
5009 switch (dev->device) { in pci_quirk_wangxun_nic_acs()
5083 /* 82571 (Quads omitted due to non-ACS switch) */
5102 { 0x19a2, 0x710, pci_quirk_mf_endpoint_acs }, /* Emulex BE3-R */
5103 { 0x10df, 0x720, pci_quirk_mf_endpoint_acs }, /* Emulex Skyhawk-R */
5106 /* Cavium multi-function devices */
5110 /* APM X-Gene */
5121 /* Broadcom multi-function device */
5133 /* Zhaoxin multi-function devices */
5138 /* LX2xx0A : without security features + CAN-FD */
5142 /* LX2xx0C : security features + CAN-FD */
5154 /* LX2xx2A : without security features + CAN-FD */
5158 /* LX2xx2C : security features + CAN-FD */
5178 * pci_dev_specific_acs_enabled - check whether device provides ACS controls
5183 * -ENOTTY: No quirk applies to this device; we can't tell whether the
5195 * or control to indicate their support here. Multi-function express in pci_dev_specific_acs_enabled()
5196 * devices which do not allow internal peer-to-peer between functions, in pci_dev_specific_acs_enabled()
5199 for (i = pci_dev_acs_enabled; i->acs_enabled; i++) { in pci_dev_specific_acs_enabled()
5200 if ((i->vendor == dev->vendor || in pci_dev_specific_acs_enabled()
5201 i->vendor == (u16)PCI_ANY_ID) && in pci_dev_specific_acs_enabled()
5202 (i->device == dev->device || in pci_dev_specific_acs_enabled()
5203 i->device == (u16)PCI_ANY_ID)) { in pci_dev_specific_acs_enabled()
5204 ret = i->acs_enabled(dev, acs_flags); in pci_dev_specific_acs_enabled()
5210 return -ENOTTY; in pci_dev_specific_acs_enabled()
5222 /* Backbone Peer Non-Posted Disable */
5242 pci_bus_read_config_dword(dev->bus, PCI_DEVFN(31, 0), in pci_quirk_enable_intel_lpc_acs()
5245 return -EINVAL; in pci_quirk_enable_intel_lpc_acs()
5250 return -ENOMEM; in pci_quirk_enable_intel_lpc_acs()
5254 * therefore read-only. If both posted and non-posted peer cycles are in pci_quirk_enable_intel_lpc_acs()
5302 * if dev->external_facing || dev->untrusted
5307 return -ENOTTY; in pci_quirk_enable_intel_pch_acs()
5316 dev->dev_flags |= PCI_DEV_FLAGS_ACS_ENABLED_QUIRK; in pci_quirk_enable_intel_pch_acs()
5329 return -ENOTTY; in pci_quirk_enable_intel_spt_pch_acs()
5331 pos = dev->acs_cap; in pci_quirk_enable_intel_spt_pch_acs()
5333 return -ENOTTY; in pci_quirk_enable_intel_spt_pch_acs()
5343 if (pci_ats_disabled() || dev->external_facing || dev->untrusted) in pci_quirk_enable_intel_spt_pch_acs()
5359 return -ENOTTY; in pci_quirk_disable_intel_spt_pch_acs_redir()
5361 pos = dev->acs_cap; in pci_quirk_disable_intel_spt_pch_acs_redir()
5363 return -ENOTTY; in pci_quirk_disable_intel_spt_pch_acs_redir()
5399 if ((p->vendor == dev->vendor || in pci_dev_specific_enable_acs()
5400 p->vendor == (u16)PCI_ANY_ID) && in pci_dev_specific_enable_acs()
5401 (p->device == dev->device || in pci_dev_specific_enable_acs()
5402 p->device == (u16)PCI_ANY_ID) && in pci_dev_specific_enable_acs()
5403 p->enable_acs) { in pci_dev_specific_enable_acs()
5404 ret = p->enable_acs(dev); in pci_dev_specific_enable_acs()
5410 return -ENOTTY; in pci_dev_specific_enable_acs()
5420 if ((p->vendor == dev->vendor || in pci_dev_specific_disable_acs_redir()
5421 p->vendor == (u16)PCI_ANY_ID) && in pci_dev_specific_disable_acs_redir()
5422 (p->device == dev->device || in pci_dev_specific_disable_acs_redir()
5423 p->device == (u16)PCI_ANY_ID) && in pci_dev_specific_disable_acs_redir()
5424 p->disable_acs_redir) { in pci_dev_specific_disable_acs_redir()
5425 ret = p->disable_acs_redir(dev); in pci_dev_specific_disable_acs_redir()
5431 return -ENOTTY; in pci_dev_specific_disable_acs_redir()
5449 if (pdev->pcie_cap || pci_find_capability(pdev, PCI_CAP_ID_EXP)) in quirk_intel_qat_vf_cap()
5469 * Open-code some of set_pcie_port_type() and pci_cfg_space_size_ext() in quirk_intel_qat_vf_cap()
5482 pdev->pcie_cap = pos; in quirk_intel_qat_vf_cap()
5484 pdev->pcie_flags_reg = reg16; in quirk_intel_qat_vf_cap()
5486 pdev->pcie_mpss = reg16 & PCI_EXP_DEVCAP_PAYLOAD; in quirk_intel_qat_vf_cap()
5488 pdev->cfg_size = PCI_CFG_SPACE_EXP_SIZE; in quirk_intel_qat_vf_cap()
5491 pdev->cfg_size = PCI_CFG_SPACE_SIZE; in quirk_intel_qat_vf_cap()
5501 state->cap.cap_nr = PCI_CAP_ID_EXP; in quirk_intel_qat_vf_cap()
5502 state->cap.cap_extended = 0; in quirk_intel_qat_vf_cap()
5503 state->cap.size = size; in quirk_intel_qat_vf_cap()
5504 cap = (u16 *)&state->cap.data[0]; in quirk_intel_qat_vf_cap()
5512 hlist_add_head(&state->next, &pdev->saved_cap_space); in quirk_intel_qat_vf_cap()
5529 dev->dev_flags |= PCI_DEV_FLAGS_NO_FLR_RESET; in quirk_no_flr()
5542 if (dev->revision == 0x1) in quirk_no_flr_snet()
5549 struct pci_host_bridge *bridge = pci_find_host_bridge(pdev->bus); in quirk_no_ext_tags()
5554 bridge->no_ext_tags = 1; in quirk_no_ext_tags()
5557 pci_walk_bus(bridge->bus, pci_configure_extended_tags, NULL); in quirk_no_ext_tags()
5572 pdev->ats_cap = 0; in quirk_no_ats()
5582 if (pdev->device == 0x15d8) { in quirk_amd_harvest_no_ats()
5583 if (pdev->revision == 0xcf && in quirk_amd_harvest_no_ats()
5584 pdev->subsystem_vendor == 0xea50 && in quirk_amd_harvest_no_ats()
5585 (pdev->subsystem_device == 0xce19 || in quirk_amd_harvest_no_ats()
5586 pdev->subsystem_device == 0xcc10 || in quirk_amd_harvest_no_ats()
5587 pdev->subsystem_device == 0xcc08)) in quirk_amd_harvest_no_ats()
5621 if (pdev->revision < 0x20) in quirk_intel_e2000_no_ats()
5639 pdev->no_msi = 1; in quirk_fsl_no_msi()
5644 * Although not allowed by the spec, some multi-function devices have
5657 if (PCI_FUNC(pdev->devfn) != consumer) in pci_create_device_link()
5660 supplier_pdev = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), in pci_create_device_link()
5661 pdev->bus->number, in pci_create_device_link()
5662 PCI_DEVFN(PCI_SLOT(pdev->devfn), supplier)); in pci_create_device_link()
5663 if (!supplier_pdev || (supplier_pdev->class >> class_shift) != class) { in pci_create_device_link()
5668 if (device_link_add(&pdev->dev, &supplier_pdev->dev, in pci_create_device_link()
5676 pm_runtime_allow(&pdev->dev); in pci_create_device_link()
5709 * Create device link for GPUs with integrated Type-C UCSI controller
5736 if (gpu->device < PCI_DEVICE_ID_NVIDIA_GEFORCE_320M) in quirk_nvidia_hda()
5747 /* The GPU becomes a multi-function device when the HDA is enabled */ in quirk_nvidia_hda()
5749 gpu->multifunction = FIELD_GET(PCI_HEADER_TYPE_MFD, hdr_type); in quirk_nvidia_hda()
5760 * Validation. Here's the text of IDT 89H32H8G3-YC, erratum #36:
5762 * Item #36 - Downstream port applies ACS Source Validation to Completions
5775 * write, so we do config reads until we receive a non-Config Request Retry
5786 struct pci_dev *bridge = bus->self; in pci_idt_bus_quirk()
5788 pos = bridge->acs_cap; in pci_idt_bus_quirk()
5800 /* Write Vendor ID (read-only) so the endpoint latches its bus/dev */ in pci_idt_bus_quirk()
5804 /* Re-enable ACS_SV if it was previously enabled */ in pci_idt_bus_quirk()
5844 partition = ioread8(&mmio_ntb->partition_id); in quirk_switchtec_ntb_dma_alias()
5846 partition_map = ioread32(&mmio_ntb->ep_map); in quirk_switchtec_ntb_dma_alias()
5847 partition_map |= ((u64) ioread32(&mmio_ntb->ep_map + 4)) << 32; in quirk_switchtec_ntb_dma_alias()
5862 table_sz = ioread16(&mmio_peer_ctrl->req_id_table_size); in quirk_switchtec_ntb_dma_alias()
5879 rid_entry = ioread32(&mmio_peer_ctrl->req_id_table[te]); in quirk_switchtec_ntb_dma_alias()
6036 if (pdev->subsystem_vendor != PCI_VENDOR_ID_LENOVO || in quirk_reset_lenovo_thinkpad_p50_nvgpu()
6037 pdev->subsystem_device != 0x222e || in quirk_reset_lenovo_thinkpad_p50_nvgpu()
6080 dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT); in pci_fixup_no_d0_pme()
6092 * 7.3.27, 7.3.29-7.3.31.
6098 dev->no_msi = 1; in pci_fixup_no_msi_no_pme()
6101 dev->pme_support = 0; in pci_fixup_no_msi_no_pme()
6108 pdev->class = (PCI_CLASS_SYSTEM_OTHER << 8) | pdev->class; in apex_pci_fixup_class()
6114 * Pericom PI7C9X2G404/PI7C9X2G304/PI7C9X2G303 switch erratum E5 -
6134 if (!pdev->acs_cap) in pci_fixup_pericom_acs_store_forward()
6136 pci_read_config_word(pdev, pdev->acs_cap + PCI_ACS_CTRL, &val); in pci_fixup_pericom_acs_store_forward()
6146 pci_info(upstream, "Setting PI7C9X2Gxxx store-forward mode to avoid ACS erratum\n"); in pci_fixup_pericom_acs_store_forward()
6170 pdev->dev_flags |= PCI_DEV_FLAGS_HAS_MSI_MASKING; in nvidia_ion_ahci_fixup()
6177 dev->rom_bar_overlap = 1; in rom_bar_overlap_defect()
6194 u32 l1_lat = FIELD_GET(PCI_EXP_DEVCAP_L1, dev->devcap); in aspm_l1_acceptable_latency()
6197 dev->devcap |= FIELD_PREP(PCI_EXP_DEVCAP_L1, 7); in aspm_l1_acceptable_latency()
6251 dev->dpc_rp_log_size = PCIE_STD_NUM_TLP_HEADERLOG; in dpc_log_size()
6296 pdev->d3cold_delay = 1000; in pci_fixup_d3cold_delay_1sec()
6306 if (!parent || !parent->aer_cap) in pci_mask_replay_timer_timeout()
6312 pci_read_config_dword(parent, parent->aer_cap + PCI_ERR_COR_MASK, &val); in pci_mask_replay_timer_timeout()
6314 pci_write_config_dword(parent, parent->aer_cap + PCI_ERR_COR_MASK, val); in pci_mask_replay_timer_timeout()