linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: Support SRIOV on Legacy EndPoint device
@ 2016-02-04 14:48 Kelly Zytaruk
  2016-02-04 15:14 ` Bjorn Helgaas
  0 siblings, 1 reply; 9+ messages in thread
From: Kelly Zytaruk @ 2016-02-04 14:48 UTC (permalink / raw)
  To: bhelgaas, linux-pci, linux-kernel; +Cc: Kelly Zytaruk

Some AMD GPUs have hardware support for grapics SRIOV.
If the GPU has a display output then the GPU needs to support Legacy VGA operation.
If CLASS_CODE = VGA then the device should have a Port Type = Legacy EndPoint.
Therefore in order to enable SRIOV on a GPU with a display output LEGACY_END_POINT is supported as a valid Port Type.

Signed-off-by: Kelly Zytaruk <kelly.zytaruk@amd.com>
---
 drivers/pci/iov.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 31f31d4..da4fbac 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -388,7 +388,8 @@ static int sriov_init(struct pci_dev *dev, int pos)
 	struct pci_dev *pdev;
 
 	if (pci_pcie_type(dev) != PCI_EXP_TYPE_RC_END &&
-	    pci_pcie_type(dev) != PCI_EXP_TYPE_ENDPOINT)
+	    pci_pcie_type(dev) != PCI_EXP_TYPE_ENDPOINT &&
+	    pci_pcie_type(dev) != PCI_EXP_TYPE_LEG_END)
 		return -ENODEV;
 
 	pci_read_config_word(dev, pos + PCI_SRIOV_CTRL, &ctrl);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] PCI: Support SRIOV on Legacy EndPoint device
@ 2016-02-04 15:08 Zytaruk, Kelly
  0 siblings, 0 replies; 9+ messages in thread
From: Zytaruk, Kelly @ 2016-02-04 15:08 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
  Cc: Zytaruk, Kelly

Some AMD GPUs have hardware support for grapics SRIOV.
If the GPU has a display output then the GPU needs to support Legacy VGA operation.
If CLASS_CODE = VGA then the device should have a Port Type = Legacy EndPoint.
Therefore in order to enable SRIOV on a GPU with a display output LEGACY_END_POINT is supported as a valid Port Type.

Signed-off-by: Kelly Zytaruk <kelly.zytaruk@amd.com>
---
 drivers/pci/iov.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 31f31d4..da4fbac 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -388,7 +388,8 @@ static int sriov_init(struct pci_dev *dev, int pos)
 	struct pci_dev *pdev;
 
 	if (pci_pcie_type(dev) != PCI_EXP_TYPE_RC_END &&
-	    pci_pcie_type(dev) != PCI_EXP_TYPE_ENDPOINT)
+	    pci_pcie_type(dev) != PCI_EXP_TYPE_ENDPOINT &&
+	    pci_pcie_type(dev) != PCI_EXP_TYPE_LEG_END)
 		return -ENODEV;
 
 	pci_read_config_word(dev, pos + PCI_SRIOV_CTRL, &ctrl);
--
1.7.10.4

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH] PCI: Support SRIOV on Legacy EndPoint device
@ 2016-02-09 18:08 kelly.zytaruk
  2016-02-29 18:00 ` Bjorn Helgaas
  0 siblings, 1 reply; 9+ messages in thread
From: kelly.zytaruk @ 2016-02-09 18:08 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, linux-kernel; +Cc: Kelly Zytaruk

From: Kelly Zytaruk <kelly.zytaruk@amd.com>

It is not neccessary to check for PCI_EXP_TYPE in sriov_init().  There appears to be no reason for the check.

Some AMD GPUs have hardware support for grapics SRIOV.
If the GPU has a display output then the GPU needs to support Legacy VGA operation.
If CLASS_CODE = VGA then the device should have a Port Type = Legacy EndPoint.
Therefore in order to enable SRIOV on a GPU with a display output, LEGACY_END_POINT is supported as a valid Port Type by removing the check for Port Type.

Patch is also logged in Bugzilla #112221

Signed-off-by: Kelly Zytaruk <kelly.zytaruk@amd.com>
---
 drivers/pci/iov.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 31f31d4..fe4bd0a 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -387,10 +387,6 @@ static int sriov_init(struct pci_dev *dev, int pos)
 	struct resource *res;
 	struct pci_dev *pdev;
 
-	if (pci_pcie_type(dev) != PCI_EXP_TYPE_RC_END &&
-	    pci_pcie_type(dev) != PCI_EXP_TYPE_ENDPOINT)
-		return -ENODEV;
-
 	pci_read_config_word(dev, pos + PCI_SRIOV_CTRL, &ctrl);
 	if (ctrl & PCI_SRIOV_CTRL_VFE) {
 		pci_write_config_word(dev, pos + PCI_SRIOV_CTRL, 0);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-29 18:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-04 14:48 [PATCH] PCI: Support SRIOV on Legacy EndPoint device Kelly Zytaruk
2016-02-04 15:14 ` Bjorn Helgaas
2016-02-04 16:21   ` Zytaruk, Kelly
2016-02-05 16:46     ` Bjorn Helgaas
2016-02-05 16:50       ` Zytaruk, Kelly
2016-02-05 16:59         ` Bjorn Helgaas
  -- strict thread matches above, loose matches on Subject: below --
2016-02-04 15:08 Zytaruk, Kelly
2016-02-09 18:08 kelly.zytaruk
2016-02-29 18:00 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).