Skip to content

Commit 23ee3e4

Browse files
committed
Merge tag 'pci-v5.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into master
Pull PCI fixes from Bjorn Helgaas: - Reject invalid IRQ 0 command line argument for virtio_mmio because IRQ 0 now generates warnings (Bjorn Helgaas) - Revert "PCI/PM: Assume ports without DLL Link Active train links in 100 ms", which broke nouveau (Bjorn Helgaas) * tag 'pci-v5.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: Revert "PCI/PM: Assume ports without DLL Link Active train links in 100 ms" virtio-mmio: Reject invalid IRQ 0 command line argument
2 parents 5876aa0 + d08c30d commit 23ee3e4

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

drivers/pci/pci.c

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4638,8 +4638,7 @@ static int pci_pm_reset(struct pci_dev *dev, int probe)
46384638
* pcie_wait_for_link_delay - Wait until link is active or inactive
46394639
* @pdev: Bridge device
46404640
* @active: waiting for active or inactive?
4641-
* @delay: Delay to wait after link has become active (in ms). Specify %0
4642-
* for no delay.
4641+
* @delay: Delay to wait after link has become active (in ms)
46434642
*
46444643
* Use this to wait till link becomes active or inactive.
46454644
*/
@@ -4680,7 +4679,7 @@ static bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active,
46804679
msleep(10);
46814680
timeout -= 10;
46824681
}
4683-
if (active && ret && delay)
4682+
if (active && ret)
46844683
msleep(delay);
46854684
else if (ret != active)
46864685
pci_info(pdev, "Data Link Layer Link Active not %s in 1000 msec\n",
@@ -4801,28 +4800,17 @@ void pci_bridge_wait_for_secondary_bus(struct pci_dev *dev)
48014800
if (!pcie_downstream_port(dev))
48024801
return;
48034802

4804-
/*
4805-
* Per PCIe r5.0, sec 6.6.1, for downstream ports that support
4806-
* speeds > 5 GT/s, we must wait for link training to complete
4807-
* before the mandatory delay.
4808-
*
4809-
* We can only tell when link training completes via DLL Link
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)) {
4803+
if (pcie_get_speed_cap(dev) <= PCIE_SPEED_5_0GT) {
4804+
pci_dbg(dev, "waiting %d ms for downstream link\n", delay);
4805+
msleep(delay);
4806+
} else {
4807+
pci_dbg(dev, "waiting %d ms for downstream link, after activation\n",
4808+
delay);
4809+
if (!pcie_wait_for_link_delay(dev, true, delay)) {
48204810
/* Did not train, no need to wait any further */
48214811
return;
48224812
}
48234813
}
4824-
pci_dbg(child, "waiting %d ms to become accessible\n", delay);
4825-
msleep(delay);
48264814

48274815
if (!pci_device_is_present(child)) {
48284816
pci_dbg(child, "waiting additional %d ms to become accessible\n", delay);

drivers/virtio/virtio_mmio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,11 @@ static int vm_cmdline_set(const char *device,
641641
&vm_cmdline_id, &consumed);
642642

643643
/*
644-
* sscanf() must processes at least 2 chunks; also there
644+
* sscanf() must process at least 2 chunks; also there
645645
* must be no extra characters after the last chunk, so
646646
* str[consumed] must be '\0'
647647
*/
648-
if (processed < 2 || str[consumed])
648+
if (processed < 2 || str[consumed] || irq == 0)
649649
return -EINVAL;
650650

651651
resources[0].flags = IORESOURCE_MEM;

0 commit comments

Comments
 (0)