All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	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: Fri, 11 Jul 2014 11:21:13 -0700	[thread overview]
Message-ID: <CA+55aFwyfaAa3opKsDth7b4RXb7E2_Thb581VWvg9V-GvJCYbg@mail.gmail.com> (raw)
In-Reply-To: <CAE9FiQWUPd4d9DWeiuDqQ=tKKe+5ZofUEw3JViXYs6+9zBG6Sg@mail.gmail.com>

On Fri, Jul 11, 2014 at 11:09 AM, Yinghai Lu <yinghai@kernel.org> wrote:
>
> If the BAR have all 0, cpu can not access it as hw will forward access to ram
> controller according to routing table.

On PC's, yes (also likely with many devices - there are definitely
devices out there were setting the BAR to zero disables it).

On other platforms? Not necessarily at all, and some devices have no
way of disabling the BAR (even clearing the IO/MEM bits in the
control/status register does *not* necessarily disable things like
root bridge BARs). I'm pretty sure we had it actually happen (I'd like
to say "Powerpc", but I wouldn't really bet on it)

Anyway, the rule is that "r->flags = 0" means that it doesn't exist.
And that rule makes sense, and is completely unambiguous. Relying on
the BAR _value_ being zero is bogus and wrong.

Probing that finds a valid BAR, but an unassigned one, will set the
UNSET bit. Plus IORESOURCE_MEM or IO should also always be set for a
valid bar. So a value of zero really is completely unambiguous - it
does not exist. It's not unassigned, it really isn't there.

Of course, it's possible that we get this wrong, and initial probing
will obviously start out with a zero value, so there is clearly one
valid situation where we go from "does not exist" to something else,
but in general, "r->flags == 0" really is special.

           Linus

  reply	other threads:[~2014-07-11 18:21 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
2014-07-11 18:00               ` Bjorn Helgaas
2014-07-11 18:09                 ` Yinghai Lu
2014-07-11 18:21                   ` Linus Torvalds [this message]
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=CA+55aFwyfaAa3opKsDth7b4RXb7E2_Thb581VWvg9V-GvJCYbg@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=yan@linux.vnet.ibm.com \
    --cc=yinghai@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 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.