Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1242825
| From | Yinghai Lu <yinghai@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v7 50/60] PCI: Allow bridge optional only io port resource required size to be 0 |
| Date | 2015-10-09 00:50 +0200 |
| Message-ID | <qhsaC-kH-7@gated-at.bofh.it> (permalink) |
| References | <qhrex-7rq-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
When there is no child device under the non hotplug bridge,
We can use 0 for required size, and do not use old size as required size.
That will save some io port range for other bridges, as BIOS could do
some partial assign, and we want to use those not used io port range.
When there is child device, size will not be 0.
when the bridge supports hotplug, min_size will not be 0.
So they will still honor the old size as required size.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
drivers/pci/setup-bus.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index a6eea60..bbc10d8 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1230,8 +1230,9 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
size = size_aligned_for_isa(size);
size += size1;
- size0 = calculate_size(size, min_size,
- resource_size(b_res), min_align);
+ if (size || min_size)
+ size0 = calculate_size(size, min_size,
+ resource_size(b_res), min_align);
sum_add_size = size_aligned_for_isa(sum_add_size);
sum_add_size += sum_add_size1;
if (sum_add_size < min_sum_size)
@@ -1247,7 +1248,7 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
return;
}
- b_res->start = min_align;
+ b_res->start = size0 ? min_align : 0;
b_res->end = b_res->start + size0 - 1;
b_res->flags |= IORESOURCE_STARTALIGN;
if (size1 > size0 && realloc_head) {
--
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 | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v7 00/60] PCI: Resource allocation cleanup for v4.4 Yinghai Lu <yinghai@kernel.org> - 2015-10-09 00:00 +0200
[PATCH v7 21/60] PCI: Get new realloc size for bridge for last try Yinghai Lu <yinghai@kernel.org> - 2015-10-09 00:00 +0200
[PATCH v7 03/60] sparc/PCI: Unify pci_register_region() Yinghai Lu <yinghai@kernel.org> - 2015-10-09 00:00 +0200
Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region() Khalid Aziz <khalid.aziz@oracle.com> - 2015-10-09 18:20 +0200
[PATCH v7 42/60] PCI: Move saved required resource list out of required+optional assigning Yinghai Lu <yinghai@kernel.org> - 2015-10-09 00:10 +0200
[PATCH v7 58/60] PCI: Introduce resource_disabled() Yinghai Lu <yinghai@kernel.org> - 2015-10-09 00:50 +0200
Re: [v7,58/60] PCI: Introduce resource_disabled() Michael Ellerman <mpe@ellerman.id.au> - 2015-10-13 11:50 +0200
[PATCH v7 50/60] PCI: Allow bridge optional only io port resource required size to be 0 Yinghai Lu <yinghai@kernel.org> - 2015-10-09 00:50 +0200
[PATCH v7 28/60] PCI: Don't add too much optional size for hotplug bridge MMIO Yinghai Lu <yinghai@kernel.org> - 2015-10-09 00:50 +0200
csiph-web