drivers:hv: Track allocations of children of hv_vmbus in private resource tree
authorJake Oshins <jakeo@microsoft.com>
Tue, 5 Apr 2016 17:22:54 +0000 (10:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Apr 2016 21:01:37 +0000 (14:01 -0700)
commitbe000f93e5d71f5d43dd722f8eb110b069f9d8a2
tree5b87f10b2c25800aa44ce6cd0234fa8e382b5994
parent23a0683186b7ca0083bfc76b410497f39a9d0351
drivers:hv: Track allocations of children of hv_vmbus in private resource tree

This patch changes vmbus_allocate_mmio() and vmbus_free_mmio() so
that when child paravirtual devices allocate memory-mapped I/O
space, they allocate it privately from a resource tree pointed
at by hyperv_mmio and also by the public resource tree
iomem_resource.  This allows the region to be marked as "busy"
in the private tree, but a "bridge window" in the public tree,
guaranteeing that no two bridge windows will overlap each other
but while also allowing the PCI device children of the bridge
windows to overlap that window.

One might conclude that this belongs in the pnp layer, rather
than in this driver.  Rafael Wysocki, the maintainter of the
pnp layer, has previously asked that we not modify the pnp layer
as it is considered deprecated.  This patch is thus essentially
a workaround.

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>
drivers/hv/vmbus_drv.c