PCI updates for v3.8:
PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz PCI: Remove spurious error for sriov_numvfs store and simplify flow PCI: Add PCIe Link Capability link speed and width names PCI/PM: Do not suspend port if any subordinate device needs PME polling PCI: Work around Stratus ftServer broken PCIe hierarchy (fix DMI check) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAABAgAGBQJQ5HnVAAoJEPGMOI97Hn6zprgP/1we4RhVaXLRnmLyc9OpS97Z 9KZUU/rsMQ/RYstdNFV30JOypMFL1BlK7jpLR14gjSgCulKK9etvjBTwiV26Rfor n/LWru4CWUtGUH/2c4IwuN0FKxfU7W4GxuVfKi3uACh7yJRwKgxZhFKLLb4OZ/T0 A1CiIktdpZhH5A8+WdoSkZSsfQPuUA6UVKQleEQh/qJl9qgxwEDLsdj5fIZLsFUB Fo3bbusq2X+pHU0uuBIzrheSUeSmxXzeZcte8JxTEEwB/Gdsn24lJ39MK5PHAaOE gSVC7HDi+vNCICZhi7H93musPczL1TqeyMZQWSa/rj7KV836kG+Phz61SmsXTxyR VpfnEZOx7GreErpBuLKrOVslXJl1TBc/ZiiLd5SBUlO4ZClAssPcevtUexCR3xr6 eHoSYMtwblW/vgJ3rn/PD8SgksZVJsd6+JAlVbC53XAdeJuEheCdEU7HnQZ3ZQRF 6wpWOBfIxdSQM4AukncNjUSTQpVjNFoEXNcPBCamazDz9NgRIcrnBAd/94+AVD0t WQpoU0HDP6h00pK8Ls3Fsv23qbfPDPP9i6zhSGlv5Q9Sz5T8b178j8h7tkUgtPy/ vxAtwUgFwz5cxE053lrht0JEQUikv99VcUJKrQc17g6GIMenh4duXrxF1I1EERXD fcVZNas3SrnLSKfsVwws =Ehs+ -----END PGP SIGNATURE----- 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
This commit is contained in:
Коммит
080a62e2ce
|
@ -434,7 +434,8 @@ static const struct dmi_system_id __devinitconst pciprobe_dmi_table[] = {
|
|||
.callback = set_scan_all,
|
||||
.ident = "Stratus/NEC ftServer",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ftServer"),
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Stratus"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "ftServer"),
|
||||
},
|
||||
},
|
||||
{}
|
||||
|
|
|
@ -422,77 +422,60 @@ static ssize_t sriov_numvfs_show(struct device *dev,
|
|||
}
|
||||
|
||||
/*
|
||||
* num_vfs > 0; number of vfs to enable
|
||||
* num_vfs = 0; disable all vfs
|
||||
* num_vfs > 0; number of VFs to enable
|
||||
* num_vfs = 0; disable all VFs
|
||||
*
|
||||
* Note: SRIOV spec doesn't allow partial VF
|
||||
* disable, so its all or none.
|
||||
* disable, so it's all or none.
|
||||
*/
|
||||
static ssize_t sriov_numvfs_store(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
int num_vfs_enabled = 0;
|
||||
int num_vfs;
|
||||
int ret = 0;
|
||||
u16 total;
|
||||
int ret;
|
||||
u16 num_vfs;
|
||||
|
||||
if (kstrtoint(buf, 0, &num_vfs) < 0)
|
||||
return -EINVAL;
|
||||
ret = kstrtou16(buf, 0, &num_vfs);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (num_vfs > pci_sriov_get_totalvfs(pdev))
|
||||
return -ERANGE;
|
||||
|
||||
if (num_vfs == pdev->sriov->num_VFs)
|
||||
return count; /* no change */
|
||||
|
||||
/* is PF driver loaded w/callback */
|
||||
if (!pdev->driver || !pdev->driver->sriov_configure) {
|
||||
dev_info(&pdev->dev,
|
||||
"Driver doesn't support SRIOV configuration via sysfs\n");
|
||||
dev_info(&pdev->dev, "Driver doesn't support SRIOV configuration via sysfs\n");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
/* if enabling vf's ... */
|
||||
total = pci_sriov_get_totalvfs(pdev);
|
||||
/* Requested VFs to enable < totalvfs and none enabled already */
|
||||
if ((num_vfs > 0) && (num_vfs <= total)) {
|
||||
if (pdev->sriov->num_VFs == 0) {
|
||||
num_vfs_enabled =
|
||||
pdev->driver->sriov_configure(pdev, num_vfs);
|
||||
if ((num_vfs_enabled >= 0) &&
|
||||
(num_vfs_enabled != num_vfs)) {
|
||||
dev_warn(&pdev->dev,
|
||||
"Only %d VFs enabled\n",
|
||||
num_vfs_enabled);
|
||||
return count;
|
||||
} else if (num_vfs_enabled < 0)
|
||||
/* error code from driver callback */
|
||||
return num_vfs_enabled;
|
||||
} else if (num_vfs == pdev->sriov->num_VFs) {
|
||||
dev_warn(&pdev->dev,
|
||||
"%d VFs already enabled; no enable action taken\n",
|
||||
num_vfs);
|
||||
return count;
|
||||
} else {
|
||||
dev_warn(&pdev->dev,
|
||||
"%d VFs already enabled. Disable before enabling %d VFs\n",
|
||||
pdev->sriov->num_VFs, num_vfs);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
/* disable vfs */
|
||||
if (num_vfs == 0) {
|
||||
if (pdev->sriov->num_VFs != 0) {
|
||||
ret = pdev->driver->sriov_configure(pdev, 0);
|
||||
return ret ? ret : count;
|
||||
} else {
|
||||
dev_warn(&pdev->dev,
|
||||
"All VFs disabled; no disable action taken\n");
|
||||
return count;
|
||||
}
|
||||
/* disable VFs */
|
||||
ret = pdev->driver->sriov_configure(pdev, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
return count;
|
||||
}
|
||||
|
||||
dev_err(&pdev->dev,
|
||||
"Invalid value for number of VFs to enable: %d\n", num_vfs);
|
||||
/* enable VFs */
|
||||
if (pdev->sriov->num_VFs) {
|
||||
dev_warn(&pdev->dev, "%d VFs already enabled. Disable before enabling %d VFs\n",
|
||||
pdev->sriov->num_VFs, num_vfs);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
ret = pdev->driver->sriov_configure(pdev, num_vfs);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (ret != num_vfs)
|
||||
dev_warn(&pdev->dev, "%d VFs requested; only %d enabled\n",
|
||||
num_vfs, ret);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static struct device_attribute sriov_totalvfs_attr = __ATTR_RO(sriov_totalvfs);
|
||||
|
|
|
@ -134,10 +134,28 @@ static int pcie_port_runtime_resume(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pci_dev_pme_poll(struct pci_dev *pdev, void *data)
|
||||
{
|
||||
bool *pme_poll = data;
|
||||
|
||||
if (pdev->pme_poll)
|
||||
*pme_poll = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pcie_port_runtime_idle(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
bool pme_poll = false;
|
||||
|
||||
/*
|
||||
* If any subordinate device needs pme poll, we should keep
|
||||
* the port in D0, because we need port in D0 to poll it.
|
||||
*/
|
||||
pci_walk_bus(pdev->subordinate, pci_dev_pme_poll, &pme_poll);
|
||||
/* Delay for a short while to prevent too frequent suspend/resume */
|
||||
pm_schedule_suspend(dev, 10);
|
||||
if (!pme_poll)
|
||||
pm_schedule_suspend(dev, 10);
|
||||
return -EBUSY;
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -2725,7 +2725,7 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)
|
|||
if (PCI_FUNC(dev->devfn))
|
||||
return;
|
||||
/*
|
||||
* RICOH 0xe823 SD/MMC card reader fails to recognize
|
||||
* RICOH 0xe822 and 0xe823 SD/MMC card readers fail to recognize
|
||||
* certain types of SD/MMC cards. Lowering the SD base
|
||||
* clock frequency from 200Mhz to 50Mhz fixes this issue.
|
||||
*
|
||||
|
@ -2736,7 +2736,8 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)
|
|||
* 0xf9 - Key register for 0x150
|
||||
* 0xfc - key register for 0xe1
|
||||
*/
|
||||
if (dev->device == PCI_DEVICE_ID_RICOH_R5CE823) {
|
||||
if (dev->device == PCI_DEVICE_ID_RICOH_R5CE822 ||
|
||||
dev->device == PCI_DEVICE_ID_RICOH_R5CE823) {
|
||||
pci_write_config_byte(dev, 0xf9, 0xfc);
|
||||
pci_write_config_byte(dev, 0x150, 0x10);
|
||||
pci_write_config_byte(dev, 0xf9, 0x00);
|
||||
|
@ -2763,6 +2764,8 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)
|
|||
}
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
|
||||
DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE822, ricoh_mmc_fixup_r5c832);
|
||||
DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE822, ricoh_mmc_fixup_r5c832);
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832);
|
||||
DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832);
|
||||
#endif /*CONFIG_MMC_RICOH_MMC*/
|
||||
|
|
|
@ -1568,6 +1568,7 @@
|
|||
#define PCI_DEVICE_ID_RICOH_RL5C476 0x0476
|
||||
#define PCI_DEVICE_ID_RICOH_RL5C478 0x0478
|
||||
#define PCI_DEVICE_ID_RICOH_R5C822 0x0822
|
||||
#define PCI_DEVICE_ID_RICOH_R5CE822 0xe822
|
||||
#define PCI_DEVICE_ID_RICOH_R5CE823 0xe823
|
||||
#define PCI_DEVICE_ID_RICOH_R5C832 0x0832
|
||||
#define PCI_DEVICE_ID_RICOH_R5C843 0x0843
|
||||
|
|
|
@ -458,6 +458,8 @@
|
|||
#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
|
||||
#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
|
||||
#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */
|
||||
#define PCI_EXP_LNKCAP_SLS_2_5GB 0x1 /* LNKCAP2 SLS Vector bit 0 (2.5GT/s) */
|
||||
#define PCI_EXP_LNKCAP_SLS_5_0GB 0x2 /* LNKCAP2 SLS Vector bit 1 (5.0GT/s) */
|
||||
#define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */
|
||||
#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */
|
||||
#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */
|
||||
|
|
Загрузка…
Ссылка в новой задаче