From patchwork Tue Oct 20 23:04:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 7453701 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 414EC9F37F for ; Tue, 20 Oct 2015 23:08:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 752A3208BB for ; Tue, 20 Oct 2015 23:08:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 89C72208B9 for ; Tue, 20 Oct 2015 23:08:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753865AbbJTXHc (ORCPT ); Tue, 20 Oct 2015 19:07:32 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:34775 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753209AbbJTXEu (ORCPT ); Tue, 20 Oct 2015 19:04:50 -0400 Received: by iow1 with SMTP id 1so39458013iow.1; Tue, 20 Oct 2015 16:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zj4UK20BWGHLSzP7DwnfJn+5tFw0CgUIQIUv3/j12N8=; b=ghYzHlzOaZ30Uc2HZZdXLglCo5dRO29OcQhwty84OpPpxtV9PtnFwNu8Rtiv9DnuN2 QGXtrsIdEVqLMUKF0xTfvZTjLyH6RY8710bCo2CIRaeMnw6jWRtag9GRYGy1REtZCyK3 +rQBonXxJMVq5DT5GvinXHH5X7PUcwC5+uppfLrcUU3F2nZk0nfO647x4qXAxJJOz9cI Pi9CBZSFFo7AOctE+QihFkOP5aetRvn6aVguagJArnv7VOWop0TZVfg993R4OEnzJAuX NvDCt1vlYhsAaKxeRoIYXwcjPSEEVeQT7/u5fx0b4ksTKEXQ6seMksYRwIdLGPRUt2Yh 7y5g== X-Received: by 10.107.151.208 with SMTP id z199mr6956064iod.189.1445382289684; Tue, 20 Oct 2015 16:04:49 -0700 (PDT) Received: from dl.caveonetworks.com (64.2.3.194.ptr.us.xo.net. [64.2.3.194]) by smtp.gmail.com with ESMTPSA id 79sm2464041iok.35.2015.10.20.16.04.46 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 20 Oct 2015 16:04:48 -0700 (PDT) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id t9KN4jxU002439; Tue, 20 Oct 2015 16:04:45 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id t9KN4j9L002438; Tue, 20 Oct 2015 16:04:45 -0700 From: David Daney To: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Bjorn Helgaas , "Michael S. Tsirkin" , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , linux-api@vger.kernel.org, "Sean O. Stalley" , yinghai@kernel.org, rajatxjain@gmail.com, gong.chen@linux.intel.com Cc: David Daney Subject: [PATCH v6 1/5] PCI: Handle IORESOURCE_PCI_FIXED when sizing resources. Date: Tue, 20 Oct 2015 16:04:38 -0700 Message-Id: <1445382282-2396-2-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1445382282-2396-1-git-send-email-ddaney.cavm@gmail.com> References: <1445382282-2396-1-git-send-email-ddaney.cavm@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: David Daney The new Enhanced Allocation (EA) capability support (patches to follow) creates resources with the IORESOURCE_PCI_FIXED set. Since these resources cannot be relocated or resized, their alignment is not really defined, and it is therefore not specified. This causes a problem in pbus_size_mem() where resources with unspecified alignment are disabled. So, in pbus_size_mem() skip IORESOURCE_PCI_FIXED resources, instead of disabling them. Acked-by: Sean O. Stalley Signed-off-by: David Daney --- 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 508cc56..4dfef10 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1037,9 +1037,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, struct resource *r = &dev->resource[i]; resource_size_t r_size; - if (r->parent || ((r->flags & mask) != type && - (r->flags & mask) != type2 && - (r->flags & mask) != type3)) + if (r->parent || (r->flags | IORESOURCE_PCI_FIXED) || + ((r->flags & mask) != type && + (r->flags & mask) != type2 && + (r->flags & mask) != type3)) continue; r_size = resource_size(r); #ifdef CONFIG_PCI_IOV