diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2011-11-11 12:06:56 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-12-05 13:22:03 -0500 |
commit | 60fe823837d10673500ff685c01eb2f896fe5849 (patch) | |
tree | c39f6ae4d9944e766628b1dcd301cda5e4597532 | |
parent | a776c491ca5e38c26d9f66923ff574d041e747f4 (diff) |
PCI: Enable is not exposed as a PASID capability
The PASID ECN indicates bit 0 is reserved in the capability register.
Switch pci_enable_pasid() to error if PASID is already enabled and
don't expose enable as a feature in pci_pasid_features().
Reviewed-by: Joerg Roedel <joerg.roedel@amd.com>
Tested-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r-- | drivers/pci/ats.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c index 831e1920386c..8e95a123d37a 100644 --- a/drivers/pci/ats.c +++ b/drivers/pci/ats.c | |||
@@ -348,7 +348,7 @@ int pci_enable_pasid(struct pci_dev *pdev, int features) | |||
348 | pci_read_config_word(pdev, pos + PCI_PASID_CONTROL_OFF, &control); | 348 | pci_read_config_word(pdev, pos + PCI_PASID_CONTROL_OFF, &control); |
349 | pci_read_config_word(pdev, pos + PCI_PASID_CAP_OFF, &supported); | 349 | pci_read_config_word(pdev, pos + PCI_PASID_CAP_OFF, &supported); |
350 | 350 | ||
351 | if (!(supported & PCI_PASID_ENABLE)) | 351 | if (control & PCI_PASID_ENABLE) |
352 | return -EINVAL; | 352 | return -EINVAL; |
353 | 353 | ||
354 | supported &= PCI_PASID_EXEC | PCI_PASID_PRIV; | 354 | supported &= PCI_PASID_EXEC | PCI_PASID_PRIV; |
@@ -390,7 +390,6 @@ EXPORT_SYMBOL_GPL(pci_disable_pasid); | |||
390 | * Returns a negative value when no PASI capability is present. | 390 | * Returns a negative value when no PASI capability is present. |
391 | * Otherwise is returns a bitmask with supported features. Current | 391 | * Otherwise is returns a bitmask with supported features. Current |
392 | * features reported are: | 392 | * features reported are: |
393 | * PCI_PASID_ENABLE - PASID capability can be enabled | ||
394 | * PCI_PASID_EXEC - Execute permission supported | 393 | * PCI_PASID_EXEC - Execute permission supported |
395 | * PCI_PASID_PRIV - Priviledged mode supported | 394 | * PCI_PASID_PRIV - Priviledged mode supported |
396 | */ | 395 | */ |
@@ -405,7 +404,7 @@ int pci_pasid_features(struct pci_dev *pdev) | |||
405 | 404 | ||
406 | pci_read_config_word(pdev, pos + PCI_PASID_CAP_OFF, &supported); | 405 | pci_read_config_word(pdev, pos + PCI_PASID_CAP_OFF, &supported); |
407 | 406 | ||
408 | supported &= PCI_PASID_ENABLE | PCI_PASID_EXEC | PCI_PASID_PRIV; | 407 | supported &= PCI_PASID_EXEC | PCI_PASID_PRIV; |
409 | 408 | ||
410 | return supported; | 409 | return supported; |
411 | } | 410 | } |