lkml.org 
[lkml]   [2012]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] pci-iov: Fix warnings when CONFIG_PCI_IOV is enabled
Date
When CONFIG_PCI_IOV is enabled, the kernel will call sriov_init().
This function tries to allocate virtual resources even if the
virtual function of a PCI devive is not enabled by the BIOS.

This sometimes causes following warning messages during boot up:
pci 0000:02:00.0: BAR 9: can't allocate mem resource [0x000000-0x3fffff]
pci 0000:02:00.0: BAR 7: can't allocate mem resource [0x000000-0x03ffff]

Tested on three Mitac motherboards.

Signed-off-by: Jiang Wang <jwang@riverbed.com>
---
drivers/pci/iov.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 6554e1a..0ca8cb2 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -441,7 +441,8 @@ static int sriov_init(struct pci_dev *dev, int pos)
if (ctrl & PCI_SRIOV_CTRL_VFE) {
pci_write_config_word(dev, pos + PCI_SRIOV_CTRL, 0);
ssleep(1);
- }
+ } else
+ return 0;

pci_read_config_word(dev, pos + PCI_SRIOV_TOTAL_VF, &total);
if (!total)
--
1.7.1


\
 
 \ /
  Last update: 2012-09-05 02:02    [W:0.277 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site