From: Alex Williamson <alex.williamson@redhat.com>
To: linux-pci@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, jbarnes@virtuousgeek.org,
joerg.roedel@amd.com, bhelgaas@google.com
Subject: [PATCH 1/2] PCI: Enable is not exposed as a PASID capability
Date: Fri, 11 Nov 2011 10:06:56 -0700 [thread overview]
Message-ID: <20111111170629.32668.44205.stgit@bling.home> (raw)
In-Reply-To: <20111111170319.32668.48479.stgit@bling.home>
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().
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
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 831e192..8e95a12 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)
pci_read_config_word(pdev, pos + PCI_PASID_CONTROL_OFF, &control);
pci_read_config_word(pdev, pos + PCI_PASID_CAP_OFF, &supported);
- if (!(supported & PCI_PASID_ENABLE))
+ if (control & PCI_PASID_ENABLE)
return -EINVAL;
supported &= PCI_PASID_EXEC | PCI_PASID_PRIV;
@@ -390,7 +390,6 @@ EXPORT_SYMBOL_GPL(pci_disable_pasid);
* Returns a negative value when no PASI capability is present.
* Otherwise is returns a bitmask with supported features. Current
* features reported are:
- * PCI_PASID_ENABLE - PASID capability can be enabled
* PCI_PASID_EXEC - Execute permission supported
* PCI_PASID_PRIV - Priviledged mode supported
*/
@@ -405,7 +404,7 @@ int pci_pasid_features(struct pci_dev *pdev)
pci_read_config_word(pdev, pos + PCI_PASID_CAP_OFF, &supported);
- supported &= PCI_PASID_ENABLE | PCI_PASID_EXEC | PCI_PASID_PRIV;
+ supported &= PCI_PASID_EXEC | PCI_PASID_PRIV;
return supported;
}
next prev parent reply other threads:[~2011-11-11 17:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-11 17:06 [PATCH 0/2] PCI: PRI/PASSID cleanup and fix Alex Williamson
2011-11-11 17:06 ` Alex Williamson [this message]
2011-11-11 17:07 ` [PATCH 2/2] PCI: More PRI/PASID cleanup Alex Williamson
2011-11-11 17:40 ` Jesse Barnes
2011-11-23 10:47 ` [PATCH 0/2] PCI: PRI/PASSID cleanup and fix Joerg Roedel
2011-11-23 22:45 ` Jesse Barnes
2011-11-28 10:40 ` Joerg Roedel
2011-12-05 18:24 ` Jesse Barnes
2011-12-06 10:05 ` Joerg Roedel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111111170629.32668.44205.stgit@bling.home \
--to=alex.williamson@redhat.com \
--cc=bhelgaas@google.com \
--cc=jbarnes@virtuousgeek.org \
--cc=joerg.roedel@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox