aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-01-18 14:26:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-01-18 14:26:16 -0500
commitd28f3e721974378c404f16d17638d9ae5c0db0d2 (patch)
treeca1ed85063af43f2ca97660d90156d78b0e0b827
parent8b4fe58db67947b0c7195405ecb041a991580693 (diff)
parentd2fd6e81912a665993b24dcdc1c1384a42a54f7e (diff)
Merge tag 'pci-v5.0-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas:: - Fix PCI kconfig menu organization (Rob Herring) - Fix pci_alloc_irq_vectors_affinity() error return to allow "reduce and retry" for drivers using IRQ sets (Ming Lei) - Fix "pci=disable_acs_redir" initdata use-after-free problem (Logan Gunthorpe) * tag 'pci-v5.0-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: Fix __initdata issue with "pci=disable_acs_redir" parameter PCI/MSI: Return -ENOSPC from pci_alloc_irq_vectors_affinity() PCI: Fix PCI kconfig menu organization
-rw-r--r--drivers/pci/Kconfig22
-rw-r--r--drivers/pci/msi.c22
-rw-r--r--drivers/pci/pci.c3
3 files changed, 23 insertions, 24 deletions
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 4310c7a4212e..2ab92409210a 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -21,13 +21,14 @@ menuconfig PCI
21 support for PCI-X and the foundations for PCI Express support. 21 support for PCI-X and the foundations for PCI Express support.
22 Say 'Y' here unless you know what you are doing. 22 Say 'Y' here unless you know what you are doing.
23 23
24if PCI
25
24config PCI_DOMAINS 26config PCI_DOMAINS
25 bool 27 bool
26 depends on PCI 28 depends on PCI
27 29
28config PCI_DOMAINS_GENERIC 30config PCI_DOMAINS_GENERIC
29 bool 31 bool
30 depends on PCI
31 select PCI_DOMAINS 32 select PCI_DOMAINS
32 33
33config PCI_SYSCALL 34config PCI_SYSCALL
@@ -37,7 +38,6 @@ source "drivers/pci/pcie/Kconfig"
37 38
38config PCI_MSI 39config PCI_MSI
39 bool "Message Signaled Interrupts (MSI and MSI-X)" 40 bool "Message Signaled Interrupts (MSI and MSI-X)"
40 depends on PCI
41 select GENERIC_MSI_IRQ 41 select GENERIC_MSI_IRQ
42 help 42 help
43 This allows device drivers to enable MSI (Message Signaled 43 This allows device drivers to enable MSI (Message Signaled
@@ -59,7 +59,6 @@ config PCI_MSI_IRQ_DOMAIN
59config PCI_QUIRKS 59config PCI_QUIRKS
60 default y 60 default y
61 bool "Enable PCI quirk workarounds" if EXPERT 61 bool "Enable PCI quirk workarounds" if EXPERT
62 depends on PCI
63 help 62 help
64 This enables workarounds for various PCI chipset bugs/quirks. 63 This enables workarounds for various PCI chipset bugs/quirks.
65 Disable this only if your target machine is unaffected by PCI 64 Disable this only if your target machine is unaffected by PCI
@@ -67,7 +66,7 @@ config PCI_QUIRKS
67 66
68config PCI_DEBUG 67config PCI_DEBUG
69 bool "PCI Debugging" 68 bool "PCI Debugging"
70 depends on PCI && DEBUG_KERNEL 69 depends on DEBUG_KERNEL
71 help 70 help
72 Say Y here if you want the PCI core to produce a bunch of debug 71 Say Y here if you want the PCI core to produce a bunch of debug
73 messages to the system log. Select this if you are having a 72 messages to the system log. Select this if you are having a
@@ -77,7 +76,6 @@ config PCI_DEBUG
77 76
78config PCI_REALLOC_ENABLE_AUTO 77config PCI_REALLOC_ENABLE_AUTO
79 bool "Enable PCI resource re-allocation detection" 78 bool "Enable PCI resource re-allocation detection"
80 depends on PCI
81 depends on PCI_IOV 79 depends on PCI_IOV
82 help 80 help
83 Say Y here if you want the PCI core to detect if PCI resource 81 Say Y here if you want the PCI core to detect if PCI resource
@@ -90,7 +88,6 @@ config PCI_REALLOC_ENABLE_AUTO
90 88
91config PCI_STUB 89config PCI_STUB
92 tristate "PCI Stub driver" 90 tristate "PCI Stub driver"
93 depends on PCI
94 help 91 help
95 Say Y or M here if you want be able to reserve a PCI device 92 Say Y or M here if you want be able to reserve a PCI device
96 when it is going to be assigned to a guest operating system. 93 when it is going to be assigned to a guest operating system.
@@ -99,7 +96,6 @@ config PCI_STUB
99 96
100config PCI_PF_STUB 97config PCI_PF_STUB
101 tristate "PCI PF Stub driver" 98 tristate "PCI PF Stub driver"
102 depends on PCI
103 depends on PCI_IOV 99 depends on PCI_IOV
104 help 100 help
105 Say Y or M here if you want to enable support for devices that 101 Say Y or M here if you want to enable support for devices that
@@ -111,7 +107,7 @@ config PCI_PF_STUB
111 107
112config XEN_PCIDEV_FRONTEND 108config XEN_PCIDEV_FRONTEND
113 tristate "Xen PCI Frontend" 109 tristate "Xen PCI Frontend"
114 depends on PCI && X86 && XEN 110 depends on X86 && XEN
115 select PCI_XEN 111 select PCI_XEN
116 select XEN_XENBUS_FRONTEND 112 select XEN_XENBUS_FRONTEND
117 default y 113 default y
@@ -133,7 +129,6 @@ config PCI_BRIDGE_EMUL
133 129
134config PCI_IOV 130config PCI_IOV
135 bool "PCI IOV support" 131 bool "PCI IOV support"
136 depends on PCI
137 select PCI_ATS 132 select PCI_ATS
138 help 133 help
139 I/O Virtualization is a PCI feature supported by some devices 134 I/O Virtualization is a PCI feature supported by some devices
@@ -144,7 +139,6 @@ config PCI_IOV
144 139
145config PCI_PRI 140config PCI_PRI
146 bool "PCI PRI support" 141 bool "PCI PRI support"
147 depends on PCI
148 select PCI_ATS 142 select PCI_ATS
149 help 143 help
150 PRI is the PCI Page Request Interface. It allows PCI devices that are 144 PRI is the PCI Page Request Interface. It allows PCI devices that are
@@ -154,7 +148,6 @@ config PCI_PRI
154 148
155config PCI_PASID 149config PCI_PASID
156 bool "PCI PASID support" 150 bool "PCI PASID support"
157 depends on PCI
158 select PCI_ATS 151 select PCI_ATS
159 help 152 help
160 Process Address Space Identifiers (PASIDs) can be used by PCI devices 153 Process Address Space Identifiers (PASIDs) can be used by PCI devices
@@ -167,7 +160,7 @@ config PCI_PASID
167 160
168config PCI_P2PDMA 161config PCI_P2PDMA
169 bool "PCI peer-to-peer transfer support" 162 bool "PCI peer-to-peer transfer support"
170 depends on PCI && ZONE_DEVICE 163 depends on ZONE_DEVICE
171 select GENERIC_ALLOCATOR 164 select GENERIC_ALLOCATOR
172 help 165 help
173 Enableѕ drivers to do PCI peer-to-peer transactions to and from 166 Enableѕ drivers to do PCI peer-to-peer transactions to and from
@@ -184,12 +177,11 @@ config PCI_P2PDMA
184 177
185config PCI_LABEL 178config PCI_LABEL
186 def_bool y if (DMI || ACPI) 179 def_bool y if (DMI || ACPI)
187 depends on PCI
188 select NLS 180 select NLS
189 181
190config PCI_HYPERV 182config PCI_HYPERV
191 tristate "Hyper-V PCI Frontend" 183 tristate "Hyper-V PCI Frontend"
192 depends on PCI && X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && X86_64 184 depends on X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && X86_64
193 help 185 help
194 The PCI device frontend driver allows the kernel to import arbitrary 186 The PCI device frontend driver allows the kernel to import arbitrary
195 PCI devices from a PCI backend to support PCI driver domains. 187 PCI devices from a PCI backend to support PCI driver domains.
@@ -198,3 +190,5 @@ source "drivers/pci/hotplug/Kconfig"
198source "drivers/pci/controller/Kconfig" 190source "drivers/pci/controller/Kconfig"
199source "drivers/pci/endpoint/Kconfig" 191source "drivers/pci/endpoint/Kconfig"
200source "drivers/pci/switch/Kconfig" 192source "drivers/pci/switch/Kconfig"
193
194endif
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 7a1c8a09efa5..4c0b47867258 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -1168,7 +1168,8 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
1168 const struct irq_affinity *affd) 1168 const struct irq_affinity *affd)
1169{ 1169{
1170 static const struct irq_affinity msi_default_affd; 1170 static const struct irq_affinity msi_default_affd;
1171 int vecs = -ENOSPC; 1171 int msix_vecs = -ENOSPC;
1172 int msi_vecs = -ENOSPC;
1172 1173
1173 if (flags & PCI_IRQ_AFFINITY) { 1174 if (flags & PCI_IRQ_AFFINITY) {
1174 if (!affd) 1175 if (!affd)
@@ -1179,16 +1180,17 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
1179 } 1180 }
1180 1181
1181 if (flags & PCI_IRQ_MSIX) { 1182 if (flags & PCI_IRQ_MSIX) {
1182 vecs = __pci_enable_msix_range(dev, NULL, min_vecs, max_vecs, 1183 msix_vecs = __pci_enable_msix_range(dev, NULL, min_vecs,
1183 affd); 1184 max_vecs, affd);
1184 if (vecs > 0) 1185 if (msix_vecs > 0)
1185 return vecs; 1186 return msix_vecs;
1186 } 1187 }
1187 1188
1188 if (flags & PCI_IRQ_MSI) { 1189 if (flags & PCI_IRQ_MSI) {
1189 vecs = __pci_enable_msi_range(dev, min_vecs, max_vecs, affd); 1190 msi_vecs = __pci_enable_msi_range(dev, min_vecs, max_vecs,
1190 if (vecs > 0) 1191 affd);
1191 return vecs; 1192 if (msi_vecs > 0)
1193 return msi_vecs;
1192 } 1194 }
1193 1195
1194 /* use legacy irq if allowed */ 1196 /* use legacy irq if allowed */
@@ -1199,7 +1201,9 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
1199 } 1201 }
1200 } 1202 }
1201 1203
1202 return vecs; 1204 if (msix_vecs == -ENOSPC)
1205 return -ENOSPC;
1206 return msi_vecs;
1203} 1207}
1204EXPORT_SYMBOL(pci_alloc_irq_vectors_affinity); 1208EXPORT_SYMBOL(pci_alloc_irq_vectors_affinity);
1205 1209
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index c9d8e3c837de..c25acace7d91 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -6195,7 +6195,8 @@ static int __init pci_setup(char *str)
6195 } else if (!strncmp(str, "pcie_scan_all", 13)) { 6195 } else if (!strncmp(str, "pcie_scan_all", 13)) {
6196 pci_add_flags(PCI_SCAN_ALL_PCIE_DEVS); 6196 pci_add_flags(PCI_SCAN_ALL_PCIE_DEVS);
6197 } else if (!strncmp(str, "disable_acs_redir=", 18)) { 6197 } else if (!strncmp(str, "disable_acs_redir=", 18)) {
6198 disable_acs_redir_param = str + 18; 6198 disable_acs_redir_param =
6199 kstrdup(str + 18, GFP_KERNEL);
6199 } else { 6200 } else {
6200 printk(KERN_ERR "PCI: Unknown option `%s'\n", 6201 printk(KERN_ERR "PCI: Unknown option `%s'\n",
6201 str); 6202 str);