From patchwork Thu Mar 12 17:35:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 5997661 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 0DB379F380 for ; Thu, 12 Mar 2015 17:35:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 410DC2034F for ; Thu, 12 Mar 2015 17:35:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F1392037C for ; Thu, 12 Mar 2015 17:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932350AbbCLRfa (ORCPT ); Thu, 12 Mar 2015 13:35:30 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:34475 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754105AbbCLRf3 (ORCPT ); Thu, 12 Mar 2015 13:35:29 -0400 Received: by oiba3 with SMTP id a3so6203716oib.1 for ; Thu, 12 Mar 2015 10:35:28 -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=/yVR50fM5GO5OhP5M9o3PVFgL65gVXv+lJ5MEi0QSlI=; b=KNdX7iKjkckgppwhdS7WT1NK+cQsRfmhOzFcD0aSX5tn4AsklpZd4tGzlWai9kN/ms wconpUkn62npOU3MCNvnITd5FhVrRhOYn1SXK5Jo4/LsEM6pprhYYrrHICR3NTyIENVl CGSH41NL6ZGhLcla/V4HmZbLLGcGtKI43JV9JVifICF67+vddZPHuLEBXxA631eh2rt5 lqHmVG+BD9WsetzTJ56G0P6Xu+XdU5qKXlh99ZUCQlqIdcrXJGLdj9DAXIB/mbP1l+A8 CWmwqQuysiP+Z4SGQbgAWf+Jdxj2d5VJD1TmEJbst9vwtEailRq0Q0mY8a0o74XkJaLx LrpQ== 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=/yVR50fM5GO5OhP5M9o3PVFgL65gVXv+lJ5MEi0QSlI=; b=bSnLJCASVuECMvKDFDRR0ubds6IRcsLkZNp7oLuocIRFFFrKwvdX1XPPFRMSsEyOY4 OEMzMQUBtO4QnzR0HS6FEHfe+K/0y1wXqGYvKu30X4LD6NqKnN4wXqtwj7my91I2SujL q4WHczHnEzwq5ysf+skQTUpsSqRqpaHGvriaz7KfGP0glJtSvJ0DPT0Q2qF63K+1/hj4 F36k/lBsXUxpZiCCWYeJbhI3QicQ8Nc0mZnbV3Gm2KLQl39thGUmtNAMu/isGHFWxmrQ VVwR1A5Qm0Jd4jivSX6jPJs4atk+FoyOLc6ncIN5hJzPTvlScAs5vww81EmuQqLkYmwu Ag/Q== X-Gm-Message-State: ALoCoQlH+s312R0KwMYfPuiywOYTxwQmhAqpkptINNR+zQCAjG2T9FpTCxdnYjnVI5wSj7adkT67 X-Received: by 10.202.83.11 with SMTP id h11mr33439837oib.97.1426181728408; Thu, 12 Mar 2015 10:35:28 -0700 (PDT) Received: from localhost ([146.7.4.76]) by mx.google.com with ESMTPSA id jg4sm4931660obb.15.2015.03.12.10.35.27 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 12 Mar 2015 10:35:27 -0700 (PDT) Subject: [PATCH v1 1/4] PNP: Don't check for overlaps with unassigned PCI BARs To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org Date: Thu, 12 Mar 2015 12:35:26 -0500 Message-ID: <20150312173526.1052.59512.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-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,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 0509ad5e1a7d ("PNP: disable PNP motherboard resources that overlap PCI BARs"), we disable and warn about PNP resources that overlap PCI BARs. But we assume that all PCI BARs are valid, which is incorrect, because a BAR may not have any space assigned to it. In that case, we will not enable the BAR, so no other resource can conflict with it. Ignore PCI BARs that are unassigned, as indicated by IORESOURCE_UNSET. Firmware often leaves PCI BARs unassigned, containing zero. Zero is a valid BAR value, so we can't just check for that, but the PCI core can set IORESOURCE_UNSET when it detects an unassigned BAR by other means. This should get rid of many of the annoying messages like this: pnp 00:00: disabling [io 0x0061] because it overlaps 0001:05:00.0 BAR 0 [io 0x0000-0x00ff] Signed-off-by: Bjorn Helgaas --- drivers/pnp/quirks.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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/pnp/quirks.c b/drivers/pnp/quirks.c index ebf0d6710b5a..943c1cb9566c 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -246,13 +246,16 @@ static void quirk_system_pci_resources(struct pnp_dev *dev) */ for_each_pci_dev(pdev) { for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { - unsigned long type; + unsigned long flags, type; - type = pci_resource_flags(pdev, i) & - (IORESOURCE_IO | IORESOURCE_MEM); + flags = pci_resource_flags(pdev, i); + type = flags & (IORESOURCE_IO | IORESOURCE_MEM); if (!type || pci_resource_len(pdev, i) == 0) continue; + if (flags & IORESOURCE_UNSET) + continue; + pci_start = pci_resource_start(pdev, i); pci_end = pci_resource_end(pdev, i); for (j = 0;