From patchwork Mon Apr 20 23:30:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 6244831 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 27A4C9F313 for ; Mon, 20 Apr 2015 23:31:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40DF220435 for ; Mon, 20 Apr 2015 23:31:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4145420268 for ; Mon, 20 Apr 2015 23:31:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753479AbbDTXbA (ORCPT ); Mon, 20 Apr 2015 19:31:00 -0400 Received: from mail-ig0-f182.google.com ([209.85.213.182]:34952 "EHLO mail-ig0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753384AbbDTXa6 (ORCPT ); Mon, 20 Apr 2015 19:30:58 -0400 Received: by igbyr2 with SMTP id yr2so73572129igb.0 for ; Mon, 20 Apr 2015 16:30:57 -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:user-agent:mime-version :content-type:content-transfer-encoding; bh=WVqLcv/5D3DE+DOjAokUkr9GAyDQ2gZpxTdkc/TPZWQ=; b=jjBn7Tn9ml6/OIVUTBJb/WM7VKZ/pGL/Cg89qqBCAaOX1ErAbl6Guad1rzLPWLMvgz chpacRpzFYJDlT5uSTFKxCC1Qx0/ZXzmuw71N+d/e1M3oJ/4kkGgejDEgGKct/LA+buK RsOSL46Qih5QZZGUys4MkDSmLA84CJ8LW4F/vjmWdn/kIEqxoQmP8wU8ymrqUp+SW20i DcGB+krpFxYHXkVascOyPF7/8hFSqLnBLWOixLbOCwKpv3i2MH03WCJ5+oLD5aOgVmp3 0idLMEQdtLzajkozCfMKsoSH5a/2JznLWzOXCK3dCTy7yoFeysPS8r/XMN6bov+PpD7e ocFg== 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:user-agent :mime-version:content-type:content-transfer-encoding; bh=WVqLcv/5D3DE+DOjAokUkr9GAyDQ2gZpxTdkc/TPZWQ=; b=ebySdxRupMS/XMoEElNrdz7XYbm2V7wlJ6cxPa3nLNiVvdVyCAiXPYAz8jHeAh5ype SxhXe0c/T/Urh/Fnef1mC0tkJlyMZBpphdS+joUC6X3vmlSCz5l+XY7bmuYN4M9GQhgH sOuYb9cE5XWJ1GQvlhXB3QRM1e7/7wDWEQK+TXP1nIAVFAJQvm4JxiZbDzsJJTcaMwkA cCpRxQMnKTZihoWKve0q+CxUjg6D6j+UtWtRFzKSk5hgtPN4lAyTRpPSRCpx47RysTJq NmRA6L9NS1++StMl7mDdA33gZ22b7MTW4cYh/sKpe+W7diQzwz3+8aiPjqG2YuYueeyy 7NBg== X-Gm-Message-State: ALoCoQlLZatP8tIhXTJSq5Rm3LEgdf9Ykd+7CLY4GDhS8D3sq4xHjsKVO9K7oXcd0fuxA8fs3zSo X-Received: by 10.43.39.208 with SMTP id tn16mr266287icb.27.1429572657109; Mon, 20 Apr 2015 16:30:57 -0700 (PDT) Received: from localhost ([69.71.1.1]) by mx.google.com with ESMTPSA id p74sm73727ioe.27.2015.04.20.16.30.56 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 20 Apr 2015 16:30:56 -0700 (PDT) Subject: [PATCH] ia64/PCI: Treat all host bridge Address Space Descriptors (even consumers) as windows To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org, Tony Luck , linux-ia64@vger.kernel.org, Jiang Liu , "Rafael J . Wysocki" Date: Mon, 20 Apr 2015 18:30:55 -0500 Message-ID: <20150420233055.20866.87460.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 Prior to c770cb4cb505 ("PCI: Mark invalid BARs as unassigned"), if we tried to claim a PCI BAR but could not find an upstream bridge window that matched it, we complained but still allowed the device to be enabled. c770cb4cb505 broke devices that previously worked (mptsas and igb in the case Tony reported, but it could be any devices) because it marks those BARs as IORESOURCE_UNSET, which makes pci_enable_device() complain and return failure: igb 0000:81:00.0: can't enable device: BAR 0 [mem size 0x00020000] not assigned igb: probe of 0000:81:00.0 failed with error -22 The underlying cause is an ACPI Address Space Descriptor for a PCI host bridge window that is marked as "consumer". This is a firmware defect: resources that are produced on the downstream side of a bridge should be marked "producer". But rejecting these BARs that we previously allowed is a functionality regression, and firmware has not used the producer/consumer bit consistently, so we can't rely on it anyway. Stop checking the producer/consumer bit, and assume all bridge Address Space Descriptors are for bridge windows. Note that this change does not affect I/O Port or Fixed Location I/O Port Descriptors, which are commonly used for the [io 0x0cf8-0x0cff] config access range. That range is a "consumer" range and should not be treated as a window. Fixes: c770cb4cb505 ("PCI: Mark invalid BARs as unassigned") Link: https://bugzilla.kernel.org/show_bug.cgi?id=96961 Reported-and-tested-by: Tony Luck Signed-off-by: Bjorn Helgaas Acked-by: Rafael J. Wysocki --- arch/ia64/pci/pci.c | 5 +---- 1 file changed, 1 insertion(+), 4 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/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 48cc65705db4..d4e162d35b34 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -240,15 +240,12 @@ static acpi_status resource_to_window(struct acpi_resource *resource, * We're only interested in _CRS descriptors that are * - address space descriptors for memory or I/O space * - non-zero size - * - producers, i.e., the address space is routed downstream, - * not consumed by the bridge itself */ status = acpi_resource_to_address64(resource, addr); if (ACPI_SUCCESS(status) && (addr->resource_type == ACPI_MEMORY_RANGE || addr->resource_type == ACPI_IO_RANGE) && - addr->address.address_length && - addr->producer_consumer == ACPI_PRODUCER) + addr->address.address_length) return AE_OK; return AE_ERROR;