From patchwork Thu Mar 12 17:35:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 5997681 Return-Path: X-Original-To: patchwork-linux-acpi@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 8168E9F380 for ; Thu, 12 Mar 2015 17:35:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B8B402034F for ; Thu, 12 Mar 2015 17:35:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3EA8F2037C for ; Thu, 12 Mar 2015 17:35:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964840AbbCLRfg (ORCPT ); Thu, 12 Mar 2015 13:35:36 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:42840 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964788AbbCLRff (ORCPT ); Thu, 12 Mar 2015 13:35:35 -0400 Received: by oiav63 with SMTP id v63so15828801oia.9 for ; Thu, 12 Mar 2015 10:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=1OfsIssymnqsEZgUii+nLQDX8cTq1qCV6wUoQDODnv4=; b=SQ2l8eEjHknJlWNQQmhq3tit7DwBKW7rxfXmMY2cWwpRWqWy2B8lZpvNgHYIz1V3CS cBDIzQqNJ1BVYD0BM4o1owZCxZsQsjq5n+pDiC7heAKVPtPRBJ5zbPk3xPlH2jSmfrPf qRJ4f1DzQKs8jYv1wanAGGMDOgSTQc7+4RLj3CtODQAasF6GXOr5MqEHEPaS1Wc5XumS KzIY5tDJ/qyOH0yFc5k2VCUjZLSvV/zyxmPpPvnfZnTXXhggBqMjMwWcWoe9vggr8S49 RPUDAJkSVzkn/SfELhBWm3ciDnWMIW4iXjAruK5T0TXAzGC89D3DuqL0i9QSqR+v9HgH Drmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=1OfsIssymnqsEZgUii+nLQDX8cTq1qCV6wUoQDODnv4=; b=ZCWRp45O2Ft+xNtQt7iBOFDGU7V0B5hLYIPeaMc1vxpVw6k+tcxrh+D5PxoX59vO3+ kVturuQHNxSc/TDJ4AQV40F9tLpKUIGKz16xBNlsL8XfulMf4Bfhp8cEYFunmoUmvhJ1 U4qzaaq21jhzsh7oUTq8jPNKi4fnY0uJEpC/AorUa82PMveMIOf8MocF8S+G3NVyqSL3 3wYjmzjzeqCP4UtK0gLufKlDX4g6vxo8ldSdve7E6/V6h77yS+V+Jbk8JmbuacvykvyK MG5KKj7XViakXO7RIEWMf32vwcgNWGeebHm0aq/03jIWrRcAfFn39uzpb79SVNtKrXCt NNIw== X-Gm-Message-State: ALoCoQl9eNfd5r+TlYPqnL7zXVqFGiihUzmGg1gUqZGVk2gjIC0Vmr9AYGlyYot5Ta9nTw68KGug X-Received: by 10.60.48.35 with SMTP id i3mr35228422oen.39.1426181735256; Thu, 12 Mar 2015 10:35:35 -0700 (PDT) Received: from localhost ([146.7.4.76]) by mx.google.com with ESMTPSA id ut10sm4928177obc.20.2015.03.12.10.35.34 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 12 Mar 2015 10:35:34 -0700 (PDT) Subject: [PATCH v1 2/4] PCI: Mark invalid BARs as unassigned To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org Date: Thu, 12 Mar 2015 12:35:33 -0500 Message-ID: <20150312173533.1052.46464.stgit@bhelgaas-glaptop2.roam.corp.google.com> In-Reply-To: <20150312173201.1052.28341.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20150312173201.1052.28341.stgit@bhelgaas-glaptop2.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_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 If a BAR is not inside any upstream bridge window, or if it conflicts with another resource, mark it as IORESOURCE_UNSET so we don't try to use it. We may be able to assign a different address for it. Signed-off-by: Bjorn Helgaas --- drivers/pci/setup-res.c | 2 ++ 1 file changed, 2 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index b7c3a5ea1fca..232f9254c11a 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -120,6 +120,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource) if (!root) { dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n", resource, res); + res->flags |= IORESOURCE_UNSET; return -EINVAL; } @@ -127,6 +128,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource) if (conflict) { dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n", resource, res, conflict->name, conflict); + res->flags |= IORESOURCE_UNSET; return -EBUSY; }