From: Bjorn Helgaas <bhelgaas@google.com>
To: linux-pci@vger.kernel.org, Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>, Yinghai Lu <yinghai@kernel.org>,
Guo Chao <yan@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH v7 00/15] PCI: Allocate 64-bit BARs above 4G when possible
Date: Mon, 06 Jan 2014 17:55:12 -0700 [thread overview]
Message-ID: <20140107005003.10786.85164.stgit@bhelgaas-glaptop.roam.corp.google.com> (raw)
This is basically v7 of Yinghai's patch series:
http://lkml.kernel.org/r/1387485843-17403-1-git-send-email-yinghai@kernel.org
The goal is to try to put 64-bit BARs above 4G so we can preserve the
32-bit bus address space for 32-bit BARs.
There are a whole bunch of AGP updates at the beginning because some AGP
devices have 64-bit BARs, but most of the AGP drivers read the aperture
bus address directly from the BAR, and they only handle 32-bit BARs.
Putting BARs above 4G would break those drivers, so we tried to fix them
up first. Yinghai fixed intel-gtt.c, and I made similar fixes to all
the other AGP drivers I could find.
Some of the AGP updates are related to the fact that most of the drivers
assume the PCI bus address is the same as the CPU physical address. For
example, they read the bus address from the BAR, then call ioremap() on
it. This is wrong, because ioremap() expects a CPU physical address,
not a bus address. In most cases, I think AGP devices are in simple
systems where (bus_address == CPU_physical_address), so these updates
probably don't fix any broken systems. I'm pretty sure there are more
things like this that should be fixed.
The important PCI changes are the last two:
PCI: Enforce bus address limits in resource allocation
PCI: Allocate 64-bit BARs above 4G when possible
The first fixes a long-standing bug: we would never assign space to a
32-bit BAR if the *CPU* address didn't fit in 32 bits. But the important
thing is the *bus* address, and that may fit in 32 bits even if the CPU
address doesn't.
The second is the one that tries to allocate space above 4G for 64-bit
BARs. If that fails, we fall back to allocating space anywhere. It's
possible this will expose other broken drivers that can't deal with
64-bit BARs being above 4G.
I kept Yinghai as the author of the patches that originated with him,
but I reworked them substantially to try to simplify the series, so any
bugs here are most likely my fault. If my rework made things worse, or
if it makes your life difficult, I will consider doing something
different; just let me know.
---
Bjorn Helgaas (11):
PCI: Change pci_bus_region addresses to dma_addr_t
PCI: Add pci_bus_address() to get bus address of a BAR
agp: Support 64-bit APBASE
agp: Use pci_resource_start() to get CPU physical address for BAR
drm/i915: Rename gtt_bus_addr to gtt_phys_addr
agp/intel: Rename gtt_bus_addr to gtt_phys_addr
agp/intel: Use pci_bus_address() to get MMADR bus address
agp/intel: Use pci_bus_address() to get GTTADR bus address
agp/intel: Use CPU physical address, not bus address, for ioremap()
agp/ati: Use PCI_COMMAND instead of hard-coded 4
PCI: Split out bridge window override of minimum allocation address
Yinghai Lu (4):
PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev
agp/intel: Support 64-bit GMADR
PCI: Enforce bus address limits in resource allocation
PCI: Allocate 64-bit BARs above 4G when possible
arch/alpha/kernel/pci-sysfs.c | 4 +
arch/powerpc/kernel/pci-common.c | 4 +
arch/powerpc/kernel/pci_of_scan.c | 4 +
arch/sparc/kernel/pci.c | 6 +-
arch/x86/include/asm/pci.h | 1
drivers/char/agp/agp.h | 1
drivers/char/agp/ali-agp.c | 4 +
drivers/char/agp/amd-k7-agp.c | 14 ++--
drivers/char/agp/amd64-agp.c | 5 -
drivers/char/agp/ati-agp.c | 21 +++---
drivers/char/agp/efficeon-agp.c | 5 +
drivers/char/agp/generic.c | 4 +
drivers/char/agp/intel-agp.c | 48 +++++--------
drivers/char/agp/intel-agp.h | 10 +--
drivers/char/agp/intel-gtt.c | 47 +++++--------
drivers/char/agp/nvidia-agp.c | 9 +-
drivers/char/agp/sis-agp.c | 5 +
drivers/char/agp/via-agp.c | 13 ++--
drivers/gpu/drm/i915/i915_gem_gtt.c | 6 +-
drivers/pci/bus.c | 128 +++++++++++++++++++++++++++--------
drivers/pci/host-bridge.c | 19 ++---
drivers/pci/probe.c | 18 ++---
drivers/pci/quirks.c | 2 -
drivers/pci/rom.c | 2 -
drivers/pci/setup-bus.c | 16 ++--
drivers/pci/setup-res.c | 2 -
drivers/pcmcia/i82092.c | 2 -
drivers/pcmcia/yenta_socket.c | 6 +-
drivers/scsi/sym53c8xx_2/sym_glue.c | 5 +
drivers/video/arkfb.c | 2 -
drivers/video/s3fb.c | 2 -
drivers/video/vt8623fb.c | 2 -
include/linux/pci.h | 20 +++--
33 files changed, 241 insertions(+), 196 deletions(-)
next reply other threads:[~2014-01-07 0:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-07 0:55 Bjorn Helgaas [this message]
2014-01-07 0:55 ` [PATCH v7 01/15] PCI: Change pci_bus_region addresses to dma_addr_t Bjorn Helgaas
2014-01-07 0:55 ` [PATCH v7 02/15] PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev Bjorn Helgaas
2014-01-07 0:55 ` [PATCH v7 03/15] PCI: Add pci_bus_address() to get bus address of a BAR Bjorn Helgaas
2014-01-07 0:55 ` [PATCH v7 04/15] agp: Support 64-bit APBASE Bjorn Helgaas
2014-01-07 0:55 ` [PATCH v7 05/15] agp: Use pci_resource_start() to get CPU physical address for BAR Bjorn Helgaas
2014-01-07 0:55 ` [PATCH v7 06/15] drm/i915: Rename gtt_bus_addr to gtt_phys_addr Bjorn Helgaas
2014-01-07 0:56 ` [PATCH v7 07/15] agp/intel: " Bjorn Helgaas
2014-01-07 0:56 ` [PATCH v7 08/15] agp/intel: Support 64-bit GMADR Bjorn Helgaas
2014-01-07 0:56 ` [PATCH v7 09/15] agp/intel: Use pci_bus_address() to get MMADR bus address Bjorn Helgaas
2014-01-07 0:56 ` [PATCH v7 10/15] agp/intel: Use pci_bus_address() to get GTTADR " Bjorn Helgaas
2014-01-07 0:56 ` [PATCH v7 11/15] agp/intel: Use CPU physical address, not bus address, for ioremap() Bjorn Helgaas
2014-01-07 0:56 ` [PATCH v7 12/15] agp/ati: Use PCI_COMMAND instead of hard-coded 4 Bjorn Helgaas
2014-01-07 0:56 ` [PATCH v7 13/15] PCI: Split out bridge window override of minimum allocation address Bjorn Helgaas
2014-01-07 0:56 ` [PATCH v7 14/15] PCI: Enforce bus address limits in resource allocation Bjorn Helgaas
2014-01-07 0:56 ` [PATCH v7 15/15] PCI: Allocate 64-bit BARs above 4G when possible Bjorn Helgaas
2014-01-07 10:46 ` [PATCH v7 00/15] " Daniel Vetter
2014-01-07 18:46 ` Bjorn Helgaas
2014-01-10 21:34 ` Bjorn Helgaas
2014-01-15 5:14 ` Dave Airlie
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=20140107005003.10786.85164.stgit@bhelgaas-glaptop.roam.corp.google.com \
--to=bhelgaas@google.com \
--cc=airlied@linux.ie \
--cc=daniel.vetter@ffwll.ch \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®