From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH 1/2] PCI: Prevent bus conflicts while checking for bridge apertures
Date: Mon, 9 Dec 2013 12:31:12 -0700 [thread overview]
Message-ID: <20131209193112.GA20199@obsidianresearch.com> (raw)
In-Reply-To: <20131206001947.27659.14981.stgit@bhelgaas-glaptop.roam.corp.google.com>
On Thu, Dec 05, 2013 at 05:19:47PM -0700, Bjorn Helgaas wrote:
> pci_bridge_check_ranges() determines whether the bridge supports an I/O
> aperture and a prefetchable memory aperture.
>
> Previously, if the I/O aperture was unsupported, disabled, or configured at
> [io 0x0000-0x0fff], we wrote 0xf0 to PCI_IO_BASE and PCI_IO_LIMIT, which,
> if the bridge supports it, enables the I/O aperture at [io 0xf000-0xffff].
> The enabled aperture may conflict with other devices in the system.
>
> Similarly, we wrote 0xfff0 to PCI_PREF_MEMORY_BASE and
> PCI_PREF_MEMORY_LIMIT, which enables the prefetchable memory aperture at
> [mem 0xfff00000-0xffffffff], and that may also conflict with other devices.
>
> All we need to know is whether the base and limit registers are writable,
> so we can use values that leave the apertures disabled, e.g., PCI_IO_BASE =
> 0xf0, PCI_IO_LIMIT = 0xe0, PCI_PREF_MEMORY_BASE = 0xfff0,
> PCI_PREF_MEMORY_LIMIT = 0xffe0.
>
> Writing non-zero values to both the base and limit registers means we
> detect whether either or both are writable, as we did before.
Looks sane to me. The only refinement would be to detect if IO is
enabled and use that as a first check.
Cheers,
Jason
next prev parent reply other threads:[~2013-12-09 19:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 0:19 [PATCH 0/2] Bridge window discovery and setup fixes Bjorn Helgaas
2013-12-06 0:19 ` [PATCH 1/2] PCI: Prevent bus conflicts while checking for bridge apertures Bjorn Helgaas
2013-12-09 19:31 ` Jason Gunthorpe [this message]
2013-12-09 20:00 ` Bjorn Helgaas
2013-12-09 20:15 ` Jason Gunthorpe
2013-12-06 0:19 ` [PATCH 2/2] PCI: Stop clearing bridge Secondary Status when setting up I/O aperture Bjorn Helgaas
2013-12-09 19:33 ` Jason Gunthorpe
2013-12-09 20:15 ` Bjorn Helgaas
2013-12-09 21:27 ` Jason Gunthorpe
2013-12-09 21:58 ` Bjorn Helgaas
2013-12-10 0:10 ` Jason Gunthorpe
2013-12-10 0:18 ` Bjorn Helgaas
2013-12-10 1:31 ` Jason Gunthorpe
2013-12-10 18:22 ` Bjorn Helgaas
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=20131209193112.GA20199@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=bhelgaas@google.com \
--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).