Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'pci/misc' into next

* pci/misc:
PCI: Clean up quirk_io_region
PCI: Use vma_pages() to replace (vm_end - vm_start) >> PAGE_SHIFT
PCI: Use PCI_EXP_SLTCAP_PSN mask when extracting slot number
PCI: Remove unnecessary dependencies between PME and ACPI
[SCSI] mvumi: Use PCI_VENDOR_ID_MARVELL_EXT for 0x1b4b
[SCSI] mvsas: Use PCI_VENDOR_ID_MARVELL_EXT for 0x1b4b
ahci: Use PCI_VENDOR_ID_MARVELL_EXT for 0x1b4b
PCI: Define macro for Marvell vendor ID
PCI: Add MSI INTX_DISABLE quirks for AR8161/AR8162/AR8171/AR8172/E210X
PCI: aer_inject: Fix return values when device not found

+80 -104
+5 -5
drivers/ata/ahci.c
··· 413 413 /* Marvell */ 414 414 { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ 415 415 { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */ 416 - { PCI_DEVICE(0x1b4b, 0x9123), 416 + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9123), 417 417 .class = PCI_CLASS_STORAGE_SATA_AHCI, 418 418 .class_mask = 0xffffff, 419 419 .driver_data = board_ahci_yes_fbs }, /* 88se9128 */ 420 - { PCI_DEVICE(0x1b4b, 0x9125), 420 + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9125), 421 421 .driver_data = board_ahci_yes_fbs }, /* 88se9125 */ 422 - { PCI_DEVICE(0x1b4b, 0x917a), 422 + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x917a), 423 423 .driver_data = board_ahci_yes_fbs }, /* 88se9172 */ 424 - { PCI_DEVICE(0x1b4b, 0x9192), 424 + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9192), 425 425 .driver_data = board_ahci_yes_fbs }, /* 88se9172 on some Gigabyte */ 426 - { PCI_DEVICE(0x1b4b, 0x91a3), 426 + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x91a3), 427 427 .driver_data = board_ahci_yes_fbs }, 428 428 429 429 /* Promise */
+1 -1
drivers/pci/hotplug/pciehp_acpi.c
··· 90 90 slot = kzalloc(sizeof(*slot), GFP_KERNEL); 91 91 if (!slot) 92 92 return -ENOMEM; 93 - slot->number = slot_cap >> 19; 93 + slot->number = (slot_cap & PCI_EXP_SLTCAP_PSN) >> 19; 94 94 list_for_each_entry(tmp, &dummy_slots, list) { 95 95 if (tmp->number == slot->number) 96 96 dup_slot_id++;
+1 -1
drivers/pci/pci-sysfs.c
··· 897 897 898 898 if (pci_resource_len(pdev, resno) == 0) 899 899 return 0; 900 - nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 900 + nr = vma_pages(vma); 901 901 start = vma->vm_pgoff; 902 902 size = ((pci_resource_len(pdev, resno) - 1) >> PAGE_SHIFT) + 1; 903 903 pci_start = (mmap_api == PCI_MMAP_PROCFS) ?
+1 -1
drivers/pci/pcie/Kconfig
··· 82 82 83 83 config PCIE_PME 84 84 def_bool y 85 - depends on PCIEPORTBUS && PM_RUNTIME && ACPI 85 + depends on PCIEPORTBUS && PM_RUNTIME
+3 -3
drivers/pci/pcie/aer/aer_inject.c
··· 334 334 return -ENODEV; 335 335 rpdev = pcie_find_root_port(dev); 336 336 if (!rpdev) { 337 - ret = -ENOTTY; 337 + ret = -ENODEV; 338 338 goto out_put; 339 339 } 340 340 341 341 pos_cap_err = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); 342 342 if (!pos_cap_err) { 343 - ret = -ENOTTY; 343 + ret = -EPERM; 344 344 goto out_put; 345 345 } 346 346 pci_read_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_SEVER, &sever); ··· 350 350 351 351 rp_pos_cap_err = pci_find_ext_capability(rpdev, PCI_EXT_CAP_ID_ERR); 352 352 if (!rp_pos_cap_err) { 353 - ret = -ENOTTY; 353 + ret = -EPERM; 354 354 goto out_put; 355 355 } 356 356
-2
drivers/pci/pcie/pme.c
··· 19 19 #include <linux/interrupt.h> 20 20 #include <linux/device.h> 21 21 #include <linux/pcieport_if.h> 22 - #include <linux/acpi.h> 23 - #include <linux/pci-acpi.h> 24 22 #include <linux/pm_runtime.h> 25 23 26 24 #include "../pci.h"
+63 -85
drivers/pci/quirks.c
··· 324 324 } 325 325 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, quirk_cs5536_vsa); 326 326 327 - static void quirk_io_region(struct pci_dev *dev, unsigned region, 328 - unsigned size, int nr, const char *name) 327 + static void quirk_io_region(struct pci_dev *dev, int port, 328 + unsigned size, int nr, const char *name) 329 329 { 330 - region &= ~(size-1); 331 - if (region) { 332 - struct pci_bus_region bus_region; 333 - struct resource *res = dev->resource + nr; 330 + u16 region; 331 + struct pci_bus_region bus_region; 332 + struct resource *res = dev->resource + nr; 334 333 335 - res->name = pci_name(dev); 336 - res->start = region; 337 - res->end = region + size - 1; 338 - res->flags = IORESOURCE_IO; 334 + pci_read_config_word(dev, port, &region); 335 + region &= ~(size - 1); 339 336 340 - /* Convert from PCI bus to resource space. */ 341 - bus_region.start = res->start; 342 - bus_region.end = res->end; 343 - pcibios_bus_to_resource(dev, res, &bus_region); 337 + if (!region) 338 + return; 344 339 345 - if (pci_claim_resource(dev, nr) == 0) 346 - dev_info(&dev->dev, "quirk: %pR claimed by %s\n", 347 - res, name); 348 - } 349 - } 340 + res->name = pci_name(dev); 341 + res->flags = IORESOURCE_IO; 342 + 343 + /* Convert from PCI bus to resource space */ 344 + bus_region.start = region; 345 + bus_region.end = region + size - 1; 346 + pcibios_bus_to_resource(dev, res, &bus_region); 347 + 348 + if (!pci_claim_resource(dev, nr)) 349 + dev_info(&dev->dev, "quirk: %pR claimed by %s\n", res, name); 350 + } 350 351 351 352 /* 352 353 * ATI Northbridge setups MCE the processor if you even ··· 375 374 */ 376 375 static void quirk_ali7101_acpi(struct pci_dev *dev) 377 376 { 378 - u16 region; 379 - 380 - pci_read_config_word(dev, 0xE0, &region); 381 - quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES, "ali7101 ACPI"); 382 - pci_read_config_word(dev, 0xE2, &region); 383 - quirk_io_region(dev, region, 32, PCI_BRIDGE_RESOURCES+1, "ali7101 SMB"); 377 + quirk_io_region(dev, 0xE0, 64, PCI_BRIDGE_RESOURCES, "ali7101 ACPI"); 378 + quirk_io_region(dev, 0xE2, 32, PCI_BRIDGE_RESOURCES+1, "ali7101 SMB"); 384 379 } 385 380 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, quirk_ali7101_acpi); 386 381 ··· 439 442 */ 440 443 static void quirk_piix4_acpi(struct pci_dev *dev) 441 444 { 442 - u32 region, res_a; 445 + u32 res_a; 443 446 444 - pci_read_config_dword(dev, 0x40, &region); 445 - quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES, "PIIX4 ACPI"); 446 - pci_read_config_dword(dev, 0x90, &region); 447 - quirk_io_region(dev, region, 16, PCI_BRIDGE_RESOURCES+1, "PIIX4 SMB"); 447 + quirk_io_region(dev, 0x40, 64, PCI_BRIDGE_RESOURCES, "PIIX4 ACPI"); 448 + quirk_io_region(dev, 0x90, 16, PCI_BRIDGE_RESOURCES+1, "PIIX4 SMB"); 448 449 449 450 /* Device resource A has enables for some of the other ones */ 450 451 pci_read_config_dword(dev, 0x5c, &res_a); ··· 486 491 */ 487 492 static void quirk_ich4_lpc_acpi(struct pci_dev *dev) 488 493 { 489 - u32 region; 490 494 u8 enable; 491 495 492 496 /* ··· 497 503 */ 498 504 499 505 pci_read_config_byte(dev, ICH_ACPI_CNTL, &enable); 500 - if (enable & ICH4_ACPI_EN) { 501 - pci_read_config_dword(dev, ICH_PMBASE, &region); 502 - region &= PCI_BASE_ADDRESS_IO_MASK; 503 - if (region >= PCIBIOS_MIN_IO) 504 - quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES, 505 - "ICH4 ACPI/GPIO/TCO"); 506 - } 506 + if (enable & ICH4_ACPI_EN) 507 + quirk_io_region(dev, ICH_PMBASE, 128, PCI_BRIDGE_RESOURCES, 508 + "ICH4 ACPI/GPIO/TCO"); 507 509 508 510 pci_read_config_byte(dev, ICH4_GPIO_CNTL, &enable); 509 - if (enable & ICH4_GPIO_EN) { 510 - pci_read_config_dword(dev, ICH4_GPIOBASE, &region); 511 - region &= PCI_BASE_ADDRESS_IO_MASK; 512 - if (region >= PCIBIOS_MIN_IO) 513 - quirk_io_region(dev, region, 64, 514 - PCI_BRIDGE_RESOURCES + 1, "ICH4 GPIO"); 515 - } 511 + if (enable & ICH4_GPIO_EN) 512 + quirk_io_region(dev, ICH4_GPIOBASE, 64, PCI_BRIDGE_RESOURCES+1, 513 + "ICH4 GPIO"); 516 514 } 517 515 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, quirk_ich4_lpc_acpi); 518 516 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_0, quirk_ich4_lpc_acpi); ··· 519 533 520 534 static void ich6_lpc_acpi_gpio(struct pci_dev *dev) 521 535 { 522 - u32 region; 523 536 u8 enable; 524 537 525 538 pci_read_config_byte(dev, ICH_ACPI_CNTL, &enable); 526 - if (enable & ICH6_ACPI_EN) { 527 - pci_read_config_dword(dev, ICH_PMBASE, &region); 528 - region &= PCI_BASE_ADDRESS_IO_MASK; 529 - if (region >= PCIBIOS_MIN_IO) 530 - quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES, 531 - "ICH6 ACPI/GPIO/TCO"); 532 - } 539 + if (enable & ICH6_ACPI_EN) 540 + quirk_io_region(dev, ICH_PMBASE, 128, PCI_BRIDGE_RESOURCES, 541 + "ICH6 ACPI/GPIO/TCO"); 533 542 534 543 pci_read_config_byte(dev, ICH6_GPIO_CNTL, &enable); 535 - if (enable & ICH6_GPIO_EN) { 536 - pci_read_config_dword(dev, ICH6_GPIOBASE, &region); 537 - region &= PCI_BASE_ADDRESS_IO_MASK; 538 - if (region >= PCIBIOS_MIN_IO) 539 - quirk_io_region(dev, region, 64, 540 - PCI_BRIDGE_RESOURCES + 1, "ICH6 GPIO"); 541 - } 544 + if (enable & ICH6_GPIO_EN) 545 + quirk_io_region(dev, ICH6_GPIOBASE, 64, PCI_BRIDGE_RESOURCES+1, 546 + "ICH6 GPIO"); 542 547 } 543 548 544 549 static void ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name, int dynsize) ··· 627 650 */ 628 651 static void quirk_vt82c586_acpi(struct pci_dev *dev) 629 652 { 630 - u32 region; 631 - 632 - if (dev->revision & 0x10) { 633 - pci_read_config_dword(dev, 0x48, &region); 634 - region &= PCI_BASE_ADDRESS_IO_MASK; 635 - quirk_io_region(dev, region, 256, PCI_BRIDGE_RESOURCES, "vt82c586 ACPI"); 636 - } 653 + if (dev->revision & 0x10) 654 + quirk_io_region(dev, 0x48, 256, PCI_BRIDGE_RESOURCES, 655 + "vt82c586 ACPI"); 637 656 } 638 657 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_vt82c586_acpi); 639 658 ··· 641 668 */ 642 669 static void quirk_vt82c686_acpi(struct pci_dev *dev) 643 670 { 644 - u16 hm; 645 - u32 smb; 646 - 647 671 quirk_vt82c586_acpi(dev); 648 672 649 - pci_read_config_word(dev, 0x70, &hm); 650 - hm &= PCI_BASE_ADDRESS_IO_MASK; 651 - quirk_io_region(dev, hm, 128, PCI_BRIDGE_RESOURCES + 1, "vt82c686 HW-mon"); 673 + quirk_io_region(dev, 0x70, 128, PCI_BRIDGE_RESOURCES+1, 674 + "vt82c686 HW-mon"); 652 675 653 - pci_read_config_dword(dev, 0x90, &smb); 654 - smb &= PCI_BASE_ADDRESS_IO_MASK; 655 - quirk_io_region(dev, smb, 16, PCI_BRIDGE_RESOURCES + 2, "vt82c686 SMB"); 676 + quirk_io_region(dev, 0x90, 16, PCI_BRIDGE_RESOURCES+2, "vt82c686 SMB"); 656 677 } 657 678 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vt82c686_acpi); 658 679 ··· 657 690 */ 658 691 static void quirk_vt8235_acpi(struct pci_dev *dev) 659 692 { 660 - u16 pm, smb; 661 - 662 - pci_read_config_word(dev, 0x88, &pm); 663 - pm &= PCI_BASE_ADDRESS_IO_MASK; 664 - quirk_io_region(dev, pm, 128, PCI_BRIDGE_RESOURCES, "vt8235 PM"); 665 - 666 - pci_read_config_word(dev, 0xd0, &smb); 667 - smb &= PCI_BASE_ADDRESS_IO_MASK; 668 - quirk_io_region(dev, smb, 16, PCI_BRIDGE_RESOURCES + 1, "vt8235 SMB"); 693 + quirk_io_region(dev, 0x88, 128, PCI_BRIDGE_RESOURCES, "vt8235 PM"); 694 + quirk_io_region(dev, 0xd0, 16, PCI_BRIDGE_RESOURCES+1, "vt8235 SMB"); 669 695 } 670 696 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_vt8235_acpi); 671 697 ··· 2554 2594 dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; 2555 2595 pci_dev_put(p); 2556 2596 } 2597 + static void quirk_msi_intx_disable_qca_bug(struct pci_dev *dev) 2598 + { 2599 + /* AR816X/AR817X/E210X MSI is fixed at HW level from revision 0x18 */ 2600 + if (dev->revision < 0x18) { 2601 + dev_info(&dev->dev, "set MSI_INTX_DISABLE_BUG flag\n"); 2602 + dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG; 2603 + } 2604 + } 2557 2605 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, 2558 2606 PCI_DEVICE_ID_TIGON3_5780, 2559 2607 quirk_msi_intx_disable_bug); ··· 2611 2643 quirk_msi_intx_disable_bug); 2612 2644 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATTANSIC, 0x1083, 2613 2645 quirk_msi_intx_disable_bug); 2646 + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATTANSIC, 0x1090, 2647 + quirk_msi_intx_disable_qca_bug); 2648 + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATTANSIC, 0x1091, 2649 + quirk_msi_intx_disable_qca_bug); 2650 + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATTANSIC, 0x10a0, 2651 + quirk_msi_intx_disable_qca_bug); 2652 + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATTANSIC, 0x10a1, 2653 + quirk_msi_intx_disable_qca_bug); 2654 + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATTANSIC, 0xe091, 2655 + quirk_msi_intx_disable_qca_bug); 2614 2656 #endif /* CONFIG_PCI_MSI */ 2615 2657 2616 2658 /* Allow manual resource allocation for PCI hotplug bridges
+3 -3
drivers/scsi/mvsas/mv_init.c
··· 703 703 { PCI_VDEVICE(TTI, 0x2744), chip_9480 }, 704 704 { PCI_VDEVICE(TTI, 0x2760), chip_9480 }, 705 705 { 706 - .vendor = 0x1b4b, 706 + .vendor = PCI_VENDOR_ID_MARVELL_EXT, 707 707 .device = 0x9480, 708 708 .subvendor = PCI_ANY_ID, 709 709 .subdevice = 0x9480, ··· 712 712 .driver_data = chip_9480, 713 713 }, 714 714 { 715 - .vendor = 0x1b4b, 715 + .vendor = PCI_VENDOR_ID_MARVELL_EXT, 716 716 .device = 0x9445, 717 717 .subvendor = PCI_ANY_ID, 718 718 .subdevice = 0x9480, ··· 721 721 .driver_data = chip_9445, 722 722 }, 723 723 { 724 - .vendor = 0x1b4b, 724 + .vendor = PCI_VENDOR_ID_MARVELL_EXT, 725 725 .device = 0x9485, 726 726 .subvendor = PCI_ANY_ID, 727 727 .subdevice = 0x9480,
+2 -2
drivers/scsi/mvumi.c
··· 49 49 MODULE_DESCRIPTION("Marvell UMI Driver"); 50 50 51 51 static DEFINE_PCI_DEVICE_TABLE(mvumi_pci_table) = { 52 - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_2, PCI_DEVICE_ID_MARVELL_MV9143) }, 53 - { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_2, PCI_DEVICE_ID_MARVELL_MV9580) }, 52 + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, PCI_DEVICE_ID_MARVELL_MV9143) }, 53 + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, PCI_DEVICE_ID_MARVELL_MV9580) }, 54 54 { 0 } 55 55 }; 56 56
-1
drivers/scsi/mvumi.h
··· 32 32 #define VER_BUILD 1500 33 33 34 34 #define MV_DRIVER_NAME "mvumi" 35 - #define PCI_VENDOR_ID_MARVELL_2 0x1b4b 36 35 #define PCI_DEVICE_ID_MARVELL_MV9143 0x9143 37 36 #define PCI_DEVICE_ID_MARVELL_MV9580 0x9580 38 37
+1
include/linux/pci_ids.h
··· 1604 1604 #define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334 1605 1605 1606 1606 #define PCI_VENDOR_ID_MARVELL 0x11ab 1607 + #define PCI_VENDOR_ID_MARVELL_EXT 0x1b4b 1607 1608 #define PCI_DEVICE_ID_MARVELL_GT64111 0x4146 1608 1609 #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 1609 1610 #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460