From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A676C433B4 for ; Tue, 11 May 2021 09:51:02 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 638D861288 for ; Tue, 11 May 2021 09:51:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 638D861288 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=zX1b7jdORy+UweO0nEmcyDJaRfiL63BSNBA7EeP/Tqw=; b=joR4IoP77EPF6Nu+2sJ4NKSfsj WZp1+f88OphyCb8WINH6oHzhUXhSjj7hq1cQ0pE/7whmhN/NBdX/cqoHopR4Ej8MtnLLOl6Y4YZsl AXU1U3ekgKXUsCZAfFylo3wseOqbjCOWfgrCsF1yX3vxygyj+RVWKYaQPnnAsWdw04pq7mWpYaeOV 1Ph0YS0MahP2BkpHrq+oelWsx3k31XkPwRGcuOgmrrfddGtsrsVq8PIstBpRZAL80T6u7vwXyQcjp 6UAAEqGcCLNOwqNCiEzFG/yk7pndq5f9Rld4lheO48CSa5dcQUM1fkrRqaBJm+1z+BjjRbkI78dhC uCC56wlw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgP19-00GlGk-EE; Tue, 11 May 2021 09:49:32 +0000 Received: from [2607:7c80:54:e::133] (helo=bombadil.infradead.org) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgFVz-00FukZ-E1 for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 23:40:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=4x0vN9DJqs7gJDwDfxyEg064VHqNhSWYWI838BdyA6Y=; b=0abaniBE3VOUzD55RQSOwRztT1 JWA84ub2UMnpb8uaaoWEkwZJxNtMj6/lB2Tt+V8Vde5qvUvXAl40CiulD0zvj/eUZknn9Vitx/Mr5 GjdGUQZzquRU9etrbEjA3T3GxkpnkA/n8CFc/MBi/ZOt69pnADT6lO4d1MvnAj1JuiGDTdJw69/ex 1Uv9gd9fRIt0wmgH18b6FQ1vm0L8T0r5PAy9YrzRhWKCYf3Vze68kowdGz/hJVJL88nmugyD8cteG 1h+qdy6zhHXKvV/B0L4xvk90iJcKyj4aWgtduE1NxNJn9J8jqD2HNmSJBEqcJG6FeZjzJWXDYrorx j/G6epbQ==; Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgFVw-009Bwt-Ej for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 23:40:41 +0000 Received: by mail-lj1-x233.google.com with SMTP id p12so22914814ljg.1 for ; Mon, 10 May 2021 16:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4x0vN9DJqs7gJDwDfxyEg064VHqNhSWYWI838BdyA6Y=; b=bv+qY0q2mO9tHNg79PZMj8hkZ9C8rxnsgQTKmo/G7H1nlKCoAMKWz7Bw0X25Cou4jU IknSAu6Jq8pZ0M5/91i+w6wG4XX8btm6dMQ4QFmGR0GTRhQmZhLliRXUAc68CBtoLBMI ZLLX7kJV2Ld+if87BOnwOGqel6FQy3k1Knai6gSjVXUWyvNVwKauZp1dvovV0JEEoyP4 mhjO8CFhNjZcmPzwVRv/e7dLqnoxbrqGKHCwXpJQFAX+vMR6ajjmjV5EVsLMhxyVDc+d 5LxZ/932j4mszXXmeMlynvNsST6XOZQer9Fkk/r4ycNUG4aa4q957Zd9eyp6g63OCS/C 6LoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4x0vN9DJqs7gJDwDfxyEg064VHqNhSWYWI838BdyA6Y=; b=T2lKjL4dB4XAvoOo4B4XLqrFfA0PlG+z6dIoECVt2EsTIbe0/WofUL9dYJhQKDczp7 GUi+jHbIPnvTx2VvUNnpqnntFzK6FdueGZA5XiS+dQGXFSK1rBzI9J6KYUdx7WQf3PxV HgF6CWbPZg9M+w/oWOjVg/pztrfcggLtHeL4CBep7oo0eqpAwaDvbX9C6jwd+AsyIrEY slwns0TClaB2GlYBd4gpVHn5SJ3gCs8se2x1OgVMuMADs54ImJxbJoGHwo72hAV6qm1X p1wl6WBa0ERauhSMj87QfERBxRZC/JIfN/ruH/YX+5s1gjZERiz5IORw2Bz77wS1JT+0 zL6g== X-Gm-Message-State: AOAM533ZPWF7mgjvi2B40Im8nxjmHwlaTUz/tEANzjYoQMVpKSZ5V34o HYQ82fiUvH9PmkIPK3M1C+w= X-Google-Smtp-Source: ABdhPJzQrUm5bDZEPSU5ieS3hk7r8BouKV4qqzcZDrrRCosV82J5oK0C5TjXP9oalqSbpSSxLWqE+Q== X-Received: by 2002:a2e:9b82:: with SMTP id z2mr19980857lji.366.1620690038713; Mon, 10 May 2021 16:40:38 -0700 (PDT) Received: from xws.localdomain ([37.58.58.229]) by smtp.gmail.com with ESMTPSA id z12sm2398926lfe.195.2021.05.10.16.40.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 16:40:38 -0700 (PDT) From: Maximilian Luz To: Bjorn Helgaas Cc: Maximilian Luz , "Rafael J. Wysocki" , Len Brown , Catalin Marinas , Will Deacon , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH] Revert "arm64: PCI: Exclude ACPI "consumer" resources from host bridge windows" Date: Tue, 11 May 2021 01:40:20 +0200 Message-Id: <20210510234020.1330087-1-luzmaximilian@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_164040_531779_9D440760 X-CRM114-Status: GOOD ( 15.55 ) /bin/ln: failed to access 'reaver_cache/texts/20210510_164040_531779_9D440760': No such file or directory X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_164040_531779_9D440760 X-CRM114-Status: GOOD ( 12.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Microsoft Surface Pro X has host bridges defined as Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID: Hardware ID Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compatible ID Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings { Name (RBUF, ResourceTemplate () { Memory32Fixed (ReadWrite, 0x60200000, // Address Base 0x01DF0000, // Address Length ) WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, 0x0000, // Granularity 0x0000, // Range Minimum 0x0001, // Range Maximum 0x0000, // Translation Offset 0x0002, // Length ,, ) }) Return (RBUF) /* \_SB_.PCI0._CRS.RBUF */ } meaning that the memory resources aren't (explicitly) defined as "producers", i.e. host bridge windows. Commit 8fd4391ee717 ("arm64: PCI: Exclude ACPI "consumer" resources from host bridge windows") introduced a check that removes such resources, causing BAR allocation failures later on: [ 0.150731] pci 0002:00:00.0: BAR 14: no space for [mem size 0x00100000] [ 0.150744] pci 0002:00:00.0: BAR 14: failed to assign [mem size 0x00100000] [ 0.150758] pci 0002:01:00.0: BAR 0: no space for [mem size 0x00004000 64bit] [ 0.150769] pci 0002:01:00.0: BAR 0: failed to assign [mem size 0x00004000 64bit] This eventually prevents the PCIe NVME drive from being accessible. On x86 we already skip the check for producer/window due to some history with negligent firmware. It seems that Microsoft is intent on continuing that history on their ARM devices, so let's drop that check here too. Signed-off-by: Maximilian Luz --- Please note: I am not sure if this is the right way to fix that, e.g. I don't know if any additional checks like on IA64 or x86 might be required instead, or if this might break things on other devices. So please consider this more as a bug report rather than a fix. Apologies for the re-send, I seem to have unintentionally added a blank line before the subject. --- arch/arm64/kernel/pci.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 1006ed2d7c60..80f87fe0a2b8 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -94,19 +94,6 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) return 0; } -static int pci_acpi_root_prepare_resources(struct acpi_pci_root_info *ci) -{ - struct resource_entry *entry, *tmp; - int status; - - status = acpi_pci_probe_root_resources(ci); - resource_list_for_each_entry_safe(entry, tmp, &ci->resources) { - if (!(entry->res->flags & IORESOURCE_WINDOW)) - resource_list_destroy_entry(entry); - } - return status; -} - /* * Lookup the bus range for the domain in MCFG, and set up config space * mapping. @@ -184,7 +171,6 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) } root_ops->release_info = pci_acpi_generic_release_info; - root_ops->prepare_resources = pci_acpi_root_prepare_resources; root_ops->pci_ops = (struct pci_ops *)&ri->cfg->ops->pci_ops; bus = acpi_pci_root_create(root, root_ops, &ri->common, ri->cfg); if (!bus) -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel