Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp753299pxv; Thu, 8 Jul 2021 13:20:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/Qlb3zACER9vhOo65h8E62ZznxdvckkwRaieGoVVudBgqt838KE+a70S8PTpuhKibe0iy X-Received: by 2002:a05:6402:3514:: with SMTP id b20mr21697707edd.187.1625775614100; Thu, 08 Jul 2021 13:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625775614; cv=none; d=google.com; s=arc-20160816; b=gDJPWTMq7XYviMj3ePO1kSaU1Z+WFWplOAzhT05RGQtSwcRv/bYKTP7doacJk6zRS9 WeVwiGhq5dRX0fwkeF2pNYy4Cgd7XtVF8EoR7cC8q3a4HyRqwDlKv83Z32c+iO1aeY5s BMMF1lyHjQHsZAvaId2fb3iXOiS9kwiuedadRRxNknTaoaEMLuJtmo4ItK5NuG+sEzVv itS583vzAuQPaeefny2wPdHNX9a82w3umYiLaEFKmayy3dIDHQntr/eWwV2Ww9NJGGpX YeoOHrpXF1K5w7Q1rH8PLAzv6zszoww8pCWBJZ/YbXC1iV5txrATRAI5N/SGBdbnFD0a P5UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=JuTdJQ3TlcMS+NcU/vGpfsSkDltKl9dzDmUPNsP3+ws=; b=hJr2E9fIz945MEpFbWHYkQ+PHTNRK6pVYFt4paSv2lpn8sN5ZHnaL6Tkcy1Tgfh6yD CGLxsCoFgVJzaf/FBpjciGM0P/gzlazqRYZQDdPst0Xcc1DTzebldWnpAG6Thu+mXYSW C8Aobso05H7bwMABrt4Hwo7fkXq6Qno7djpLRhBK9gR8CQfhJ40AxHA9oPR9U0ScvAqP Q7+u+up10C8Qy5ffUD7SAcoi75uykqAgOUkzq+wj9moLaBaOEh7rWpnLxjYNTO5C/qdT owo3esyfwhjteXziUwibDCgMdft7YDQb+/BGmTpIF3Lbx5Uuc5ehFggPsVxAKiPnQ4e6 Pn7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp17si3599591ejc.449.2021.07.08.13.19.50; Thu, 08 Jul 2021 13:20:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230379AbhGHUVk (ORCPT + 99 others); Thu, 8 Jul 2021 16:21:40 -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