aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-09-13 01:39:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-09-13 01:39:56 -0400
commit54eda9df17f3215b9ed16629ee71ea07413efdaf (patch)
treec052ee7a40c5e6ffdcc40bdf09da1c394940d9df
parentd3bd5973c72e04f03539858b9149e6b604bfb51d (diff)
parent9d27e39d309c93025ae6aa97236af15bef2a5f1f (diff)
Merge tag 'pci-v4.19-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas: - Add Tyrel Datwyler as maintainer for PPC64 RPA hotplug (Tyrel Datwyler) - Add Gustavo Pimentel as DesignWare PCI maintainer (Joao Pinto) - Fix a Switchtec Spectre v1 vulnerability (Gustavo A. R. Silva) - Revert an unnecessary Intel 300 ACS quirk (Mika Westerberg) - Fix pciehp hot-add/powerfault detection that left indicators in wrong state (Keith Busch) - Fix pci_reset_bus() logic error (Dennis Dalessandro) - Revert IB/hfi1 PCI reset change that caused a deadlock (Dennis Dalessandro) - Allow enabling PASID on Root Complex Integrated Endpoints (Felix Kuehling) * tag 'pci-v4.19-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: Fix enabling of PASID on RC integrated endpoints IB/hfi1,PCI: Allow bus reset while probing PCI: Fix faulty logic in pci_reset_bus() PCI: pciehp: Fix hot-add vs powerfault detection order switchtec: Fix Spectre v1 vulnerability Revert "PCI: Add ACS quirk for Intel 300 series" MAINTAINERS: Add Gustavo Pimentel as DesignWare PCI maintainer MAINTAINERS: Add entries for PPC64 RPA PCI hotplug drivers
-rw-r--r--MAINTAINERS16
-rw-r--r--drivers/infiniband/hw/hfi1/pcie.c11
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c18
-rw-r--r--drivers/pci/pci.c3
-rw-r--r--drivers/pci/probe.c5
-rw-r--r--drivers/pci/quirks.c6
-rw-r--r--drivers/pci/switch/switchtec.c4
-rw-r--r--include/linux/pci.h3
8 files changed, 41 insertions, 25 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index d870cb57c887..4130acc2e152 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7016,6 +7016,20 @@ F: drivers/crypto/vmx/aes*
7016F: drivers/crypto/vmx/ghash* 7016F: drivers/crypto/vmx/ghash*
7017F: drivers/crypto/vmx/ppc-xlate.pl 7017F: drivers/crypto/vmx/ppc-xlate.pl
7018 7018
7019IBM Power PCI Hotplug Driver for RPA-compliant PPC64 platform
7020M: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
7021L: linux-pci@vger.kernel.org
7022L: linuxppc-dev@lists.ozlabs.org
7023S: Supported
7024F: drivers/pci/hotplug/rpaphp*
7025
7026IBM Power IO DLPAR Driver for RPA-compliant PPC64 platform
7027M: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
7028L: linux-pci@vger.kernel.org
7029L: linuxppc-dev@lists.ozlabs.org
7030S: Supported
7031F: drivers/pci/hotplug/rpadlpar*
7032
7019IBM ServeRAID RAID DRIVER 7033IBM ServeRAID RAID DRIVER
7020S: Orphan 7034S: Orphan
7021F: drivers/scsi/ips.* 7035F: drivers/scsi/ips.*
@@ -11154,7 +11168,7 @@ F: drivers/pci/controller/dwc/pci-exynos.c
11154 11168
11155PCI DRIVER FOR SYNOPSYS DESIGNWARE 11169PCI DRIVER FOR SYNOPSYS DESIGNWARE
11156M: Jingoo Han <jingoohan1@gmail.com> 11170M: Jingoo Han <jingoohan1@gmail.com>
11157M: Joao Pinto <Joao.Pinto@synopsys.com> 11171M: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
11158L: linux-pci@vger.kernel.org 11172L: linux-pci@vger.kernel.org
11159S: Maintained 11173S: Maintained
11160F: Documentation/devicetree/bindings/pci/designware-pcie.txt 11174F: Documentation/devicetree/bindings/pci/designware-pcie.txt
diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c
index eec83757d55f..6c967dde58e7 100644
--- a/drivers/infiniband/hw/hfi1/pcie.c
+++ b/drivers/infiniband/hw/hfi1/pcie.c
@@ -893,14 +893,11 @@ static int trigger_sbr(struct hfi1_devdata *dd)
893 } 893 }
894 894
895 /* 895 /*
896 * A secondary bus reset (SBR) issues a hot reset to our device. 896 * This is an end around to do an SBR during probe time. A new API needs
897 * The following routine does a 1s wait after the reset is dropped 897 * to be implemented to have cleaner interface but this fixes the
898 * per PCI Trhfa (recovery time). PCIe 3.0 section 6.6.1 - 898 * current brokenness
899 * Conventional Reset, paragraph 3, line 35 also says that a 1s
900 * delay after a reset is required. Per spec requirements,
901 * the link is either working or not after that point.
902 */ 899 */
903 return pci_reset_bus(dev); 900 return pci_bridge_secondary_bus_reset(dev->bus->self);
904} 901}
905 902
906/* 903/*
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 7136e3430925..a938abdb41ce 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -496,7 +496,7 @@ int pciehp_power_on_slot(struct slot *slot)
496 u16 slot_status; 496 u16 slot_status;
497 int retval; 497 int retval;
498 498
499 /* Clear sticky power-fault bit from previous power failures */ 499 /* Clear power-fault bit from previous power failures */
500 pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); 500 pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status);
501 if (slot_status & PCI_EXP_SLTSTA_PFD) 501 if (slot_status & PCI_EXP_SLTSTA_PFD)
502 pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, 502 pcie_capability_write_word(pdev, PCI_EXP_SLTSTA,
@@ -646,6 +646,14 @@ static irqreturn_t pciehp_ist(int irq, void *dev_id)
646 pciehp_handle_button_press(slot); 646 pciehp_handle_button_press(slot);
647 } 647 }
648 648
649 /* Check Power Fault Detected */
650 if ((events & PCI_EXP_SLTSTA_PFD) && !ctrl->power_fault_detected) {
651 ctrl->power_fault_detected = 1;
652 ctrl_err(ctrl, "Slot(%s): Power fault\n", slot_name(slot));
653 pciehp_set_attention_status(slot, 1);
654 pciehp_green_led_off(slot);
655 }
656
649 /* 657 /*
650 * Disable requests have higher priority than Presence Detect Changed 658 * Disable requests have higher priority than Presence Detect Changed
651 * or Data Link Layer State Changed events. 659 * or Data Link Layer State Changed events.
@@ -657,14 +665,6 @@ static irqreturn_t pciehp_ist(int irq, void *dev_id)
657 pciehp_handle_presence_or_link_change(slot, events); 665 pciehp_handle_presence_or_link_change(slot, events);
658 up_read(&ctrl->reset_lock); 666 up_read(&ctrl->reset_lock);
659 667
660 /* Check Power Fault Detected */
661 if ((events & PCI_EXP_SLTSTA_PFD) && !ctrl->power_fault_detected) {
662 ctrl->power_fault_detected = 1;
663 ctrl_err(ctrl, "Slot(%s): Power fault\n", slot_name(slot));
664 pciehp_set_attention_status(slot, 1);
665 pciehp_green_led_off(slot);
666 }
667
668 pci_config_pm_runtime_put(pdev); 668 pci_config_pm_runtime_put(pdev);
669 wake_up(&ctrl->requester); 669 wake_up(&ctrl->requester);
670 return IRQ_HANDLED; 670 return IRQ_HANDLED;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 29ff9619b5fa..1835f3a7aa8d 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4547,6 +4547,7 @@ int pci_bridge_secondary_bus_reset(struct pci_dev *dev)
4547 4547
4548 return pci_dev_wait(dev, "bus reset", PCIE_RESET_READY_POLL_MS); 4548 return pci_dev_wait(dev, "bus reset", PCIE_RESET_READY_POLL_MS);
4549} 4549}
4550EXPORT_SYMBOL_GPL(pci_bridge_secondary_bus_reset);
4550 4551
4551static int pci_parent_bus_reset(struct pci_dev *dev, int probe) 4552static int pci_parent_bus_reset(struct pci_dev *dev, int probe)
4552{ 4553{
@@ -5200,7 +5201,7 @@ static int __pci_reset_bus(struct pci_bus *bus)
5200 */ 5201 */
5201int pci_reset_bus(struct pci_dev *pdev) 5202int pci_reset_bus(struct pci_dev *pdev)
5202{ 5203{
5203 return pci_probe_reset_slot(pdev->slot) ? 5204 return (!pci_probe_reset_slot(pdev->slot)) ?
5204 __pci_reset_slot(pdev->slot) : __pci_reset_bus(pdev->bus); 5205 __pci_reset_slot(pdev->slot) : __pci_reset_bus(pdev->bus);
5205} 5206}
5206EXPORT_SYMBOL_GPL(pci_reset_bus); 5207EXPORT_SYMBOL_GPL(pci_reset_bus);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index ec784009a36b..201f9e5ff55c 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2074,6 +2074,7 @@ static void pci_configure_eetlp_prefix(struct pci_dev *dev)
2074{ 2074{
2075#ifdef CONFIG_PCI_PASID 2075#ifdef CONFIG_PCI_PASID
2076 struct pci_dev *bridge; 2076 struct pci_dev *bridge;
2077 int pcie_type;
2077 u32 cap; 2078 u32 cap;
2078 2079
2079 if (!pci_is_pcie(dev)) 2080 if (!pci_is_pcie(dev))
@@ -2083,7 +2084,9 @@ static void pci_configure_eetlp_prefix(struct pci_dev *dev)
2083 if (!(cap & PCI_EXP_DEVCAP2_EE_PREFIX)) 2084 if (!(cap & PCI_EXP_DEVCAP2_EE_PREFIX))
2084 return; 2085 return;
2085 2086
2086 if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) 2087 pcie_type = pci_pcie_type(dev);
2088 if (pcie_type == PCI_EXP_TYPE_ROOT_PORT ||
2089 pcie_type == PCI_EXP_TYPE_RC_END)
2087 dev->eetlp_prefix_path = 1; 2090 dev->eetlp_prefix_path = 1;
2088 else { 2091 else {
2089 bridge = pci_upstream_bridge(dev); 2092 bridge = pci_upstream_bridge(dev);
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index ef7143a274e0..6bc27b7fd452 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4355,11 +4355,6 @@ static int pci_quirk_qcom_rp_acs(struct pci_dev *dev, u16 acs_flags)
4355 * 4355 *
4356 * 0x9d10-0x9d1b PCI Express Root port #{1-12} 4356 * 0x9d10-0x9d1b PCI Express Root port #{1-12}
4357 * 4357 *
4358 * The 300 series chipset suffers from the same bug so include those root
4359 * ports here as well.
4360 *
4361 * 0xa32c-0xa343 PCI Express Root port #{0-24}
4362 *
4363 * [1] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-2.html 4358 * [1] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-2.html
4364 * [2] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-1.html 4359 * [2] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-1.html
4365 * [3] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-spec-update.html 4360 * [3] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-spec-update.html
@@ -4377,7 +4372,6 @@ static bool pci_quirk_intel_spt_pch_acs_match(struct pci_dev *dev)
4377 case 0xa110 ... 0xa11f: case 0xa167 ... 0xa16a: /* Sunrise Point */ 4372 case 0xa110 ... 0xa11f: case 0xa167 ... 0xa16a: /* Sunrise Point */
4378 case 0xa290 ... 0xa29f: case 0xa2e7 ... 0xa2ee: /* Union Point */ 4373 case 0xa290 ... 0xa29f: case 0xa2e7 ... 0xa2ee: /* Union Point */
4379 case 0x9d10 ... 0x9d1b: /* 7th & 8th Gen Mobile */ 4374 case 0x9d10 ... 0x9d1b: /* 7th & 8th Gen Mobile */
4380 case 0xa32c ... 0xa343: /* 300 series */
4381 return true; 4375 return true;
4382 } 4376 }
4383 4377
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 9940cc70f38b..54a8b30dda38 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -14,6 +14,8 @@
14#include <linux/poll.h> 14#include <linux/poll.h>
15#include <linux/wait.h> 15#include <linux/wait.h>
16 16
17#include <linux/nospec.h>
18
17MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver"); 19MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver");
18MODULE_VERSION("0.1"); 20MODULE_VERSION("0.1");
19MODULE_LICENSE("GPL"); 21MODULE_LICENSE("GPL");
@@ -909,6 +911,8 @@ static int ioctl_port_to_pff(struct switchtec_dev *stdev,
909 default: 911 default:
910 if (p.port > ARRAY_SIZE(pcfg->dsp_pff_inst_id)) 912 if (p.port > ARRAY_SIZE(pcfg->dsp_pff_inst_id))
911 return -EINVAL; 913 return -EINVAL;
914 p.port = array_index_nospec(p.port,
915 ARRAY_SIZE(pcfg->dsp_pff_inst_id) + 1);
912 p.pff = ioread32(&pcfg->dsp_pff_inst_id[p.port - 1]); 916 p.pff = ioread32(&pcfg->dsp_pff_inst_id[p.port - 1]);
913 break; 917 break;
914 } 918 }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index e72ca8dd6241..6925828f9f25 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1235,6 +1235,9 @@ void pci_bus_remove_resources(struct pci_bus *bus);
1235int devm_request_pci_bus_resources(struct device *dev, 1235int devm_request_pci_bus_resources(struct device *dev,
1236 struct list_head *resources); 1236 struct list_head *resources);
1237 1237
1238/* Temporary until new and working PCI SBR API in place */
1239int pci_bridge_secondary_bus_reset(struct pci_dev *dev);
1240
1238#define pci_bus_for_each_resource(bus, res, i) \ 1241#define pci_bus_for_each_resource(bus, res, i) \
1239 for (i = 0; \ 1242 for (i = 0; \
1240 (res = pci_bus_resource_n(bus, i)) || i < PCI_BRIDGE_RESOURCE_NUM; \ 1243 (res = pci_bus_resource_n(bus, i)) || i < PCI_BRIDGE_RESOURCE_NUM; \