From patchwork Wed Apr 30 01:11:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 4090121 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E505FBFF02 for ; Wed, 30 Apr 2014 01:12:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC05D2021F for ; Wed, 30 Apr 2014 01:12:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1702920218 for ; Wed, 30 Apr 2014 01:12:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754274AbaD3BM2 (ORCPT ); Tue, 29 Apr 2014 21:12:28 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:23298 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751540AbaD3BM2 (ORCPT ); Tue, 29 Apr 2014 21:12:28 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s3U1CCth032539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 30 Apr 2014 01:12:13 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s3U1C9Qm016559 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 30 Apr 2014 01:12:09 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s3U1C8KZ002568; Wed, 30 Apr 2014 01:12:08 GMT Received: from linux-siqj.site (/10.132.126.31) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 29 Apr 2014 18:12:07 -0700 From: Yinghai Lu To: Bjorn Helgaas Cc: Benjamin Herrenschmidt , Wei Yang , Gavin Shan , Jack Morgenstein , amirv@mellanox.com, Or Gerlitz , eugenia@mellanox.com, Guo Chao , talal@mellanox.com, linux-pci@vger.kernel.org, Yinghai Lu Subject: [PATCH] PCI: don't update bridge resource flags according to children Date: Tue, 29 Apr 2014 18:11:55 -0700 Message-Id: <1398820315-27425-1-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.4.5 X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After PCI: Try best to allocate pref mmio 64bit above 4g We don't need to check if children support 64bit, and update bridge resource flags anymore. As the new code check size and assign according exact type. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/pci/setup-bus.c =================================================================== --- linux-2.6.orig/drivers/pci/setup-bus.c +++ linux-2.6/drivers/pci/setup-bus.c @@ -926,7 +926,6 @@ static int pbus_size_mem(struct pci_bus int order, max_order; struct resource *b_res = find_free_bus_resource(bus, mask | IORESOURCE_PREFETCH, type); - unsigned int mem64_mask = 0; resource_size_t children_add_size = 0; if (!b_res) @@ -936,9 +935,6 @@ static int pbus_size_mem(struct pci_bus max_order = 0; size = 0; - mem64_mask = b_res->flags & IORESOURCE_MEM_64; - b_res->flags &= ~IORESOURCE_MEM_64; - list_for_each_entry(dev, &bus->devices, bus_list) { int i; @@ -980,7 +976,6 @@ static int pbus_size_mem(struct pci_bus aligns[order] += align; if (order > max_order) max_order = order; - mem64_mask &= r->flags & IORESOURCE_MEM_64; if (realloc_head) children_add_size += get_res_add_size(realloc_head, r); @@ -1005,7 +1000,7 @@ static int pbus_size_mem(struct pci_bus } b_res->start = min_align; b_res->end = size0 + min_align - 1; - b_res->flags |= IORESOURCE_STARTALIGN | mem64_mask; + b_res->flags |= IORESOURCE_STARTALIGN; if (size1 > size0 && realloc_head) { add_to_list(realloc_head, bus->self, b_res, size1-size0, min_align); dev_printk(KERN_DEBUG, &bus->self->dev, "bridge window "