diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/dmar.c | 13 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpqphp.h | 1 | ||||
-rw-r--r-- | drivers/pci/intel-iommu.c | 82 | ||||
-rw-r--r-- | drivers/pci/pci.c | 27 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv.c | 3 | ||||
-rw-r--r-- | drivers/pci/pcie/portdrv_pci.c | 3 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 38 | ||||
-rw-r--r-- | drivers/pci/setup-res.c | 37 |
8 files changed, 137 insertions, 67 deletions
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index 14bbaa17e2ca..22b02c6df854 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c | |||
@@ -354,6 +354,7 @@ dmar_table_print_dmar_entry(struct acpi_dmar_header *header) | |||
354 | struct acpi_dmar_hardware_unit *drhd; | 354 | struct acpi_dmar_hardware_unit *drhd; |
355 | struct acpi_dmar_reserved_memory *rmrr; | 355 | struct acpi_dmar_reserved_memory *rmrr; |
356 | struct acpi_dmar_atsr *atsr; | 356 | struct acpi_dmar_atsr *atsr; |
357 | struct acpi_dmar_rhsa *rhsa; | ||
357 | 358 | ||
358 | switch (header->type) { | 359 | switch (header->type) { |
359 | case ACPI_DMAR_TYPE_HARDWARE_UNIT: | 360 | case ACPI_DMAR_TYPE_HARDWARE_UNIT: |
@@ -375,6 +376,12 @@ dmar_table_print_dmar_entry(struct acpi_dmar_header *header) | |||
375 | atsr = container_of(header, struct acpi_dmar_atsr, header); | 376 | atsr = container_of(header, struct acpi_dmar_atsr, header); |
376 | printk(KERN_INFO PREFIX "ATSR flags: %#x\n", atsr->flags); | 377 | printk(KERN_INFO PREFIX "ATSR flags: %#x\n", atsr->flags); |
377 | break; | 378 | break; |
379 | case ACPI_DMAR_HARDWARE_AFFINITY: | ||
380 | rhsa = container_of(header, struct acpi_dmar_rhsa, header); | ||
381 | printk(KERN_INFO PREFIX "RHSA base: %#016Lx proximity domain: %#x\n", | ||
382 | (unsigned long long)rhsa->base_address, | ||
383 | rhsa->proximity_domain); | ||
384 | break; | ||
378 | } | 385 | } |
379 | } | 386 | } |
380 | 387 | ||
@@ -459,9 +466,13 @@ parse_dmar_table(void) | |||
459 | ret = dmar_parse_one_atsr(entry_header); | 466 | ret = dmar_parse_one_atsr(entry_header); |
460 | #endif | 467 | #endif |
461 | break; | 468 | break; |
469 | case ACPI_DMAR_HARDWARE_AFFINITY: | ||
470 | /* We don't do anything with RHSA (yet?) */ | ||
471 | break; | ||
462 | default: | 472 | default: |
463 | printk(KERN_WARNING PREFIX | 473 | printk(KERN_WARNING PREFIX |
464 | "Unknown DMAR structure type\n"); | 474 | "Unknown DMAR structure type %d\n", |
475 | entry_header->type); | ||
465 | ret = 0; /* for forward compatibility */ | 476 | ret = 0; /* for forward compatibility */ |
466 | break; | 477 | break; |
467 | } | 478 | } |
diff --git a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h index 53836001d511..9c6a9fd26812 100644 --- a/drivers/pci/hotplug/cpqphp.h +++ b/drivers/pci/hotplug/cpqphp.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/io.h> /* for read? and write? functions */ | 32 | #include <asm/io.h> /* for read? and write? functions */ |
33 | #include <linux/delay.h> /* for delays */ | 33 | #include <linux/delay.h> /* for delays */ |
34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
35 | #include <linux/sched.h> /* for signal_pending() */ | ||
35 | 36 | ||
36 | #define MY_NAME "cpqphp" | 37 | #define MY_NAME "cpqphp" |
37 | 38 | ||
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 855dd7ca47f3..b1e97e682500 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -48,6 +48,7 @@ | |||
48 | 48 | ||
49 | #define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY) | 49 | #define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY) |
50 | #define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) | 50 | #define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) |
51 | #define IS_AZALIA(pdev) ((pdev)->vendor == 0x8086 && (pdev)->device == 0x3a3e) | ||
51 | 52 | ||
52 | #define IOAPIC_RANGE_START (0xfee00000) | 53 | #define IOAPIC_RANGE_START (0xfee00000) |
53 | #define IOAPIC_RANGE_END (0xfeefffff) | 54 | #define IOAPIC_RANGE_END (0xfeefffff) |
@@ -94,6 +95,7 @@ static inline unsigned long virt_to_dma_pfn(void *p) | |||
94 | /* global iommu list, set NULL for ignored DMAR units */ | 95 | /* global iommu list, set NULL for ignored DMAR units */ |
95 | static struct intel_iommu **g_iommus; | 96 | static struct intel_iommu **g_iommus; |
96 | 97 | ||
98 | static void __init check_tylersburg_isoch(void); | ||
97 | static int rwbf_quirk; | 99 | static int rwbf_quirk; |
98 | 100 | ||
99 | /* | 101 | /* |
@@ -1934,6 +1936,9 @@ error: | |||
1934 | } | 1936 | } |
1935 | 1937 | ||
1936 | static int iommu_identity_mapping; | 1938 | static int iommu_identity_mapping; |
1939 | #define IDENTMAP_ALL 1 | ||
1940 | #define IDENTMAP_GFX 2 | ||
1941 | #define IDENTMAP_AZALIA 4 | ||
1937 | 1942 | ||
1938 | static int iommu_domain_identity_map(struct dmar_domain *domain, | 1943 | static int iommu_domain_identity_map(struct dmar_domain *domain, |
1939 | unsigned long long start, | 1944 | unsigned long long start, |
@@ -2151,8 +2156,14 @@ static int domain_add_dev_info(struct dmar_domain *domain, | |||
2151 | 2156 | ||
2152 | static int iommu_should_identity_map(struct pci_dev *pdev, int startup) | 2157 | static int iommu_should_identity_map(struct pci_dev *pdev, int startup) |
2153 | { | 2158 | { |
2154 | if (iommu_identity_mapping == 2) | 2159 | if ((iommu_identity_mapping & IDENTMAP_AZALIA) && IS_AZALIA(pdev)) |
2155 | return IS_GFX_DEVICE(pdev); | 2160 | return 1; |
2161 | |||
2162 | if ((iommu_identity_mapping & IDENTMAP_GFX) && IS_GFX_DEVICE(pdev)) | ||
2163 | return 1; | ||
2164 | |||
2165 | if (!(iommu_identity_mapping & IDENTMAP_ALL)) | ||
2166 | return 0; | ||
2156 | 2167 | ||
2157 | /* | 2168 | /* |
2158 | * We want to start off with all devices in the 1:1 domain, and | 2169 | * We want to start off with all devices in the 1:1 domain, and |
@@ -2332,11 +2343,14 @@ int __init init_dmars(void) | |||
2332 | } | 2343 | } |
2333 | 2344 | ||
2334 | if (iommu_pass_through) | 2345 | if (iommu_pass_through) |
2335 | iommu_identity_mapping = 1; | 2346 | iommu_identity_mapping |= IDENTMAP_ALL; |
2347 | |||
2336 | #ifdef CONFIG_DMAR_BROKEN_GFX_WA | 2348 | #ifdef CONFIG_DMAR_BROKEN_GFX_WA |
2337 | else | 2349 | iommu_identity_mapping |= IDENTMAP_GFX; |
2338 | iommu_identity_mapping = 2; | ||
2339 | #endif | 2350 | #endif |
2351 | |||
2352 | check_tylersburg_isoch(); | ||
2353 | |||
2340 | /* | 2354 | /* |
2341 | * If pass through is not set or not enabled, setup context entries for | 2355 | * If pass through is not set or not enabled, setup context entries for |
2342 | * identity mappings for rmrr, gfx, and isa and may fall back to static | 2356 | * identity mappings for rmrr, gfx, and isa and may fall back to static |
@@ -3670,3 +3684,61 @@ static void __devinit quirk_iommu_rwbf(struct pci_dev *dev) | |||
3670 | } | 3684 | } |
3671 | 3685 | ||
3672 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf); | 3686 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf); |
3687 | |||
3688 | /* On Tylersburg chipsets, some BIOSes have been known to enable the | ||
3689 | ISOCH DMAR unit for the Azalia sound device, but not give it any | ||
3690 | TLB entries, which causes it to deadlock. Check for that. We do | ||
3691 | this in a function called from init_dmars(), instead of in a PCI | ||
3692 | quirk, because we don't want to print the obnoxious "BIOS broken" | ||
3693 | message if VT-d is actually disabled. | ||
3694 | */ | ||
3695 | static void __init check_tylersburg_isoch(void) | ||
3696 | { | ||
3697 | struct pci_dev *pdev; | ||
3698 | uint32_t vtisochctrl; | ||
3699 | |||
3700 | /* If there's no Azalia in the system anyway, forget it. */ | ||
3701 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x3a3e, NULL); | ||
3702 | if (!pdev) | ||
3703 | return; | ||
3704 | pci_dev_put(pdev); | ||
3705 | |||
3706 | /* System Management Registers. Might be hidden, in which case | ||
3707 | we can't do the sanity check. But that's OK, because the | ||
3708 | known-broken BIOSes _don't_ actually hide it, so far. */ | ||
3709 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x342e, NULL); | ||
3710 | if (!pdev) | ||
3711 | return; | ||
3712 | |||
3713 | if (pci_read_config_dword(pdev, 0x188, &vtisochctrl)) { | ||
3714 | pci_dev_put(pdev); | ||
3715 | return; | ||
3716 | } | ||
3717 | |||
3718 | pci_dev_put(pdev); | ||
3719 | |||
3720 | /* If Azalia DMA is routed to the non-isoch DMAR unit, fine. */ | ||
3721 | if (vtisochctrl & 1) | ||
3722 | return; | ||
3723 | |||
3724 | /* Drop all bits other than the number of TLB entries */ | ||
3725 | vtisochctrl &= 0x1c; | ||
3726 | |||
3727 | /* If we have the recommended number of TLB entries (16), fine. */ | ||
3728 | if (vtisochctrl == 0x10) | ||
3729 | return; | ||
3730 | |||
3731 | /* Zero TLB entries? You get to ride the short bus to school. */ | ||
3732 | if (!vtisochctrl) { | ||
3733 | WARN(1, "Your BIOS is broken; DMA routed to ISOCH DMAR unit but no TLB space.\n" | ||
3734 | "BIOS vendor: %s; Ver: %s; Product Version: %s\n", | ||
3735 | dmi_get_system_info(DMI_BIOS_VENDOR), | ||
3736 | dmi_get_system_info(DMI_BIOS_VERSION), | ||
3737 | dmi_get_system_info(DMI_PRODUCT_VERSION)); | ||
3738 | iommu_identity_mapping |= IDENTMAP_AZALIA; | ||
3739 | return; | ||
3740 | } | ||
3741 | |||
3742 | printk(KERN_WARNING "DMAR: Recommended TLB entries for ISOCH unit is 16; your BIOS set %d\n", | ||
3743 | vtisochctrl); | ||
3744 | } | ||
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 6edecff0b419..4e4c295a049f 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -513,7 +513,11 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
513 | else if (state == PCI_D2 || dev->current_state == PCI_D2) | 513 | else if (state == PCI_D2 || dev->current_state == PCI_D2) |
514 | udelay(PCI_PM_D2_DELAY); | 514 | udelay(PCI_PM_D2_DELAY); |
515 | 515 | ||
516 | dev->current_state = state; | 516 | pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); |
517 | dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK); | ||
518 | if (dev->current_state != state && printk_ratelimit()) | ||
519 | dev_info(&dev->dev, "Refused to change power state, " | ||
520 | "currently in D%d\n", dev->current_state); | ||
517 | 521 | ||
518 | /* According to section 5.4.1 of the "PCI BUS POWER MANAGEMENT | 522 | /* According to section 5.4.1 of the "PCI BUS POWER MANAGEMENT |
519 | * INTERFACE SPECIFICATION, REV. 1.2", a device transitioning | 523 | * INTERFACE SPECIFICATION, REV. 1.2", a device transitioning |
@@ -2542,10 +2546,10 @@ int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type) | |||
2542 | 2546 | ||
2543 | /** | 2547 | /** |
2544 | * pci_set_vga_state - set VGA decode state on device and parents if requested | 2548 | * pci_set_vga_state - set VGA decode state on device and parents if requested |
2545 | * @dev the PCI device | 2549 | * @dev: the PCI device |
2546 | * @decode - true = enable decoding, false = disable decoding | 2550 | * @decode: true = enable decoding, false = disable decoding |
2547 | * @command_bits PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY | 2551 | * @command_bits: PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY |
2548 | * @change_bridge - traverse ancestors and change bridges | 2552 | * @change_bridge: traverse ancestors and change bridges |
2549 | */ | 2553 | */ |
2550 | int pci_set_vga_state(struct pci_dev *dev, bool decode, | 2554 | int pci_set_vga_state(struct pci_dev *dev, bool decode, |
2551 | unsigned int command_bits, bool change_bridge) | 2555 | unsigned int command_bits, bool change_bridge) |
@@ -2719,17 +2723,6 @@ int __attribute__ ((weak)) pci_ext_cfg_avail(struct pci_dev *dev) | |||
2719 | return 1; | 2723 | return 1; |
2720 | } | 2724 | } |
2721 | 2725 | ||
2722 | static int __devinit pci_init(void) | ||
2723 | { | ||
2724 | struct pci_dev *dev = NULL; | ||
2725 | |||
2726 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | ||
2727 | pci_fixup_device(pci_fixup_final, dev); | ||
2728 | } | ||
2729 | |||
2730 | return 0; | ||
2731 | } | ||
2732 | |||
2733 | static int __init pci_setup(char *str) | 2726 | static int __init pci_setup(char *str) |
2734 | { | 2727 | { |
2735 | while (str) { | 2728 | while (str) { |
@@ -2767,8 +2760,6 @@ static int __init pci_setup(char *str) | |||
2767 | } | 2760 | } |
2768 | early_param("pci", pci_setup); | 2761 | early_param("pci", pci_setup); |
2769 | 2762 | ||
2770 | device_initcall(pci_init); | ||
2771 | |||
2772 | EXPORT_SYMBOL(pci_reenable_device); | 2763 | EXPORT_SYMBOL(pci_reenable_device); |
2773 | EXPORT_SYMBOL(pci_enable_device_io); | 2764 | EXPORT_SYMBOL(pci_enable_device_io); |
2774 | EXPORT_SYMBOL(pci_enable_device_mem); | 2765 | EXPORT_SYMBOL(pci_enable_device_mem); |
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 2ce8f9ccc66e..40c3cc5d1caf 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/pci.h> | 19 | #include <linux/pci.h> |
20 | #include <linux/sched.h> | ||
20 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
21 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
22 | #include <linux/pm.h> | 23 | #include <linux/pm.h> |
@@ -52,7 +53,7 @@ static struct pci_error_handlers aer_error_handlers = { | |||
52 | 53 | ||
53 | static struct pcie_port_service_driver aerdriver = { | 54 | static struct pcie_port_service_driver aerdriver = { |
54 | .name = "aer", | 55 | .name = "aer", |
55 | .port_type = PCIE_ANY_PORT, | 56 | .port_type = PCIE_RC_PORT, |
56 | .service = PCIE_PORT_SERVICE_AER, | 57 | .service = PCIE_PORT_SERVICE_AER, |
57 | 58 | ||
58 | .probe = aer_probe, | 59 | .probe = aer_probe, |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 6df5c984a791..f635e476d632 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -30,7 +30,6 @@ MODULE_DESCRIPTION(DRIVER_DESC); | |||
30 | MODULE_LICENSE("GPL"); | 30 | MODULE_LICENSE("GPL"); |
31 | 31 | ||
32 | /* global data */ | 32 | /* global data */ |
33 | static const char device_name[] = "pcieport-driver"; | ||
34 | 33 | ||
35 | static int pcie_portdrv_restore_config(struct pci_dev *dev) | 34 | static int pcie_portdrv_restore_config(struct pci_dev *dev) |
36 | { | 35 | { |
@@ -262,7 +261,7 @@ static struct pci_error_handlers pcie_portdrv_err_handler = { | |||
262 | }; | 261 | }; |
263 | 262 | ||
264 | static struct pci_driver pcie_portdriver = { | 263 | static struct pci_driver pcie_portdriver = { |
265 | .name = (char *)device_name, | 264 | .name = "pcieport", |
266 | .id_table = &port_pci_ids[0], | 265 | .id_table = &port_pci_ids[0], |
267 | 266 | ||
268 | .probe = pcie_portdrv_probe, | 267 | .probe = pcie_portdrv_probe, |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 6099facecd79..245d2cdb4765 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -670,6 +670,25 @@ static void __devinit quirk_vt8235_acpi(struct pci_dev *dev) | |||
670 | } | 670 | } |
671 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_vt8235_acpi); | 671 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_vt8235_acpi); |
672 | 672 | ||
673 | /* | ||
674 | * TI XIO2000a PCIe-PCI Bridge erroneously reports it supports fast back-to-back: | ||
675 | * Disable fast back-to-back on the secondary bus segment | ||
676 | */ | ||
677 | static void __devinit quirk_xio2000a(struct pci_dev *dev) | ||
678 | { | ||
679 | struct pci_dev *pdev; | ||
680 | u16 command; | ||
681 | |||
682 | dev_warn(&dev->dev, "TI XIO2000a quirk detected; " | ||
683 | "secondary bus fast back-to-back transfers disabled\n"); | ||
684 | list_for_each_entry(pdev, &dev->subordinate->devices, bus_list) { | ||
685 | pci_read_config_word(pdev, PCI_COMMAND, &command); | ||
686 | if (command & PCI_COMMAND_FAST_BACK) | ||
687 | pci_write_config_word(pdev, PCI_COMMAND, command & ~PCI_COMMAND_FAST_BACK); | ||
688 | } | ||
689 | } | ||
690 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XIO2000A, | ||
691 | quirk_xio2000a); | ||
673 | 692 | ||
674 | #ifdef CONFIG_X86_IO_APIC | 693 | #ifdef CONFIG_X86_IO_APIC |
675 | 694 | ||
@@ -990,7 +1009,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, | |||
990 | 1009 | ||
991 | static void __devinit quirk_amd_ide_mode(struct pci_dev *pdev) | 1010 | static void __devinit quirk_amd_ide_mode(struct pci_dev *pdev) |
992 | { | 1011 | { |
993 | /* set SBX00 SATA in IDE mode to AHCI mode */ | 1012 | /* set SBX00/Hudson-2 SATA in IDE mode to AHCI mode */ |
994 | u8 tmp; | 1013 | u8 tmp; |
995 | 1014 | ||
996 | pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); | 1015 | pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); |
@@ -1009,8 +1028,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk | |||
1009 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_amd_ide_mode); | 1028 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_amd_ide_mode); |
1010 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); | 1029 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); |
1011 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); | 1030 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); |
1012 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SB900_SATA_IDE, quirk_amd_ide_mode); | 1031 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode); |
1013 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SB900_SATA_IDE, quirk_amd_ide_mode); | 1032 | DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode); |
1014 | 1033 | ||
1015 | /* | 1034 | /* |
1016 | * Serverworks CSB5 IDE does not fully support native mode | 1035 | * Serverworks CSB5 IDE does not fully support native mode |
@@ -2572,6 +2591,19 @@ void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) | |||
2572 | } | 2591 | } |
2573 | pci_do_fixups(dev, start, end); | 2592 | pci_do_fixups(dev, start, end); |
2574 | } | 2593 | } |
2594 | |||
2595 | static int __init pci_apply_final_quirks(void) | ||
2596 | { | ||
2597 | struct pci_dev *dev = NULL; | ||
2598 | |||
2599 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | ||
2600 | pci_fixup_device(pci_fixup_final, dev); | ||
2601 | } | ||
2602 | |||
2603 | return 0; | ||
2604 | } | ||
2605 | |||
2606 | fs_initcall_sync(pci_apply_final_quirks); | ||
2575 | #else | 2607 | #else |
2576 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) {} | 2608 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) {} |
2577 | #endif | 2609 | #endif |
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 706f82d8111f..c54526b206b5 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -205,43 +205,6 @@ int pci_assign_resource(struct pci_dev *dev, int resno) | |||
205 | return ret; | 205 | return ret; |
206 | } | 206 | } |
207 | 207 | ||
208 | #if 0 | ||
209 | int pci_assign_resource_fixed(struct pci_dev *dev, int resno) | ||
210 | { | ||
211 | struct pci_bus *bus = dev->bus; | ||
212 | struct resource *res = dev->resource + resno; | ||
213 | unsigned int type_mask; | ||
214 | int i, ret = -EBUSY; | ||
215 | |||
216 | type_mask = IORESOURCE_IO | IORESOURCE_MEM | IORESOURCE_PREFETCH; | ||
217 | |||
218 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { | ||
219 | struct resource *r = bus->resource[i]; | ||
220 | if (!r) | ||
221 | continue; | ||
222 | |||
223 | /* type_mask must match */ | ||
224 | if ((res->flags ^ r->flags) & type_mask) | ||
225 | continue; | ||
226 | |||
227 | ret = request_resource(r, res); | ||
228 | |||
229 | if (ret == 0) | ||
230 | break; | ||
231 | } | ||
232 | |||
233 | if (ret) { | ||
234 | dev_err(&dev->dev, "BAR %d: can't allocate %s resource %pR\n", | ||
235 | resno, res->flags & IORESOURCE_IO ? "I/O" : "mem", res); | ||
236 | } else if (resno < PCI_BRIDGE_RESOURCES) { | ||
237 | pci_update_resource(dev, resno); | ||
238 | } | ||
239 | |||
240 | return ret; | ||
241 | } | ||
242 | EXPORT_SYMBOL_GPL(pci_assign_resource_fixed); | ||
243 | #endif | ||
244 | |||
245 | /* Sort resources by alignment */ | 208 | /* Sort resources by alignment */ |
246 | void pdev_sort_resources(struct pci_dev *dev, struct resource_list *head) | 209 | void pdev_sort_resources(struct pci_dev *dev, struct resource_list *head) |
247 | { | 210 | { |