linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Jiang Wang <Jiang.Wang@riverbed.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	clala@riverbed.com, Francis.St.Amant@riverbed.com,
	Jiang Wang <jwang@riverbed.com>
Subject: Re: [PATCH 1/1] pci-iov: Fix warnings when CONFIG_PCI_IOV is enabled
Date: Tue, 11 Sep 2012 17:35:11 -0600	[thread overview]
Message-ID: <CAErSpo7vu0uS=06Dr82-LZ3KBzxaje6fV+H=Foi-bD1c6mUcFA@mail.gmail.com> (raw)
In-Reply-To: <1346800307-11041-1-git-send-email-Jiang.Wang@riverbed.com>

On Tue, Sep 4, 2012 at 5:11 PM, Jiang Wang <Jiang.Wang@riverbed.com> wrote:
> 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;

But this would mean that Linux can't *ever* enable VFs unless the BIOS
enabled them, right?  I don't think that's what we want -- there's
code in sriov_enable() to turn on VFE, assuming we have enough
resources for the VFs.

It's certainly possible that the BIOS didn't allocate large enough
apertures in the bridges leading to the SR-IOV device to accommodate
all the VFs, and Linux may not be smart enough to enlarge them.  And
probably our warning messages in that case are not very enlightening.

Bjorn

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

  reply	other threads:[~2012-09-11 23:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04 23:11 [PATCH 1/1] pci-iov: Fix warnings when CONFIG_PCI_IOV is enabled Jiang Wang
2012-09-11 23:35 ` Bjorn Helgaas [this message]
2012-09-12  1:13   ` Jiang Wang

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='CAErSpo7vu0uS=06Dr82-LZ3KBzxaje6fV+H=Foi-bD1c6mUcFA@mail.gmail.com' \
    --to=bhelgaas@google.com \
    --cc=Francis.St.Amant@riverbed.com \
    --cc=Jiang.Wang@riverbed.com \
    --cc=clala@riverbed.com \
    --cc=jwang@riverbed.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).