aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-16 12:21:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-16 12:21:54 -0400
commit4e31843f681c34f7185e7d169fe627c9d891ce2c (patch)
tree7717ffdea5621cb68edb746bb21f6acd32f49aa9 /tools
parentf91e654474d413201ae578820fb63f8a811f6c4e (diff)
parentfa687fb9ced47b97bd22297366e788dac1927dd7 (diff)
Merge tag 'pci-v4.19-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull pci updates from Bjorn Helgaas: - Decode AER errors with names similar to "lspci" (Tyler Baicar) - Expose AER statistics in sysfs (Rajat Jain) - Clear AER status bits selectively based on the type of recovery (Oza Pawandeep) - Honor "pcie_ports=native" even if HEST sets FIRMWARE_FIRST (Alexandru Gagniuc) - Don't clear AER status bits if we're using the "Firmware-First" strategy where firmware owns the registers (Alexandru Gagniuc) - Use sysfs_match_string() to simplify ASPM sysfs parsing (Andy Shevchenko) - Remove unnecessary includes of <linux/pci-aspm.h> (Bjorn Helgaas) - Defer DPC event handling to work queue (Keith Busch) - Use threaded IRQ for DPC bottom half (Keith Busch) - Print AER status while handling DPC events (Keith Busch) - Work around IDT switch ACS Source Validation erratum (James Puthukattukaran) - Emit diagnostics for all cases of PCIe Link downtraining (Links operating slower than they're capable of) (Alexandru Gagniuc) - Skip VFs when configuring Max Payload Size (Myron Stowe) - Reduce Root Port Max Payload Size if necessary when hot-adding a device below it (Myron Stowe) - Simplify SHPC existence/permission checks (Bjorn Helgaas) - Remove hotplug sample skeleton driver (Lukas Wunner) - Convert pciehp to threaded IRQ handling (Lukas Wunner) - Improve pciehp tolerance of missed events and initially unstable links (Lukas Wunner) - Clear spurious pciehp events on resume (Lukas Wunner) - Add pciehp runtime PM support, including for Thunderbolt controllers (Lukas Wunner) - Support interrupts from pciehp bridges in D3hot (Lukas Wunner) - Mark fall-through switch cases before enabling -Wimplicit-fallthrough (Gustavo A. R. Silva) - Move DMA-debug PCI init from arch code to PCI core (Christoph Hellwig) - Fix pci_request_irq() usage of IRQF_ONESHOT when no handler is supplied (Heiner Kallweit) - Unify PCI and DMA direction #defines (Shunyong Yang) - Add PCI_DEVICE_DATA() macro (Andy Shevchenko) - Check for VPD completion before checking for timeout (Bert Kenward) - Limit Netronome NFP5000 config space size to work around erratum (Jakub Kicinski) - Set IRQCHIP_ONESHOT_SAFE for PCI MSI irqchips (Heiner Kallweit) - Document ACPI description of PCI host bridges (Bjorn Helgaas) - Add "pci=disable_acs_redir=" parameter to disable ACS redirection for peer-to-peer DMA support (we don't have the peer-to-peer support yet; this is just one piece) (Logan Gunthorpe) - Clean up devm_of_pci_get_host_bridge_resources() resource allocation (Jan Kiszka) - Fixup resizable BARs after suspend/resume (Christian König) - Make "pci=earlydump" generic (Sinan Kaya) - Fix ROM BAR access routines to stay in bounds and check for signature correctly (Rex Zhu) - Add DMA alias quirk for Microsemi Switchtec NTB (Doug Meyer) - Expand documentation for pci_add_dma_alias() (Logan Gunthorpe) - To avoid bus errors, enable PASID only if entire path supports End-End TLP prefixes (Sinan Kaya) - Unify slot and bus reset functions and remove hotplug knowledge from callers (Sinan Kaya) - Add Function-Level Reset quirks for Intel and Samsung NVMe devices to fix guest reboot issues (Alex Williamson) - Add function 1 DMA alias quirk for Marvell 88SS9183 PCIe SSD Controller (Bjorn Helgaas) - Remove Xilinx AXI-PCIe host bridge arch dependency (Palmer Dabbelt) - Remove Aardvark outbound window configuration (Evan Wang) - Fix Aardvark bridge window sizing issue (Zachary Zhang) - Convert Aardvark to use pci_host_probe() to reduce code duplication (Thomas Petazzoni) - Correct the Cadence cdns_pcie_writel() signature (Alan Douglas) - Add Cadence support for optional generic PHYs (Alan Douglas) - Add Cadence power management ops (Alan Douglas) - Remove redundant variable from Cadence driver (Colin Ian King) - Add Kirin MSI support (Xiaowei Song) - Drop unnecessary root_bus_nr setting from exynos, imx6, keystone, armada8k, artpec6, designware-plat, histb, qcom, spear13xx (Shawn Guo) - Move link notification settings from DesignWare core to individual drivers (Gustavo Pimentel) - Add endpoint library MSI-X interfaces (Gustavo Pimentel) - Correct signature of endpoint library IRQ interfaces (Gustavo Pimentel) - Add DesignWare endpoint library MSI-X callbacks (Gustavo Pimentel) - Add endpoint library MSI-X test support (Gustavo Pimentel) - Remove unnecessary GFP_ATOMIC from Hyper-V "new child" allocation (Jia-Ju Bai) - Add more devices to Broadcom PAXC quirk (Ray Jui) - Work around corrupted Broadcom PAXC config space to enable SMMU and GICv3 ITS (Ray Jui) - Disable MSI parsing to work around broken Broadcom PAXC logic in some devices (Ray Jui) - Hide unconfigured functions to work around a Broadcom PAXC defect (Ray Jui) - Lower iproc log level to reduce console output during boot (Ray Jui) - Fix mobiveil iomem/phys_addr_t type usage (Lorenzo Pieralisi) - Fix mobiveil missing include file (Lorenzo Pieralisi) - Add mobiveil Kconfig/Makefile support (Lorenzo Pieralisi) - Fix mvebu I/O space remapping issues (Thomas Petazzoni) - Use generic pci_host_bridge in mvebu instead of ARM-specific API (Thomas Petazzoni) - Whitelist VMD devices with fast interrupt handlers to avoid sharing vectors with slow handlers (Keith Busch) * tag 'pci-v4.19-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (153 commits) PCI/AER: Don't clear AER bits if error handling is Firmware-First PCI: Limit config space size for Netronome NFP5000 PCI/MSI: Set IRQCHIP_ONESHOT_SAFE for PCI-MSI irqchips PCI/VPD: Check for VPD access completion before checking for timeout PCI: Add PCI_DEVICE_DATA() macro to fully describe device ID entry PCI: Match Root Port's MPS to endpoint's MPSS as necessary PCI: Skip MPS logic for Virtual Functions (VFs) PCI: Add function 1 DMA alias quirk for Marvell 88SS9183 PCI: Check for PCIe Link downtraining PCI: Add ACS Redirect disable quirk for Intel Sunrise Point PCI: Add device-specific ACS Redirect disable infrastructure PCI: Convert device-specific ACS quirks from NULL termination to ARRAY_SIZE PCI: Add "pci=disable_acs_redir=" parameter for peer-to-peer support PCI: Allow specifying devices using a base bus and path of devfns PCI: Make specifying PCI devices in kernel parameters reusable PCI: Hide ACS quirk declarations inside PCI core PCI: Delay after FLR of Intel DC P3700 NVMe PCI: Disable Samsung SM961/PM961 NVMe before FLR PCI: Export pcie_has_flr() PCI: mvebu: Drop bogus comment above mvebu_pcie_map_registers() ...
Diffstat (limited to 'tools')
-rw-r--r--tools/pci/pcitest.c51
-rw-r--r--tools/pci/pcitest.sh15
2 files changed, 65 insertions, 1 deletions
diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c
index 9074b477bff0..af146bb03b4d 100644
--- a/tools/pci/pcitest.c
+++ b/tools/pci/pcitest.c
@@ -31,12 +31,17 @@
31#define BILLION 1E9 31#define BILLION 1E9
32 32
33static char *result[] = { "NOT OKAY", "OKAY" }; 33static char *result[] = { "NOT OKAY", "OKAY" };
34static char *irq[] = { "LEGACY", "MSI", "MSI-X" };
34 35
35struct pci_test { 36struct pci_test {
36 char *device; 37 char *device;
37 char barnum; 38 char barnum;
38 bool legacyirq; 39 bool legacyirq;
39 unsigned int msinum; 40 unsigned int msinum;
41 unsigned int msixnum;
42 int irqtype;
43 bool set_irqtype;
44 bool get_irqtype;
40 bool read; 45 bool read;
41 bool write; 46 bool write;
42 bool copy; 47 bool copy;
@@ -65,6 +70,24 @@ static int run_test(struct pci_test *test)
65 fprintf(stdout, "%s\n", result[ret]); 70 fprintf(stdout, "%s\n", result[ret]);
66 } 71 }
67 72
73 if (test->set_irqtype) {
74 ret = ioctl(fd, PCITEST_SET_IRQTYPE, test->irqtype);
75 fprintf(stdout, "SET IRQ TYPE TO %s:\t\t", irq[test->irqtype]);
76 if (ret < 0)
77 fprintf(stdout, "FAILED\n");
78 else
79 fprintf(stdout, "%s\n", result[ret]);
80 }
81
82 if (test->get_irqtype) {
83 ret = ioctl(fd, PCITEST_GET_IRQTYPE);
84 fprintf(stdout, "GET IRQ TYPE:\t\t");
85 if (ret < 0)
86 fprintf(stdout, "FAILED\n");
87 else
88 fprintf(stdout, "%s\n", irq[ret]);
89 }
90
68 if (test->legacyirq) { 91 if (test->legacyirq) {
69 ret = ioctl(fd, PCITEST_LEGACY_IRQ, 0); 92 ret = ioctl(fd, PCITEST_LEGACY_IRQ, 0);
70 fprintf(stdout, "LEGACY IRQ:\t"); 93 fprintf(stdout, "LEGACY IRQ:\t");
@@ -83,6 +106,15 @@ static int run_test(struct pci_test *test)
83 fprintf(stdout, "%s\n", result[ret]); 106 fprintf(stdout, "%s\n", result[ret]);
84 } 107 }
85 108
109 if (test->msixnum > 0 && test->msixnum <= 2048) {
110 ret = ioctl(fd, PCITEST_MSIX, test->msixnum);
111 fprintf(stdout, "MSI-X%d:\t\t", test->msixnum);
112 if (ret < 0)
113 fprintf(stdout, "TEST FAILED\n");
114 else
115 fprintf(stdout, "%s\n", result[ret]);
116 }
117
86 if (test->write) { 118 if (test->write) {
87 ret = ioctl(fd, PCITEST_WRITE, test->size); 119 ret = ioctl(fd, PCITEST_WRITE, test->size);
88 fprintf(stdout, "WRITE (%7ld bytes):\t\t", test->size); 120 fprintf(stdout, "WRITE (%7ld bytes):\t\t", test->size);
@@ -133,7 +165,7 @@ int main(int argc, char **argv)
133 /* set default endpoint device */ 165 /* set default endpoint device */
134 test->device = "/dev/pci-endpoint-test.0"; 166 test->device = "/dev/pci-endpoint-test.0";
135 167
136 while ((c = getopt(argc, argv, "D:b:m:lrwcs:")) != EOF) 168 while ((c = getopt(argc, argv, "D:b:m:x:i:Ilrwcs:")) != EOF)
137 switch (c) { 169 switch (c) {
138 case 'D': 170 case 'D':
139 test->device = optarg; 171 test->device = optarg;
@@ -151,6 +183,20 @@ int main(int argc, char **argv)
151 if (test->msinum < 1 || test->msinum > 32) 183 if (test->msinum < 1 || test->msinum > 32)
152 goto usage; 184 goto usage;
153 continue; 185 continue;
186 case 'x':
187 test->msixnum = atoi(optarg);
188 if (test->msixnum < 1 || test->msixnum > 2048)
189 goto usage;
190 continue;
191 case 'i':
192 test->irqtype = atoi(optarg);
193 if (test->irqtype < 0 || test->irqtype > 2)
194 goto usage;
195 test->set_irqtype = true;
196 continue;
197 case 'I':
198 test->get_irqtype = true;
199 continue;
154 case 'r': 200 case 'r':
155 test->read = true; 201 test->read = true;
156 continue; 202 continue;
@@ -173,6 +219,9 @@ usage:
173 "\t-D <dev> PCI endpoint test device {default: /dev/pci-endpoint-test.0}\n" 219 "\t-D <dev> PCI endpoint test device {default: /dev/pci-endpoint-test.0}\n"
174 "\t-b <bar num> BAR test (bar number between 0..5)\n" 220 "\t-b <bar num> BAR test (bar number between 0..5)\n"
175 "\t-m <msi num> MSI test (msi number between 1..32)\n" 221 "\t-m <msi num> MSI test (msi number between 1..32)\n"
222 "\t-x <msix num> \tMSI-X test (msix number between 1..2048)\n"
223 "\t-i <irq type> \tSet IRQ type (0 - Legacy, 1 - MSI, 2 - MSI-X)\n"
224 "\t-I Get current IRQ type configured\n"
176 "\t-l Legacy IRQ test\n" 225 "\t-l Legacy IRQ test\n"
177 "\t-r Read buffer test\n" 226 "\t-r Read buffer test\n"
178 "\t-w Write buffer test\n" 227 "\t-w Write buffer test\n"
diff --git a/tools/pci/pcitest.sh b/tools/pci/pcitest.sh
index 77e8c85ef744..75ed48ff2990 100644
--- a/tools/pci/pcitest.sh
+++ b/tools/pci/pcitest.sh
@@ -16,7 +16,10 @@ echo
16echo "Interrupt tests" 16echo "Interrupt tests"
17echo 17echo
18 18
19pcitest -i 0
19pcitest -l 20pcitest -l
21
22pcitest -i 1
20msi=1 23msi=1
21 24
22while [ $msi -lt 33 ] 25while [ $msi -lt 33 ]
@@ -26,9 +29,21 @@ do
26done 29done
27echo 30echo
28 31
32pcitest -i 2
33msix=1
34
35while [ $msix -lt 2049 ]
36do
37 pcitest -x $msix
38 msix=`expr $msix + 1`
39done
40echo
41
29echo "Read Tests" 42echo "Read Tests"
30echo 43echo
31 44
45pcitest -i 1
46
32pcitest -r -s 1 47pcitest -r -s 1
33pcitest -r -s 1024 48pcitest -r -s 1024
34pcitest -r -s 1025 49pcitest -r -s 1025