diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-09-24 12:46:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-09-24 12:46:29 -0400 |
commit | 2d7ed01e5bda639bdbca5507e06c34f46348b681 (patch) | |
tree | ef207eec5dd2d8ff4046948b51b16ba9a256672e | |
parent | 2368a9426fe8320e3d23b0584d861ebeb2aa80f2 (diff) | |
parent | 7cbeb9f90db8e56856db7568520b735732d34d86 (diff) |
Merge tag 'pci-v3.17-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas:
"Here are a few fixes that should be in v3.17.
- Reverting "Don't scan random busses" covers up a CardBus regression
having to do with allocating CardBus bus numbers.
- Reverting "Make sure bus numbers stay within parents bounds" covers
up an ACPI _CRS bug that makes us reconfigure a bridge, causing a
broken device behind it to stop responding.
- The pciehp timeout change fixes some code we added in v3.17.
Without the fix, we can send a new hotplug command too early,
before the timeout has expired.
I hope for better fixes for the reverts, but those will have to come
after v3.17"
* tag 'pci-v3.17-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI: pciehp: Fix pcie_wait_cmd() timeout
Revert "PCI: Make sure bus number resources stay within their parents bounds"
Revert "PCI: Don't scan random busses in pci_scan_bridge()"
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 2 | ||||
-rw-r--r-- | drivers/pci/probe.c | 20 |
2 files changed, 6 insertions, 16 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 5e01ae39ec46..2a412fa3b338 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -160,7 +160,7 @@ static void pcie_wait_cmd(struct controller *ctrl) | |||
160 | ctrl->slot_ctrl & PCI_EXP_SLTCTL_CCIE) | 160 | ctrl->slot_ctrl & PCI_EXP_SLTCTL_CCIE) |
161 | rc = wait_event_timeout(ctrl->queue, !ctrl->cmd_busy, timeout); | 161 | rc = wait_event_timeout(ctrl->queue, !ctrl->cmd_busy, timeout); |
162 | else | 162 | else |
163 | rc = pcie_poll_cmd(ctrl, timeout); | 163 | rc = pcie_poll_cmd(ctrl, jiffies_to_msecs(timeout)); |
164 | 164 | ||
165 | /* | 165 | /* |
166 | * Controllers with errata like Intel CF118 don't generate | 166 | * Controllers with errata like Intel CF118 don't generate |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index e3cf8a2e6292..4170113cde61 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -775,7 +775,7 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) | |||
775 | /* Check if setup is sensible at all */ | 775 | /* Check if setup is sensible at all */ |
776 | if (!pass && | 776 | if (!pass && |
777 | (primary != bus->number || secondary <= bus->number || | 777 | (primary != bus->number || secondary <= bus->number || |
778 | secondary > subordinate || subordinate > bus->busn_res.end)) { | 778 | secondary > subordinate)) { |
779 | dev_info(&dev->dev, "bridge configuration invalid ([bus %02x-%02x]), reconfiguring\n", | 779 | dev_info(&dev->dev, "bridge configuration invalid ([bus %02x-%02x]), reconfiguring\n", |
780 | secondary, subordinate); | 780 | secondary, subordinate); |
781 | broken = 1; | 781 | broken = 1; |
@@ -838,23 +838,18 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) | |||
838 | goto out; | 838 | goto out; |
839 | } | 839 | } |
840 | 840 | ||
841 | if (max >= bus->busn_res.end) { | ||
842 | dev_warn(&dev->dev, "can't allocate child bus %02x from %pR\n", | ||
843 | max, &bus->busn_res); | ||
844 | goto out; | ||
845 | } | ||
846 | |||
847 | /* Clear errors */ | 841 | /* Clear errors */ |
848 | pci_write_config_word(dev, PCI_STATUS, 0xffff); | 842 | pci_write_config_word(dev, PCI_STATUS, 0xffff); |
849 | 843 | ||
850 | /* The bus will already exist if we are rescanning */ | 844 | /* Prevent assigning a bus number that already exists. |
845 | * This can happen when a bridge is hot-plugged, so in | ||
846 | * this case we only re-scan this bus. */ | ||
851 | child = pci_find_bus(pci_domain_nr(bus), max+1); | 847 | child = pci_find_bus(pci_domain_nr(bus), max+1); |
852 | if (!child) { | 848 | if (!child) { |
853 | child = pci_add_new_bus(bus, dev, max+1); | 849 | child = pci_add_new_bus(bus, dev, max+1); |
854 | if (!child) | 850 | if (!child) |
855 | goto out; | 851 | goto out; |
856 | pci_bus_insert_busn_res(child, max+1, | 852 | pci_bus_insert_busn_res(child, max+1, 0xff); |
857 | bus->busn_res.end); | ||
858 | } | 853 | } |
859 | max++; | 854 | max++; |
860 | buses = (buses & 0xff000000) | 855 | buses = (buses & 0xff000000) |
@@ -913,11 +908,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) | |||
913 | /* | 908 | /* |
914 | * Set the subordinate bus number to its real value. | 909 | * Set the subordinate bus number to its real value. |
915 | */ | 910 | */ |
916 | if (max > bus->busn_res.end) { | ||
917 | dev_warn(&dev->dev, "max busn %02x is outside %pR\n", | ||
918 | max, &bus->busn_res); | ||
919 | max = bus->busn_res.end; | ||
920 | } | ||
921 | pci_bus_update_busn_res_end(child, max); | 911 | pci_bus_update_busn_res_end(child, max); |
922 | pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max); | 912 | pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max); |
923 | } | 913 | } |