aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 14:08:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 14:08:21 -0500
commit1c8106528aa6bf16b3f457de80df1cf7462a49a4 (patch)
tree4aed009c4a36195fd14c9f8d70fe2723a49583da /drivers/pci
parent1a464cbb3d483f2f195b614cffa4aa1b910a0440 (diff)
parentf93ea733878733f3e98475bc3e2ccf789bebcfb8 (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (53 commits) iommu/amd: Set IOTLB invalidation timeout iommu/amd: Init stats for iommu=pt iommu/amd: Remove unnecessary cache flushes in amd_iommu_resume iommu/amd: Add invalidate-context call-back iommu/amd: Add amd_iommu_device_info() function iommu/amd: Adapt IOMMU driver to PCI register name changes iommu/amd: Add invalid_ppr callback iommu/amd: Implement notifiers for IOMMUv2 iommu/amd: Implement IO page-fault handler iommu/amd: Add routines to bind/unbind a pasid iommu/amd: Implement device aquisition code for IOMMUv2 iommu/amd: Add driver stub for AMD IOMMUv2 support iommu/amd: Add stat counter for IOMMUv2 events iommu/amd: Add device errata handling iommu/amd: Add function to get IOMMUv2 domain for pdev iommu/amd: Implement function to send PPR completions iommu/amd: Implement functions to manage GCR3 table iommu/amd: Implement IOMMUv2 TLB flushing routines iommu/amd: Add support for IOMMUv2 domain mode iommu/amd: Add amd_iommu_domain_direct_map function ...
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/ats.c90
-rw-r--r--drivers/pci/hotplug/pciehp.h1
-rw-r--r--drivers/pci/hotplug/pciehp_core.c11
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c4
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c1
-rw-r--r--drivers/pci/msi.c121
-rw-r--r--drivers/pci/pci-acpi.c13
-rw-r--r--drivers/pci/pcie/aspm.c58
8 files changed, 214 insertions, 85 deletions
diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c
index b0dd08e6a9da..9dd90b30f91a 100644
--- a/drivers/pci/ats.c
+++ b/drivers/pci/ats.c
@@ -175,21 +175,22 @@ int pci_enable_pri(struct pci_dev *pdev, u32 reqs)
175 u32 max_requests; 175 u32 max_requests;
176 int pos; 176 int pos;
177 177
178 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 178 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
179 if (!pos) 179 if (!pos)
180 return -EINVAL; 180 return -EINVAL;
181 181
182 pci_read_config_word(pdev, pos + PCI_PRI_CONTROL_OFF, &control); 182 pci_read_config_word(pdev, pos + PCI_PRI_CTRL, &control);
183 pci_read_config_word(pdev, pos + PCI_PRI_STATUS_OFF, &status); 183 pci_read_config_word(pdev, pos + PCI_PRI_STATUS, &status);
184 if ((control & PCI_PRI_ENABLE) || !(status & PCI_PRI_STATUS_STOPPED)) 184 if ((control & PCI_PRI_CTRL_ENABLE) ||
185 !(status & PCI_PRI_STATUS_STOPPED))
185 return -EBUSY; 186 return -EBUSY;
186 187
187 pci_read_config_dword(pdev, pos + PCI_PRI_MAX_REQ_OFF, &max_requests); 188 pci_read_config_dword(pdev, pos + PCI_PRI_MAX_REQ, &max_requests);
188 reqs = min(max_requests, reqs); 189 reqs = min(max_requests, reqs);
189 pci_write_config_dword(pdev, pos + PCI_PRI_ALLOC_REQ_OFF, reqs); 190 pci_write_config_dword(pdev, pos + PCI_PRI_ALLOC_REQ, reqs);
190 191
191 control |= PCI_PRI_ENABLE; 192 control |= PCI_PRI_CTRL_ENABLE;
192 pci_write_config_word(pdev, pos + PCI_PRI_CONTROL_OFF, control); 193 pci_write_config_word(pdev, pos + PCI_PRI_CTRL, control);
193 194
194 return 0; 195 return 0;
195} 196}
@@ -206,13 +207,13 @@ void pci_disable_pri(struct pci_dev *pdev)
206 u16 control; 207 u16 control;
207 int pos; 208 int pos;
208 209
209 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 210 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
210 if (!pos) 211 if (!pos)
211 return; 212 return;
212 213
213 pci_read_config_word(pdev, pos + PCI_PRI_CONTROL_OFF, &control); 214 pci_read_config_word(pdev, pos + PCI_PRI_CTRL, &control);
214 control &= ~PCI_PRI_ENABLE; 215 control &= ~PCI_PRI_CTRL_ENABLE;
215 pci_write_config_word(pdev, pos + PCI_PRI_CONTROL_OFF, control); 216 pci_write_config_word(pdev, pos + PCI_PRI_CTRL, control);
216} 217}
217EXPORT_SYMBOL_GPL(pci_disable_pri); 218EXPORT_SYMBOL_GPL(pci_disable_pri);
218 219
@@ -227,13 +228,13 @@ bool pci_pri_enabled(struct pci_dev *pdev)
227 u16 control; 228 u16 control;
228 int pos; 229 int pos;
229 230
230 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 231 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
231 if (!pos) 232 if (!pos)
232 return false; 233 return false;
233 234
234 pci_read_config_word(pdev, pos + PCI_PRI_CONTROL_OFF, &control); 235 pci_read_config_word(pdev, pos + PCI_PRI_CTRL, &control);
235 236
236 return (control & PCI_PRI_ENABLE) ? true : false; 237 return (control & PCI_PRI_CTRL_ENABLE) ? true : false;
237} 238}
238EXPORT_SYMBOL_GPL(pci_pri_enabled); 239EXPORT_SYMBOL_GPL(pci_pri_enabled);
239 240
@@ -249,17 +250,17 @@ int pci_reset_pri(struct pci_dev *pdev)
249 u16 control; 250 u16 control;
250 int pos; 251 int pos;
251 252
252 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 253 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
253 if (!pos) 254 if (!pos)
254 return -EINVAL; 255 return -EINVAL;
255 256
256 pci_read_config_word(pdev, pos + PCI_PRI_CONTROL_OFF, &control); 257 pci_read_config_word(pdev, pos + PCI_PRI_CTRL, &control);
257 if (control & PCI_PRI_ENABLE) 258 if (control & PCI_PRI_CTRL_ENABLE)
258 return -EBUSY; 259 return -EBUSY;
259 260
260 control |= PCI_PRI_RESET; 261 control |= PCI_PRI_CTRL_RESET;
261 262
262 pci_write_config_word(pdev, pos + PCI_PRI_CONTROL_OFF, control); 263 pci_write_config_word(pdev, pos + PCI_PRI_CTRL, control);
263 264
264 return 0; 265 return 0;
265} 266}
@@ -282,14 +283,14 @@ bool pci_pri_stopped(struct pci_dev *pdev)
282 u16 control, status; 283 u16 control, status;
283 int pos; 284 int pos;
284 285
285 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 286 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
286 if (!pos) 287 if (!pos)
287 return true; 288 return true;
288 289
289 pci_read_config_word(pdev, pos + PCI_PRI_CONTROL_OFF, &control); 290 pci_read_config_word(pdev, pos + PCI_PRI_CTRL, &control);
290 pci_read_config_word(pdev, pos + PCI_PRI_STATUS_OFF, &status); 291 pci_read_config_word(pdev, pos + PCI_PRI_STATUS, &status);
291 292
292 if (control & PCI_PRI_ENABLE) 293 if (control & PCI_PRI_CTRL_ENABLE)
293 return false; 294 return false;
294 295
295 return (status & PCI_PRI_STATUS_STOPPED) ? true : false; 296 return (status & PCI_PRI_STATUS_STOPPED) ? true : false;
@@ -311,15 +312,15 @@ int pci_pri_status(struct pci_dev *pdev)
311 u16 status, control; 312 u16 status, control;
312 int pos; 313 int pos;
313 314
314 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 315 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
315 if (!pos) 316 if (!pos)
316 return -EINVAL; 317 return -EINVAL;
317 318
318 pci_read_config_word(pdev, pos + PCI_PRI_CONTROL_OFF, &control); 319 pci_read_config_word(pdev, pos + PCI_PRI_CTRL, &control);
319 pci_read_config_word(pdev, pos + PCI_PRI_STATUS_OFF, &status); 320 pci_read_config_word(pdev, pos + PCI_PRI_STATUS, &status);
320 321
321 /* Stopped bit is undefined when enable == 1, so clear it */ 322 /* Stopped bit is undefined when enable == 1, so clear it */
322 if (control & PCI_PRI_ENABLE) 323 if (control & PCI_PRI_CTRL_ENABLE)
323 status &= ~PCI_PRI_STATUS_STOPPED; 324 status &= ~PCI_PRI_STATUS_STOPPED;
324 325
325 return status; 326 return status;
@@ -342,25 +343,25 @@ int pci_enable_pasid(struct pci_dev *pdev, int features)
342 u16 control, supported; 343 u16 control, supported;
343 int pos; 344 int pos;
344 345
345 pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); 346 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID);
346 if (!pos) 347 if (!pos)
347 return -EINVAL; 348 return -EINVAL;
348 349
349 pci_read_config_word(pdev, pos + PCI_PASID_CONTROL_OFF, &control); 350 pci_read_config_word(pdev, pos + PCI_PASID_CTRL, &control);
350 pci_read_config_word(pdev, pos + PCI_PASID_CAP_OFF, &supported); 351 pci_read_config_word(pdev, pos + PCI_PASID_CAP, &supported);
351 352
352 if (!(supported & PCI_PASID_ENABLE)) 353 if (control & PCI_PASID_CTRL_ENABLE)
353 return -EINVAL; 354 return -EINVAL;
354 355
355 supported &= PCI_PASID_EXEC | PCI_PASID_PRIV; 356 supported &= PCI_PASID_CAP_EXEC | PCI_PASID_CAP_PRIV;
356 357
357 /* User wants to enable anything unsupported? */ 358 /* User wants to enable anything unsupported? */
358 if ((supported & features) != features) 359 if ((supported & features) != features)
359 return -EINVAL; 360 return -EINVAL;
360 361