summaryrefslogtreecommitdiffstats
path: root/arch/x86/pci
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-10-24 14:40:26 -0500
committerBjorn Helgaas <bhelgaas@google.com>2017-10-25 16:07:31 -0500
commit8bb705e3e79d84e77edd4499e74483dd96a4626c (patch)
tree6e8ec3230481d768d7a5a53e12d6975fb1bd9e9f /arch/x86/pci
parent276b738deb5bf856b9f6049fcd92a967f52643d7 (diff)
downloadlinux-8bb705e3e79d84e77edd4499e74483dd96a4626c.tar.bz2
PCI: Add pci_resize_resource() for resizing BARs
Add a pci_resize_resource() interface to allow device drivers to resize BARs of their devices. This is useful for devices with large local storage, e.g., graphics devices. These devices often only expose 256MB BARs initially to be compatible with 32-bit systems. This function only tries to reprogram the windows of the bridge directly above the requesting device and only the BAR of the same type (usually mem, 64bit, prefetchable). This is done to avoid disturbing other drivers by changing the BARs of their devices. Drivers should use the following sequence to resize their BARs: 1. Disable memory decoding of the device using the PCI cfg dword. 2. Use pci_release_resource() to release all BARs which can move during the resize, including the one you want to resize. 3. Call pci_resize_resource() for each BAR you want to resize. 4. Call pci_assign_unassigned_bus_resources() to reassign new locations for all BARs which are not resized, but could move. 5. If everything worked as expected, enable memory decoding in the device again using the PCI cfg dword. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'arch/x86/pci')
0 files changed, 0 insertions, 0 deletions