Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1349412

[PATCH v1 02/12] PCI: Don't assign or reassign immutable resources

From Bjorn Helgaas <bhelgaas@google.com>
Newsgroups linux.kernel
Subject [PATCH v1 02/12] PCI: Don't assign or reassign immutable resources
Date 2016-03-03 18:10 +0100
Message-ID <r8EVe-1Ta-59@gated-at.bofh.it> (permalink)
References <r8ELv-1ze-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


IORESOURCE_PCI_FIXED means the resource can't be moved, so if it's set,
don't bother trying to assign or reassign the resource.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/setup-res.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 604011e..66c4d8f 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -276,6 +276,9 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
 	resource_size_t align, size;
 	int ret;
 
+	if (res->flags & IORESOURCE_PCI_FIXED)
+		return 0;
+
 	res->flags |= IORESOURCE_UNSET;
 	align = pci_resource_alignment(dev, res);
 	if (!align) {
@@ -321,6 +324,9 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz
 	resource_size_t new_size;
 	int ret;
 
+	if (res->flags & IORESOURCE_PCI_FIXED)
+		return 0;
+
 	flags = res->flags;
 	res->flags |= IORESOURCE_UNSET;
 	if (!res->parent) {

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v1 00/12] PCI: Rework shadow ROM handling Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:00 +0100
  [PATCH v1 07/12] ia64/PCI: Use ioremap() instead of open-coded  equivalent Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:00 +0100
  [PATCH v1 08/12] ia64/PCI: Keep CPU physical (not virtual)  addresses in shadow ROM resource Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:00 +0100
  [PATCH v1 11/12] PCI: Remove unused IORESOURCE_ROM_COPY and  IORESOURCE_ROM_BIOS_COPY Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:00 +0100
  [PATCH v1 09/12] MIPS: Loongson 3: Use temporary struct resource *  to avoid repetition Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:00 +0100
  [PATCH v1 02/12] PCI: Don't assign or reassign immutable resources Bjorn Helgaas <bhelgaas@google.com> - 2016-03-03 18:10 +0100
  Re: [PATCH v1 00/12] PCI: Rework shadow ROM handling Linus Torvalds <torvalds@linux-foundation.org> - 2016-03-03 19:10 +0100

csiph-web