Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753849AbbGNWwD (ORCPT ); Tue, 14 Jul 2015 18:52:03 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:35243 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753133AbbGNWr6 (ORCPT ); Tue, 14 Jul 2015 18:47:58 -0400 From: Yinghai Lu To: Bjorn Helgaas , David Miller , Benjamin Herrenschmidt , Wei Yang , TJ , Yijing Wang Cc: Andrew Morton , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Yinghai Lu Subject: [PATCH v2 28/49] PCI: Allow optional only io resource must size to be 0 Date: Tue, 14 Jul 2015 15:46:59 -0700 Message-Id: <1436914040-13206-29-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1436914040-13206-1-git-send-email-yinghai@kernel.org> References: <1436914040-13206-1-git-send-email-yinghai@kernel.org> X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1589 Lines: 45 When there is no child device under the non hotplug bridge, We can use 0 for must size, and do not use old size as must size. When there is child device, size will not be 0. when the bridge is not hotplug, min_size will not be 0. So they will still honor the old size as must size. Signed-off-by: Yinghai Lu --- 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 969a0b1..0420d27 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1242,8 +1242,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) @@ -1259,7 +1260,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/