From: Ethan Zhao <ethan.zhao@oracle.com>
To: bhelgaas@google.com
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Ethan Zhao <ethan.zhao@oracle.com>
Subject: [PATCH v2] iov: restore NumVFs register to 0 before return from virtfn_max_buses()
Date: Wed, 16 Sep 2015 12:19:53 +0900 [thread overview]
Message-ID: <1442373593-8342-1-git-send-email-ethan.zhao@oracle.com> (raw)
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
next reply other threads:[~2015-09-16 3:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 3:19 Ethan Zhao [this message]
2015-10-15 17:16 ` [PATCH v2] iov: restore NumVFs register to 0 before return from virtfn_max_buses() 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
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=1442373593-8342-1-git-send-email-ethan.zhao@oracle.com \
--to=ethan.zhao@oracle.com \
--cc=bhelgaas@google.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;
as well as URLs for NNTP newsgroup(s).