From: Yinghai Lu <yinghai@kernel.org>
To: Bjorn Helgaas <bhelgaas@google.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Guo Chao <yan@linux.vnet.ibm.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] pci: Allow very large resource windows
Date: Thu, 10 Jul 2014 18:12:32 -0700 [thread overview]
Message-ID: <CAE9FiQX69x_YgHihYM-+tahTvbuk6MATBXvm9Rz5kiQ9UpKNPg@mail.gmail.com> (raw)
In-Reply-To: <20140703221152.GH28852@google.com>
On Thu, Jul 3, 2014 at 3:11 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Thu, Jul 03, 2014 at 12:59:21PM -0700, Yinghai Lu wrote:
>> when we try to size it, means that bar is not assigned. with r->flags
>> = 0, means
>> we will ignore it all the way.
>
> With "r->flags = 0", we will not try to assign resources to the BAR,
> but the hardware BAR still exists and contains some address. If the
> device has other memory BARs, pci_enable_resources() will turn on
> PCI_COMMAND_MEMORY. Now the "r->flags == 0" BAR is enabled but the
> address it contains might conflict with other devices. That's the
> problem.
>
> To fix this, I think we need to do "r->flags |= IORESOURCE_UNSET |
> IORESOURCE_DISABLED".
No, that is not right.
Current that r->flags = 0 and reset_resource() cover the bug in
pci_enable_resources() when assign and reassign resource fail.
In pci_enable_resources() if there is one resource with IO BAR or SRIOV BAR
is not assigned and have UNSET, it will prevent device from being enabled.
Most drivers could work without io port.
If you change r->flags = 0 to
r->flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED
Those drivers would not work anymore.
I also know one driver that could work with pref mmio, but mmio is not assigned.
--- silicon bug, that it exposes non-needed mmio bar.
BTW I think we may need to clear the BAR in pci_claim_resource().
Maybe Linus or Greg have more idea about this.
Do we need to get more strict? will only enable PCI_COMMAND_MEMORY
unless all mmio BARs get assigned value?
Thanks
Yinghai
next prev parent reply other threads:[~2014-07-11 1:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-11 6:01 [PATCH] pci: Allow very large resource windows Guo Chao
2014-06-11 17:23 ` Yinghai Lu
2014-06-12 11:32 ` Guo Chao
2014-07-02 21:07 ` Bjorn Helgaas
2014-07-02 22:54 ` Yinghai Lu
2014-07-03 13:15 ` Bjorn Helgaas
2014-07-03 19:59 ` Yinghai Lu
2014-07-03 22:11 ` Bjorn Helgaas
2014-07-11 1:12 ` Yinghai Lu [this message]
2014-07-11 18:00 ` Bjorn Helgaas
2014-07-11 18:09 ` Yinghai Lu
2014-07-11 18:21 ` Linus Torvalds
2014-07-11 18:40 ` Bjorn Helgaas
2014-07-12 1:22 ` Yinghai Lu
2014-09-04 4:20 ` Bjorn Helgaas
-- strict thread matches above, loose matches on Subject: below --
2014-05-19 13:03 Alan
2014-05-19 20:28 ` Bjorn Helgaas
2014-05-23 17:51 ` Kevin Hilman
2014-05-23 17:51 ` Kevin Hilman
2014-05-23 18:41 ` Bjorn Helgaas
2014-05-23 18:41 ` Bjorn Helgaas
2014-04-28 20:23 Alan
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=CAE9FiQX69x_YgHihYM-+tahTvbuk6MATBXvm9Rz5kiQ9UpKNPg@mail.gmail.com \
--to=yinghai@kernel.org \
--cc=bhelgaas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-pci@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=yan@linux.vnet.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.