diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-05 13:22:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-05 13:22:06 -0400 |
commit | 456fdb267377b88fa37abf60fcbd9bfaa813bf1f (patch) | |
tree | e61e262e78e0dfe3ccd6cd4589c9361d116796c1 /drivers | |
parent | 6e6f9e0b00f9ecfa816b290e08d5e660c3f1aae5 (diff) | |
parent | 552bc94ebeeb189d0ac682dae95cf05e6b72d7fd (diff) |
Merge tag 'pci-v4.1-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas:
"Resource management
- Fix IOV sorting by alignment (Wei Yang)
- Preserve resource size during alignment reordering (Yinghai Lu)
Miscellaneous
- MAINTAINERS: Add Pratyush for SPEAr13xx and DesignWare PCIe (Pratyush Anand)"
* tag 'pci-v4.1-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI: Preserve resource size during alignment reordering
PCI: Fix IOV resource sorting by alignment requirement
MAINTAINERS: Add Pratyush Anand as SPEAr13xx and DesignWare PCIe maintainer
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/setup-bus.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 4fd0cacf7ca0..508cc56130e3 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -428,16 +428,19 @@ static void __assign_resources_sorted(struct list_head *head, | |||
428 | * consistent. | 428 | * consistent. |
429 | */ | 429 | */ |
430 | if (add_align > dev_res->res->start) { | 430 | if (add_align > dev_res->res->start) { |
431 | resource_size_t r_size = resource_size(dev_res->res); | ||
432 | |||
431 | dev_res->res->start = add_align; | 433 | dev_res->res->start = add_align; |
432 | dev_res->res->end = add_align + | 434 | dev_res->res->end = add_align + r_size - 1; |
433 | resource_size(dev_res->res); | ||
434 | 435 | ||
435 | list_for_each_entry(dev_res2, head, list) { | 436 | list_for_each_entry(dev_res2, head, list) { |
436 | align = pci_resource_alignment(dev_res2->dev, | 437 | align = pci_resource_alignment(dev_res2->dev, |
437 | dev_res2->res); | 438 | dev_res2->res); |
438 | if (add_align > align) | 439 | if (add_align > align) { |
439 | list_move_tail(&dev_res->list, | 440 | list_move_tail(&dev_res->list, |
440 | &dev_res2->list); | 441 | &dev_res2->list); |
442 | break; | ||
443 | } | ||
441 | } | 444 | } |
442 | } | 445 | } |
443 | 446 | ||