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: 6244841 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 C25109F313 for ; Mon, 20 Apr 2015 23:31:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DEE3B20421 for ; Mon, 20 Apr 2015 23:31:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 42E5D20445 for ; Mon, 20 Apr 2015 23:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753384AbbDTXbB (ORCPT ); Mon, 20 Apr 2015 19:31:01 -0400 Received: from mail-ie0-f172.google.com ([209.85.223.172]:35438 "EHLO mail-ie0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753435AbbDTXa6 (ORCPT ); Mon, 20 Apr 2015 19:30:58 -0400 Received: by iejt8 with SMTP id t8so1794408iej.2 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=dytfn8/az6gxcBl4mr7+i7yG1M7Vmf3up1sep5YmWFsN6wb28gOggwpVQG5BO3jcWT SCeGE9EKRO0EC5gobY0Xaq2+SqEqyw4pqMmZZMXIcb0V6NcYbEYA4U3GqgZMeg3gvJgl LAUahGMHqRxggU2PK29gWI+s1wn+n9n9UrlKyk9LlWQAY3oEs9StI6QMdKA68J2JLFGc UvTgp0sove0S/gyzahLSOHXHR43wW3dXsHjgqZTFn+T5q/XBZsA/j70e0jNGvfUI5kdh aMJocnIRtT5yQUyHOdo9MSBHDyUsRJz3tVBLso9rdbv/mSbFt2EWqEl40hB4z2XBtcsw wqVA== X-Gm-Message-State: ALoCoQm7EtXy1Yqg6qqds1IkAqfIELeVCjk4oIlEpJwU2O6DfLka6n1eWtvmL9lBrEPFnNpFZOc5 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-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=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-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/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;