linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] iov: restore NumVFs register to 0 before return from virtfn_max_buses()
@ 2015-09-16  3:19 Ethan Zhao
  2015-10-15 17:16 ` Bjorn Helgaas
  0 siblings, 1 reply; 9+ messages in thread
From: Ethan Zhao @ 2015-09-16  3:19 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, linux-kernel, Ethan Zhao

After commit 4449f079722c ("PCI: Calculate maximum number of buses
required for VFs"),the initial value of NumVFs register was left to
non-zero after sriov_init() and no VFs was enabled in device driver.
this changed the behaviour of kernel exported by lspci and sysfs etc.
so this patch restore the NumVFs register to zero after the
calculation of max_VF_buses was done and before return from
virtfn_max_buses().

Tested on stable 4.1 and passed building on stable 4.3-rc1

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Tested-by: Sriharsha Yadagudde <sriharsha.devdas@oracle.com>
---
v1..v2:
 -Suggestions from Bjorn Helgaas (move the restoration of NumVFs register
  to virtfn_max_buses())
---
 drivers/pci/iov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index ee0ebff..92cee06 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -71,6 +71,8 @@ static inline u8 virtfn_max_buses(struct pci_dev *dev)
 			max = busnr;
 	}
 
+	/* restore NumVFs register to 0 */
+	pci_iov_set_numvfs(dev, 0);
 	return max;
 }
 
-- 
1.8.3.1


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

end of thread, other threads:[~2015-10-29  3:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-16  3:19 [PATCH v2] iov: restore NumVFs register to 0 before return from virtfn_max_buses() Ethan Zhao
2015-10-15 17:16 ` Bjorn Helgaas
2015-10-21 20:54   ` Bjorn Helgaas
2015-10-22  1:29     ` ethan zhao
2015-10-27  1:13     ` ethan zhao
2015-10-27  5:48   ` Alexander Duyck
2015-10-27  9:28     ` ethan zhao
2015-10-27 15:15       ` Alexander Duyck
2015-10-29  3:29         ` ethan zhao

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).