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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag '3.8-pci-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI updates from Bjorn Helgaas:
"Some fixes for v3.8. They include a fix for the new SR-IOV sysfs
management support, an expanded quirk for Ricoh SD card readers, a
Stratus DMI quirk fix, and a PME polling fix."

* tag '3.8-pci-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz
PCI/PM: Do not suspend port if any subordinate device needs PME polling
PCI: Add PCIe Link Capability link speed and width names
PCI: Work around Stratus ftServer broken PCIe hierarchy (fix DMI check)
PCI: Remove spurious error for sriov_numvfs store and simplify flow

+64 -56
+2 -1
arch/x86/pci/common.c
··· 434 434 .callback = set_scan_all, 435 435 .ident = "Stratus/NEC ftServer", 436 436 .matches = { 437 - DMI_MATCH(DMI_SYS_VENDOR, "ftServer"), 437 + DMI_MATCH(DMI_SYS_VENDOR, "Stratus"), 438 + DMI_MATCH(DMI_PRODUCT_NAME, "ftServer"), 438 439 }, 439 440 }, 440 441 {}
+35 -52
drivers/pci/pci-sysfs.c
··· 422 422 } 423 423 424 424 /* 425 - * num_vfs > 0; number of vfs to enable 426 - * num_vfs = 0; disable all vfs 425 + * num_vfs > 0; number of VFs to enable 426 + * num_vfs = 0; disable all VFs 427 427 * 428 428 * Note: SRIOV spec doesn't allow partial VF 429 - * disable, so its all or none. 429 + * disable, so it's all or none. 430 430 */ 431 431 static ssize_t sriov_numvfs_store(struct device *dev, 432 432 struct device_attribute *attr, 433 433 const char *buf, size_t count) 434 434 { 435 435 struct pci_dev *pdev = to_pci_dev(dev); 436 - int num_vfs_enabled = 0; 437 - int num_vfs; 438 - int ret = 0; 439 - u16 total; 436 + int ret; 437 + u16 num_vfs; 440 438 441 - if (kstrtoint(buf, 0, &num_vfs) < 0) 442 - return -EINVAL; 439 + ret = kstrtou16(buf, 0, &num_vfs); 440 + if (ret < 0) 441 + return ret; 442 + 443 + if (num_vfs > pci_sriov_get_totalvfs(pdev)) 444 + return -ERANGE; 445 + 446 + if (num_vfs == pdev->sriov->num_VFs) 447 + return count; /* no change */ 443 448 444 449 /* is PF driver loaded w/callback */ 445 450 if (!pdev->driver || !pdev->driver->sriov_configure) { 446 - dev_info(&pdev->dev, 447 - "Driver doesn't support SRIOV configuration via sysfs\n"); 451 + dev_info(&pdev->dev, "Driver doesn't support SRIOV configuration via sysfs\n"); 448 452 return -ENOSYS; 449 453 } 450 454 451 - /* if enabling vf's ... */ 452 - total = pci_sriov_get_totalvfs(pdev); 453 - /* Requested VFs to enable < totalvfs and none enabled already */ 454 - if ((num_vfs > 0) && (num_vfs <= total)) { 455 - if (pdev->sriov->num_VFs == 0) { 456 - num_vfs_enabled = 457 - pdev->driver->sriov_configure(pdev, num_vfs); 458 - if ((num_vfs_enabled >= 0) && 459 - (num_vfs_enabled != num_vfs)) { 460 - dev_warn(&pdev->dev, 461 - "Only %d VFs enabled\n", 462 - num_vfs_enabled); 463 - return count; 464 - } else if (num_vfs_enabled < 0) 465 - /* error code from driver callback */ 466 - return num_vfs_enabled; 467 - } else if (num_vfs == pdev->sriov->num_VFs) { 468 - dev_warn(&pdev->dev, 469 - "%d VFs already enabled; no enable action taken\n", 470 - num_vfs); 471 - return count; 472 - } else { 473 - dev_warn(&pdev->dev, 474 - "%d VFs already enabled. Disable before enabling %d VFs\n", 475 - pdev->sriov->num_VFs, num_vfs); 476 - return -EINVAL; 477 - } 478 - } 479 - 480 - /* disable vfs */ 481 455 if (num_vfs == 0) { 482 - if (pdev->sriov->num_VFs != 0) { 483 - ret = pdev->driver->sriov_configure(pdev, 0); 484 - return ret ? ret : count; 485 - } else { 486 - dev_warn(&pdev->dev, 487 - "All VFs disabled; no disable action taken\n"); 488 - return count; 489 - } 456 + /* disable VFs */ 457 + ret = pdev->driver->sriov_configure(pdev, 0); 458 + if (ret < 0) 459 + return ret; 460 + return count; 490 461 } 491 462 492 - dev_err(&pdev->dev, 493 - "Invalid value for number of VFs to enable: %d\n", num_vfs); 463 + /* enable VFs */ 464 + if (pdev->sriov->num_VFs) { 465 + dev_warn(&pdev->dev, "%d VFs already enabled. Disable before enabling %d VFs\n", 466 + pdev->sriov->num_VFs, num_vfs); 467 + return -EBUSY; 468 + } 494 469 495 - return -EINVAL; 470 + ret = pdev->driver->sriov_configure(pdev, num_vfs); 471 + if (ret < 0) 472 + return ret; 473 + 474 + if (ret != num_vfs) 475 + dev_warn(&pdev->dev, "%d VFs requested; only %d enabled\n", 476 + num_vfs, ret); 477 + 478 + return count; 496 479 } 497 480 498 481 static struct device_attribute sriov_totalvfs_attr = __ATTR_RO(sriov_totalvfs);
+19 -1
drivers/pci/pcie/portdrv_pci.c
··· 134 134 return 0; 135 135 } 136 136 137 + static int pci_dev_pme_poll(struct pci_dev *pdev, void *data) 138 + { 139 + bool *pme_poll = data; 140 + 141 + if (pdev->pme_poll) 142 + *pme_poll = true; 143 + return 0; 144 + } 145 + 137 146 static int pcie_port_runtime_idle(struct device *dev) 138 147 { 148 + struct pci_dev *pdev = to_pci_dev(dev); 149 + bool pme_poll = false; 150 + 151 + /* 152 + * If any subordinate device needs pme poll, we should keep 153 + * the port in D0, because we need port in D0 to poll it. 154 + */ 155 + pci_walk_bus(pdev->subordinate, pci_dev_pme_poll, &pme_poll); 139 156 /* Delay for a short while to prevent too frequent suspend/resume */ 140 - pm_schedule_suspend(dev, 10); 157 + if (!pme_poll) 158 + pm_schedule_suspend(dev, 10); 141 159 return -EBUSY; 142 160 } 143 161 #else
+5 -2
drivers/pci/quirks.c
··· 2725 2725 if (PCI_FUNC(dev->devfn)) 2726 2726 return; 2727 2727 /* 2728 - * RICOH 0xe823 SD/MMC card reader fails to recognize 2728 + * RICOH 0xe822 and 0xe823 SD/MMC card readers fail to recognize 2729 2729 * certain types of SD/MMC cards. Lowering the SD base 2730 2730 * clock frequency from 200Mhz to 50Mhz fixes this issue. 2731 2731 * ··· 2736 2736 * 0xf9 - Key register for 0x150 2737 2737 * 0xfc - key register for 0xe1 2738 2738 */ 2739 - if (dev->device == PCI_DEVICE_ID_RICOH_R5CE823) { 2739 + if (dev->device == PCI_DEVICE_ID_RICOH_R5CE822 || 2740 + dev->device == PCI_DEVICE_ID_RICOH_R5CE823) { 2740 2741 pci_write_config_byte(dev, 0xf9, 0xfc); 2741 2742 pci_write_config_byte(dev, 0x150, 0x10); 2742 2743 pci_write_config_byte(dev, 0xf9, 0x00); ··· 2764 2763 } 2765 2764 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832); 2766 2765 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832); 2766 + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE822, ricoh_mmc_fixup_r5c832); 2767 + DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE822, ricoh_mmc_fixup_r5c832); 2767 2768 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832); 2768 2769 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832); 2769 2770 #endif /*CONFIG_MMC_RICOH_MMC*/
+1
include/linux/pci_ids.h
··· 1568 1568 #define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 1569 1569 #define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 1570 1570 #define PCI_DEVICE_ID_RICOH_R5C822 0x0822 1571 + #define PCI_DEVICE_ID_RICOH_R5CE822 0xe822 1571 1572 #define PCI_DEVICE_ID_RICOH_R5CE823 0xe823 1572 1573 #define PCI_DEVICE_ID_RICOH_R5C832 0x0832 1573 1574 #define PCI_DEVICE_ID_RICOH_R5C843 0x0843
+2
include/uapi/linux/pci_regs.h
··· 458 458 #define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ 459 459 #define PCI_EXP_LNKCAP 12 /* Link Capabilities */ 460 460 #define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */ 461 + #define PCI_EXP_LNKCAP_SLS_2_5GB 0x1 /* LNKCAP2 SLS Vector bit 0 (2.5GT/s) */ 462 + #define PCI_EXP_LNKCAP_SLS_5_0GB 0x2 /* LNKCAP2 SLS Vector bit 1 (5.0GT/s) */ 461 463 #define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */ 462 464 #define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */ 463 465 #define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */