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=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 8FDACC07E9C for ; Thu, 8 Jul 2021 20:19:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6872661921 for ; Thu, 8 Jul 2021 20:19:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230404AbhGHUVl (ORCPT ); Thu, 8 Jul 2021 16:21:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230238AbhGHUVk (ORCPT ); Thu, 8 Jul 2021 16:21:40 -0400 X-Greylist: delayed 82512 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 08 Jul 2021 13:18:57 PDT Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B127CC061574; Thu, 8 Jul 2021 13:18:57 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 0526F92009C; Thu, 8 Jul 2021 22:18:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id EAD1292009B; Thu, 8 Jul 2021 22:18:55 +0200 (CEST) Date: Thu, 8 Jul 2021 22:18:55 +0200 (CEST) From: "Maciej W. Rozycki" To: Bjorn Helgaas cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] PCI: Do not restore firmware BAR assignments behind a PCI-PCI bridge In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Jul 2021, Maciej W. Rozycki wrote: > This may work for a device directly on the root bus decoded by the host > bridge only, but for a device behind one or more PCI-to-PCI (or CardBus) > bridges those bridges' forwarding windows have been standardised and > need to be respected, or leaving whatever has been there in a downstream > device's BAR will have no effect as cycles for the addresses recorded > there will have no chance to appear on the bus the device has been > immediately attached to. > > Do not restore the firmware assignment for a device behind a PCI-to-PCI > bridge then, fixing the system concerned as follows: Scrap it. Something kept bothering me about this fix and I have double-checked with PR 16263, and the problematic device there also was behind a PCI-to-PCI bridge, which I have somehow missed previously, though within the bridge's forwarding window. So a more stringent rule will be required to keep both cases happy and I'll make v2 shortly that only refrains from restoring the original assignment when it is outside the relevant upstream bridge's forwarding window. Maciej