History

Merge branch 'pci/pm'

- Check .bridge_d3() hook for NULL before calling it (Bjorn Helgaas) - Disable PME# for Pericom OHCI/UHCI USB controllers because it's not reliably asserted on USB hotplug (Kai-Heng Feng) - Assume ports without DLL Link Active train links in 100 ms to work around Thunderbolt bridge defects (Mika Westerberg) * pci/pm: PCI/PM: Assume ports without DLL Link Active train links in 100 ms PCI/PM: Adjust pcie_wait_for_link_delay() for caller delay PCI: Avoid Pericom USB controller OHCI/EHCI PME# defect serial: 8250_pci: Move Pericom IDs to pci_ids.h PCI/PM: Call .bridge_d3() hook only if non-NULL

Bjorn Helgaas committed 6 years ago

Commit ae7322a2 parents ff33cc2 ec411e04 files · +45 −18Browse files

Unified · Split

4 files
  1. drivers/pci/pci.c +26 −12
  2. drivers/pci/quirks.c +13 −0
  3. drivers/tty/serial/8250/8250_pci.c +0 −6
  4. include/linux/pci_ids.h +6 −0
drivers/pci/pci.c+26−12
@@ -844,7 +844,9 @@ static inline bool platform_pci_need_resume(struct pci_dev *dev) · 843 unmodified lines
844 844
845static inline bool platform_pci_bridge_d3(struct pci_dev *dev)845static inline bool platform_pci_bridge_d3(struct pci_dev *dev)
846{846{
847 return pci_platform_pm ? pci_platform_pm->bridge_d3(dev) : false;847 if (pci_platform_pm && pci_platform_pm->bridge_d3)
848 return pci_platform_pm->bridge_d3(dev);
849 return false;
848}850}
849 851
850/**852/**
@@ -4636,7 +4638,8 @@ static int pci_pm_reset(struct pci_dev *dev, int probe) · 3785 unmodified lines
4636 * pcie_wait_for_link_delay - Wait until link is active or inactive4638 * pcie_wait_for_link_delay - Wait until link is active or inactive
4637 * @pdev: Bridge device4639 * @pdev: Bridge device
4638 * @active: waiting for active or inactive?4640 * @active: waiting for active or inactive?
4639 * @delay: Delay to wait after link has become active (in ms)4641 * @delay: Delay to wait after link has become active (in ms). Specify %0
4642 * for no delay.
4640 *4643 *
4641 * Use this to wait till link becomes active or inactive.4644 * Use this to wait till link becomes active or inactive.
4642 */4645 */
@@ -4649,10 +4652,10 @@ static bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, · 6 unmodified lines
4649 4652
4650 /*4653 /*
4651 * Some controllers might not implement link active reporting. In this4654 * Some controllers might not implement link active reporting. In this
4652 * case, we wait for 1000 + 100 ms.4655 * case, we wait for 1000 ms + any delay requested by the caller.
4653 */4656 */
4654 if (!pdev->link_active_reporting) {4657 if (!pdev->link_active_reporting) {
4655 msleep(1100);4658 msleep(timeout + delay);
4656 return true;4659 return true;
4657 }4660 }
4658 4661
@@ -4677,7 +4680,7 @@ static bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, · 18 unmodified lines
4677 msleep(10);4680 msleep(10);
4678 timeout -= 10;4681 timeout -= 10;
4679 }4682 }
4680 if (active && ret)4683 if (active && ret && delay)
4681 msleep(delay);4684 msleep(delay);
4682 else if (ret != active)4685 else if (ret != active)
4683 pci_info(pdev, "Data Link Layer Link Active not %s in 1000 msec\n",4686 pci_info(pdev, "Data Link Layer Link Active not %s in 1000 msec\n",
@@ -4798,17 +4801,28 @@ void pci_bridge_wait_for_secondary_bus(struct pci_dev *dev) · 114 unmodified lines
4798 if (!pcie_downstream_port(dev))4801 if (!pcie_downstream_port(dev))
4799 return;4802 return;
4800 4803
4801 if (pcie_get_speed_cap(dev) <= PCIE_SPEED_5_0GT) {4804 /*
4802 pci_dbg(dev, "waiting %d ms for downstream link\n", delay);4805 * Per PCIe r5.0, sec 6.6.1, for downstream ports that support
4803 msleep(delay);4806 * speeds > 5 GT/s, we must wait for link training to complete
4804 } else {4807 * before the mandatory delay.
4805 pci_dbg(dev, "waiting %d ms for downstream link, after activation\n",4808 *
4806 delay);4809 * We can only tell when link training completes via DLL Link
4807 if (!pcie_wait_for_link_delay(dev, true, delay)) {4810 * Active, which is required for downstream ports that support
4811 * speeds > 5 GT/s (sec 7.5.3.6). Unfortunately some common
4812 * devices do not implement Link Active reporting even when it's
4813 * required, so we'll check for that directly instead of checking
4814 * the supported link speed. We assume devices without Link Active
4815 * reporting can train in 100 ms regardless of speed.
4816 */
4817 if (dev->link_active_reporting) {
4818 pci_dbg(dev, "waiting for link to train\n");
4819 if (!pcie_wait_for_link_delay(dev, true, 0)) {
4808 /* Did not train, no need to wait any further */4820 /* Did not train, no need to wait any further */
4809 return;4821 return;
4810 }4822 }
4811 }4823 }
4824 pci_dbg(child, "waiting %d ms to become accessible\n", delay);
4825 msleep(delay);
4812 4826
4813 if (!pci_device_is_present(child)) {4827 if (!pci_device_is_present(child)) {
4814 pci_dbg(child, "waiting additional %d ms to become accessible\n", delay);4828 pci_dbg(child, "waiting additional %d ms to become accessible\n", delay);
drivers/pci/quirks.c+13−0
@@ -5567,3 +5567,16 @@ static void pci_fixup_no_d0_pme(struct pci_dev *dev) · 5566 unmodified lines
5567 dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);5567 dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);
5568}5568}
5569DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);5569DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
5570
5571/*
5572 * Device [12d8:0x400e] and [12d8:0x400f]
5573 * These devices advertise PME# support in all power states but don't
5574 * reliably assert it.
5575 */
5576static void pci_fixup_no_pme(struct pci_dev *dev)
5577{
5578 pci_info(dev, "PME# is unreliable, disabling it\n");
5579 dev->pme_support = 0;
5580}
5581DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400e, pci_fixup_no_pme);
5582DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400f, pci_fixup_no_pme);
drivers/tty/serial/8250/8250_pci.c+0−6
@@ -1869,12 +1869,6 @@ pci_moxa_setup(struct serial_private *priv, · 1868 unmodified lines
1869#define PCIE_DEVICE_ID_WCH_CH384_4S 0x34701869#define PCIE_DEVICE_ID_WCH_CH384_4S 0x3470
1870#define PCIE_DEVICE_ID_WCH_CH382_2S 0x32531870#define PCIE_DEVICE_ID_WCH_CH382_2S 0x3253
1871 1871
1872#define PCI_VENDOR_ID_PERICOM 0x12D8
1873#define PCI_DEVICE_ID_PERICOM_PI7C9X7951 0x7951
1874#define PCI_DEVICE_ID_PERICOM_PI7C9X7952 0x7952
1875#define PCI_DEVICE_ID_PERICOM_PI7C9X7954 0x7954
1876#define PCI_DEVICE_ID_PERICOM_PI7C9X7958 0x7958
1877
1878#define PCI_VENDOR_ID_ACCESIO 0x494f1872#define PCI_VENDOR_ID_ACCESIO 0x494f
1879#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SDB 0x10511873#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SDB 0x1051
1880#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2S 0x10531874#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2S 0x1053
include/linux/pci_ids.h+6−0
@@ -1832,6 +1832,12 @@ · 1831 unmodified lines
1832#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d21832#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2
1833#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x00181833#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018
1834 1834
1835#define PCI_VENDOR_ID_PERICOM 0x12D8
1836#define PCI_DEVICE_ID_PERICOM_PI7C9X7951 0x7951
1837#define PCI_DEVICE_ID_PERICOM_PI7C9X7952 0x7952
1838#define PCI_DEVICE_ID_PERICOM_PI7C9X7954 0x7954
1839#define PCI_DEVICE_ID_PERICOM_PI7C9X7958 0x7958
1840
1835#define PCI_SUBVENDOR_ID_CHASE_PCIFAST 0x12E01841#define PCI_SUBVENDOR_ID_CHASE_PCIFAST 0x12E0
1836#define PCI_SUBDEVICE_ID_CHASE_PCIFAST4 0x00311842#define PCI_SUBDEVICE_ID_CHASE_PCIFAST4 0x0031
1837#define PCI_SUBDEVICE_ID_CHASE_PCIFAST8 0x00211843#define PCI_SUBDEVICE_ID_CHASE_PCIFAST8 0x0021