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: 5997651 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7BCBCBF90F for ; Thu, 12 Mar 2015 17:35:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CF7020379 for ; Thu, 12 Mar 2015 17:35:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C5C432034F for ; Thu, 12 Mar 2015 17:35:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754151AbbCLRfa (ORCPT ); Thu, 12 Mar 2015 13:35:30 -0400 Received: from mail-oi0-f44.google.com ([209.85.218.44]:46167 "EHLO mail-oi0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754032AbbCLRf3 (ORCPT ); Thu, 12 Mar 2015 13:35:29 -0400 Received: by oiga141 with SMTP id a141so15892276oig.13 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=Vy6Yziqfdu9EEndicwicsNu+MWmXiVQyq6rG/QAirmDIihASwuKXYsIdsSZa3YBtVp fQPbTsJiOEj+XJuCRglvayPdWLONvhckRokOZDVthPuk7BxYSeekLIovtxDMfHzZHfm9 RPnSTeIy16wn6dsSJR7ye5gCTqRB7bEVex0wmwi6qJyMb7Gd0/Hw2vuoYg/K8QBMHERq P89aWlBa3w28c+gK0ErUjJevBGhZ2fW258LiwDlEnG2EfNRsw+Y3l3uL+MlypXR3Pm+B /8Vu96HhzI01VYjQXR+w46JQuxQnuZJkYGmizgHzUUvsg4bZdn0k6O5fMechZ2lST0d8 +/Mw== X-Gm-Message-State: ALoCoQnnt5JF2hlzC2FM83EPzqmRYDk08Nq7textKVtsmamc1AaHZAipIofxYZ8fnB94vBoyEIqs 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-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=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-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/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;