]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Preserve resource size during alignment reordering
authorYinghai Lu <yinghai@kernel.org>
Fri, 29 May 2015 05:40:00 +0000 (22:40 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 1 Jun 2015 22:56:32 +0000 (17:56 -0500)
commit5a2c0be6b1364505d68977fc919fabb200627c8f
tree82b46e686bc0b87cab90f337eabda13004dfc0ad
parent9940ff2a201d1bd6aeb2a9f45b749df20a09002e
PCI: Preserve resource size during alignment reordering

In 92e6fee75217 ("PCI: Consider additional PF's IOV BAR alignment in sizing
and assigning"), we store additional alignment in realloc_head and take
this into consideration for assignment.

In __assign_resources_sorted(), we changed dev_res->res->start, then used
resource_start() (which depends on res->start), so the recomputed res->end
was completely bogus.  Even if we'd had the correct size, the end would
have been off by one.

Preserve the resource size when we adjust its alignment.

[bhelgaas: changelog]
Fixes: 92e6fee75217 ("PCI: Consider additional PF's IOV BAR alignment in sizing and assigning")
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Wei Yang <weiyang@linux.vnet.ibm.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
drivers/pci/setup-bus.c