summaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorJake Oshins <jakeo@microsoft.com>2015-12-15 01:01:52 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-15 04:15:05 +0100
commit40f26f3168bf7a4da490db308dc0bd9f9923f41f (patch)
tree6d737d59794f90289e255334898f89be5b4486da /drivers/hv
parentDrivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex (diff)
downloadlinux-40f26f3168bf7a4da490db308dc0bd9f9923f41f.tar.xz
linux-40f26f3168bf7a4da490db308dc0bd9f9923f41f.zip
drivers:hv: Allow for MMIO claims that span ACPI _CRS records
This patch makes 16GB GPUs work in Hyper-V VMs, since, for compatibility reasons, the Hyper-V BIOS lists MMIO ranges in 2GB chunks in its root bus's _CRS object. Signed-off-by: Jake Oshins <jakeo@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/vmbus_drv.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index f123bca77808..328e4c3808e0 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1063,12 +1063,28 @@ static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx)
new_res->start = start;
new_res->end = end;
+ /*
+ * Stick ranges from higher in address space at the front of the list.
+ * If two ranges are adjacent, merge them.
+ */
do {
if (!*old_res) {
*old_res = new_res;
break;
}
+ if (((*old_res)->end + 1) == new_res->start) {
+ (*old_res)->end = new_res->end;
+ kfree(new_res);
+ break;
+ }
+
+ if ((*old_res)->start == new_res->end + 1) {
+ (*old_res)->start = new_res->start;
+ kfree(new_res);
+ break;
+ }
+
if ((*old_res)->end < new_res->start) {
new_res->sibling = *old_res;
if (prev_res)