From patchwork Wed Feb 26 19:37:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 3728171 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 7665DBF13A for ; Wed, 26 Feb 2014 19:41:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C7AD201F9 for ; Wed, 26 Feb 2014 19:41:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CCEE201CD for ; Wed, 26 Feb 2014 19:41:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754134AbaBZThz (ORCPT ); Wed, 26 Feb 2014 14:37:55 -0500 Received: from mail-ie0-f179.google.com ([209.85.223.179]:62285 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754104AbaBZThx (ORCPT ); Wed, 26 Feb 2014 14:37:53 -0500 Received: by mail-ie0-f179.google.com with SMTP id to1so1118976ieb.38 for ; Wed, 26 Feb 2014 11:37:53 -0800 (PST) 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=iWT+BzLMSQat4HYhEWDjlq5ZkZOujX6lxShPpUsMxoY=; b=Um+yPDtpTA+cSqMEfBZiauJOWfH/b7Q2LBx2vUsKpjfjnR69tZGWEu2xmgHOgzilXf C7reVe6GTKHiU0lFGczi3+6P5tvfv1xTnoEYlZOAluas3F/vsfsxk1iwPf/7bq1N9DMo BrJatjMyda4EIZOAf9EJS4M07JsguTqno3ykVuTZqTZs63h/wZ8PJMK0epcHEkNZ8BU2 /aJbS6YvlVkllJtJ8xRCXUjnZ4tQp9H2okZqJpdgF6w9law4UO9gSQr+n6eDTATvRkYL nH5jmDIQO+E+WC3usg3ABKOAzNbm415ZmZf5rAe0Lpxkl+rzowFboqnDzBBQg5PrJBcv lBxw== 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=iWT+BzLMSQat4HYhEWDjlq5ZkZOujX6lxShPpUsMxoY=; b=Me6s78pEIkw6xA3dYWhYT3kbF8BL8+dAWqRYUUJC393DjXFgb4o0oFSlfE+1joAMGU wy3Tdr1tdMARy9GsqCuKjsN3oGMKxLjKYEdtLIzH+idG1hVKU6fvCsaNhFq+THc1xE1b mA7YzBoknSzELHsjYoKFkT1/4533l+mQt0HxdK9tNN5o1JPE9e107dG52wHcCEspGcyg FQzGlEwsUdihzScFnv2hNLesUXuILpycHobbOfgNg4X7pxNfKbNe4wQAJckGVF3beu/v GzPJutInCVVppz2dmkiJGt5fvFou5qHgZ9awp5ZV48jOcnPKPhqzTCqkJ99XhzDeEvaj 8lvQ== X-Gm-Message-State: ALoCoQmlniPtJ296O546kfcjzhOmSMKaNQUmTwR9H+a3ggnMFza3WHd6KSowAQfk5yugkbD3Uh6osWPUCcKuZLRyinmdwqyyhDyQg39zA8tUWmzl7oju9WkL33u26N8X7M8KYfsGVomz55mN7R35ELiIgifOx3eA0UYA0MkrqKpPXD5aIS+Q55OelKfcINuAU5voux4zA35wTy9fWCMw2Y/AfI8ycpb0PpWCzNvoIG3HHr/0UxHfl6A= X-Received: by 10.42.232.206 with SMTP id jv14mr1176560icb.52.1393443473017; Wed, 26 Feb 2014 11:37:53 -0800 (PST) Received: from localhost ([172.16.49.60]) by mx.google.com with ESMTPSA id mi2sm1666719igb.3.2014.02.26.11.37.52 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Feb 2014 11:37:52 -0800 (PST) Subject: [PATCH 7/9] PCI: Don't try to claim IORESOURCE_UNSET resources To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org Date: Wed, 26 Feb 2014 12:37:51 -0700 Message-ID: <20140226193751.10125.5434.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140226192614.10125.68711.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140226192614.10125.68711.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 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, 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 If the IORESOURCE_UNSET bit is set, it means we haven't assigned an address yet, so don't try to claim the region. Also, make the error messages more uniform and add info about which BAR is involved. Signed-off-by: Bjorn Helgaas --- drivers/pci/setup-res.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 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 diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 7f7652176fc5..6e443135ba24 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -111,18 +111,23 @@ int pci_claim_resource(struct pci_dev *dev, int resource) struct resource *res = &dev->resource[resource]; struct resource *root, *conflict; + if (res->flags & IORESOURCE_UNSET) { + dev_info(&dev->dev, "can't claim BAR %d %pR: no address assigned\n", + resource, res); + return -EINVAL; + } + root = pci_find_parent_resource(dev, res); if (!root) { - dev_info(&dev->dev, "no compatible bridge window for %pR\n", - res); + dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n", + resource, res); return -EINVAL; } conflict = request_resource_conflict(root, res); if (conflict) { - dev_info(&dev->dev, - "address space collision: %pR conflicts with %s %pR\n", - res, conflict->name, conflict); + dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n", + resource, res, conflict->name, conflict); return -EBUSY; }