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


Groups > linux.kernel > #1237018

[PATCH v6 48/53] PCI: Add has_mem64 for struct host_bridge

From Yinghai Lu <yinghai@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v6 48/53] PCI: Add has_mem64 for struct host_bridge
Date 2015-10-01 08:10 +0200
Message-ID <qeFe3-3CQ-31@gated-at.bofh.it> (permalink)
References <qeF4l-3bG-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Add has_mem64 for struct host_bridge, on root bus that does not support
mmio64 above 4g, will not set that.

We will use that info next two following patches:
1. Don't treat non-pref mmio64 as pref mmio, so will not put
   it under bridge's pref range when rescan the devices
2. will keep pref mmio64 and pref mmio32 under bridge pref bar.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 drivers/pci/probe.c | 9 +++++++++
 include/linux/pci.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 9eb9e30..31998ea 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2122,6 +2122,15 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
 		dev_info(&b->dev, "root bus resource %pR%s\n", res, bus_addr);
 	}
 
+	resource_list_for_each_entry(window, &bridge->windows) {
+		res = window->res;
+		if (resource_type(res) == IORESOURCE_MEM &&
+		    (res->end - window->offset) > 0xffffffff) {
+			bridge->has_mem64 = 1;
+			break;
+		}
+	}
+
 	down_write(&pci_bus_sem);
 	list_add_tail(&b->node, &pci_root_buses);
 	up_write(&pci_bus_sem);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 66969bb..207ee64 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -413,6 +413,7 @@ struct pci_host_bridge {
 	void (*release_fn)(struct pci_host_bridge *);
 	void *release_data;
 	unsigned int ignore_reset_delay:1;	/* for entire hierarchy */
+	unsigned int has_mem64:1;
 };
 
 #define	to_pci_host_bridge(n) container_of(n, struct pci_host_bridge, dev)
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH v6 00/53] PCI: Resource allocation cleanup for v4.4 Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 27/53] PCI: Separate out save_resources()/restore_resources() Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 41/53] PCI: Kill macro checking for bus io port sizing Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 38/53] PCI: Unify calculate_size() for io port and MMIO Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 46/53] PCI: Check pref compatible bit for mem64 resource of PCIe device Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 35/53] PCI: Don't add too much optional size for hotplug bridge io Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 50/53] PCI: Restore pref MMIO allocation logic for host bridge without mmio64 Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 16/53] PCI: Optimize bus align/size calculation for optional during sizing Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 21/53] PCI: Treat ROM resource as optional during realloc Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 30/53] PCI: Skip required+optional if there is no optional Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 39/53] PCI: Allow bridge optional only io port resource required size to be 0 Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 25/53] PCI: Cache window alignment value during bus sizing Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 53/53] PCI: Don't set flags to 0 when assign resource fail Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 17/53] PCI: Don't add too much optional size for hotplug bridge MMIO Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 42/53] resources: Split out __allocate_resource() Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 48/53] PCI: Add has_mem64 for struct host_bridge Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 33/53] PCI: Add support for more than two alt_size entries under same bridge Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 45/53] PCI: Add debug print out for min_align and alt_size Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:10 +0200
  [PATCH v6 24/53] PCI: Add __add_to_list() Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:20 +0200
  [PATCH v6 44/53] PCI, x86: Allocate from high in available window for MMIO Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:20 +0200
  [PATCH v6 12/53] PCI: Cleanup res_to_dev_res() printout Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:20 +0200
  [PATCH v6 52/53] PCI: Introduce resource_disabled() Yinghai Lu <yinghai@kernel.org> - 2015-10-01 08:20 +0200
  [PATCH v6 51/53] PCI, x86: Add pci=assign_pref_bars to reallocate pref BARs Yinghai Lu <yinghai@kernel.org> - 2015-10-01 09:00 +0200
  [PATCH v6 26/53] PCI: Check if resource is allocated before trying to assign one Yinghai Lu <yinghai@kernel.org> - 2015-10-01 09:00 +0200
  [PATCH v6 20/53] PCI: Rename pdev_sort_resources() to pdev_assign_resources_prepare() Yinghai Lu <yinghai@kernel.org> - 2015-10-01 09:00 +0200
  [PATCH v6 49/53] PCI: Only treat non-pref mmio64 as pref if host bridge has mmio64 Yinghai Lu <yinghai@kernel.org> - 2015-10-01 09:00 +0200
  [PATCH v6 34/53] PCI: Fix size calculation with old_size on rescan path Yinghai Lu <yinghai@kernel.org> - 2015-10-01 09:00 +0200

csiph-web