From patchwork Wed Apr 30 01:00:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 4090061 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 2867CBFF02 for ; Wed, 30 Apr 2014 01:01:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 553072021B for ; Wed, 30 Apr 2014 01:01:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 773552011E for ; Wed, 30 Apr 2014 01:01:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756515AbaD3BAn (ORCPT ); Tue, 29 Apr 2014 21:00:43 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:43623 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755421AbaD3BA2 (ORCPT ); Tue, 29 Apr 2014 21:00:28 -0400 Received: by mail-ie0-f170.google.com with SMTP id rd18so1140409iec.29 for ; Tue, 29 Apr 2014 18:00:27 -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=9x3RSSr20jBUFEfpdMrOjmQXb7bQlMiNl1mt4ocWKMo=; b=Hfhp5pnJFyKeaFv3cXhnRbGCMCD1Cbhmq1oaKdBGR/bRwV27eq62MjPHpOBRazycp8 i08VzgO6xebsIM66MzQftNBSzhJSsVhV7f30cpN4kHtL747+uJ6Mh4vVTRwciUYMgd0s 1KyrFIiZa1EsxtHzzZbQ+W5k4MgUsBTfdNNQbB8YMGEiZt/DZt3pm1hV2P/+qhUpiWaU TghH+C7i4csZIdQtfozJOM7mWsfIRRqnZ+REDv87rqXV4kLPzQCVaPg/3mI3z2Bew3+B JSYuvndH3gIaFrYadHIXjQTkfLfs1B1ftVEEdF7nfxZdqcZMyodnLa2GptYMSY3GKWUR DHDg== 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=9x3RSSr20jBUFEfpdMrOjmQXb7bQlMiNl1mt4ocWKMo=; b=DKRQ9KhUu2vSjmCd3gmOC8pwtNEpIAU+d3vdIQ5QFOF1CxYqH6qcvKXeYv17Jb0o1h CjCKDz4SNTPH96XGD8TZ5RJegqJ5WQw2daXBaIQe9l8Ybog9CZ/xhem1k7sJn/5/aCKM Gd1QB8PMAnEG/vYbMPm/TNtDQqO4ANtPW3SLUjrNfvEyH/tptQ1B3gQX4mv5Kf0wzfiY 5zWImuSxKIwbeUpPJorrBo0051WbhN370j8SrANCRQA8HebgAQHqloFOjwylBTq0ebb4 /5BlAO1FfwWzuYmfHPbhoSQNNSf5BVu1KrrcZnwCxU8ZDebIR/pUXOjPEvwBGW7RMca+ oZuA== X-Gm-Message-State: ALoCoQmhEBIYveRMNeBgrOeprcH0+Z98kHpG/P12Z4W68aQFI47y19sUIogk66+DioeON+wx4eV1mqFgPdSd6tAQcEYqTH5sAAP+h0iD5Kl38/AS0UeAnlkpxnobzWR1yFKwrLBCzCEBSPYpdRM4Ws/gBxzyCRy5pA204Og/qCRAwjdVP9XKGYuubxkA/hxHoq3iaikvEcxDfi/R+WvUoxOFvy/85B7fAhSah/zUWnMZ0udGICTPp/o= X-Received: by 10.50.30.170 with SMTP id t10mr34761932igh.7.1398819627229; Tue, 29 Apr 2014 18:00:27 -0700 (PDT) Received: from localhost ([172.16.51.53]) by mx.google.com with ESMTPSA id vc5sm104230igb.3.2014.04.29.18.00.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 29 Apr 2014 18:00:26 -0700 (PDT) Subject: [PATCH 7/7] PCI: Don't add disabled subtractive decode bus resources To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org Date: Tue, 29 Apr 2014 19:00:25 -0600 Message-ID: <20140430010025.13138.79382.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140430005642.13138.99577.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140430005642.13138.99577.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=-7.4 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 For a subtractive decode bridge, we previously added and printed all resources of the primary bus, even if they were not valid. In the example below, the bridge 00:1c.3 has no windows enabled, so there are no valid resources on bus 02. But since 02:00.0 is subtractive decode bridge, we add and print all those invalid resources, which don't really make sense: pci 0000:00:1c.3: PCI bridge to [bus 02-03] pci 0000:02:00.0: PCI bridge to [bus 03] (subtractive decode) pci 0000:02:00.0: bridge window [??? 0x00000000 flags 0x0] (subtractive decode) Add and print the subtractively-decoded resources only if they are valid. There's an example in the dmesg log attached to the bugzilla below (but this patch doesn't fix the bug reported there). Link: https://bugzilla.kernel.org/show_bug.cgi?id=73141 Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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/probe.c b/drivers/pci/probe.c index 3bc149b848a8..966514010974 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -475,7 +475,7 @@ void pci_read_bridge_bases(struct pci_bus *child) if (dev->transparent) { pci_bus_for_each_resource(child->parent, res, i) { - if (res) { + if (res && res->flags) { pci_bus_add_resource(child, res, PCI_SUBTRACTIVE_DECODE); dev_printk(KERN_DEBUG, &dev->dev,