Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp607930pxv; Thu, 15 Jul 2021 11:23:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJbFWEygGt6aQ/Mx5pLXXkpNrGThCmrZiekI64CJZtyC3pN+wZK0Emg0Rt9vHxB0P42tEv X-Received: by 2002:a05:6e02:c73:: with SMTP id f19mr3376792ilj.291.1626373401059; Thu, 15 Jul 2021 11:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626373401; cv=none; d=google.com; s=arc-20160816; b=fO+9huT0rOSR0K+NNTqzzX3fRiHjSvqKKbfMKNcLI3IRBieEugZ4QtkfhKnI1JAufq 1e+H520AMLAxuLWUzqsuOdTukBPOkosG88FFR1NUOkBE3y2989CvqO0AeG8JifkOoM34 V9tzCzv6vqEO3nVwZoax+wDu5KSBt8XMX+BI5MSw5kN3qbHXKvEEusJMxHHM5J5iHGCN Nwj2k2Vs8qS14VO8Dw8BAafVCNk1Ya7mDmcU/N9tUJylX4hTNZJsI+HokmjXbR8DLGjj StIqWT+DtrOqYN06I0KcR8x8823WJmd0swWU5/uNOwXmPXRXG/lTiczGKKmhzuNoHwke 16ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=v9kJo1aVg18GIypgDaFFjSu7Sac/FgllCG9BBgb6Gys=; b=h6rfdarT1XgJ+rcaBcVkmZs/JR2XSYKaPQVGHiNOfNhPPf0+STJ5eOgvAZu2IXjEvD J7ZoVCM0Ev8wOFmVNOi6jOsauTbzPyFfEleGVDUGKQ8PcqIu2GSmJlNetd1t1ddwWf9L 27yFlGNFTBsgiOd9X7oK8DUbb3VLz8by11QDbhrgTT0kJDRCaUX8FptiagE4D8YrEh+/ Lg5gYFfL3xxG3Oi6FaJOD8qxrsRQc6VMsnr2tzneXofC5AMUZlXg5EWrt3hnC+L/F5Xq 8+qTVz/z5XLmll5xdMIc4FMwHIAFjM8m9rLsB8BZxTlwaZNbxuCmD7KWijIWMIoKpU8L MbHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H1I8ENqv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si7124585ilo.50.2021.07.15.11.23.08; Thu, 15 Jul 2021 11:23:21 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H1I8ENqv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232677AbhGORQr (ORCPT + 99 others); Thu, 15 Jul 2021 13:16:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:52054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231950AbhGORQq (ORCPT ); Thu, 15 Jul 2021 13:16:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 37C48613DC; Thu, 15 Jul 2021 17:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626369233; bh=LCd49HWXy1jWbU+Ko+6zi8yExfbJ/VIy+k0XDmPhQ3M=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=H1I8ENqvsSJ6+ZTKa+/ZHcLdnaPBI2NfbfDX8h829LHoBcoizROgLe5AD+TIEnlNJ pbLQgmEuknMGJ/kOI01SLTOOnYo5y871T2BXbz82qss45ayapjnMDYMd4Z13ZzptGY QhVGtNH8SzRWwFNVucUvPFqg0i+b/6VwpAFxV3kaI7GzBmTsvd2Wn/ZTeOqL/VOXAK wDzVGO0M4ArZDKmb/0fnpyLvkmm8djzfC18uhN9IBRoB3LWMTRR7HlNeyAFftuXqpe 7TzG3PqU0eEA6MAi4Gr0zp2epSeRzWsPcRQpNqqBj9s6YVf5pcvAdq4sJaMgaqfpk1 e5Ii0totcl19Q== Date: Thu, 15 Jul 2021 12:13:52 -0500 From: Bjorn Helgaas To: "Billie Alsup (balsup)" Cc: Paul Menzel , Bjorn Helgaas , Guohan Lu , "Madhava Reddy Siddareddygari (msiddare)" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "David S. Miller" , Jakub Kicinski , "netdev@vger.kernel.org" , Sergey Miroshnichenko Subject: Re: [RFC][PATCH] PCI: Reserve address space for powered-off devices behind PCIe bridges Message-ID: <20210715171352.GA1974727@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 15, 2021 at 04:52:26PM +0000, Billie Alsup (balsup) wrote: > We are aware of how Cisco device specific this code is, and hadn't > intended to upstream it. This code was originally written for an > older kernel version (4.8.28-WR9.0.0.26_cgl). I am not the original > author; I just ported it into various SONiC linux kernels. We use > ACPI with SONiC (although not on our non-SONiC products), so I > thought I might be able to define such windows within the ACPI tree > and have some generic code to read such configuration information > from the ACPI tables,. However, initial attempts failed so I went > with the existing approach. I believe we did look at the hpmmiosize > parameter, but iirc it applied to each bridge, rather than being a > pool of address space to dynamically parcel out as necessary. Right. I mentioned "pci=resource_alignment=" because it claims to be able to specify window sizes for specific bridges. But I haven't exercised that myself. > There are multiple bridges involved in the hardware (there are 8 > hot-plug fabric cards, each with multiple PCI devices). Devices on > the card are in multiple power zones, so all devices are not > immediately visible to the pci scanning code. The top level bridge > reserves close to 5G. The 2nd level (towards the fabric cards) > reserve 4.5G. The 3rd level has 9 bridges each reserving 512M. The > 4th level reserves 384M (with a 512M alignment restriction iirc). > The 5th level reserves 384M (again with an alignment restriction). > That defines the bridge hierarchy visible at boot. Things behind > that 5th level are hot-plugged where there are two more bridge > levels and 5 devices (1 requiring 2x64M blocks and 4 requiring > 1x64M). > > I'm not sure if the Cisco kernel team has revisited the hpmmiosize > and resource_alignment parameters since this initial implementation. > Reading the description of Sergey's patches, he seems to be > approaching the same problem from a different direction. It is > unclear if such an approach is practical for our environment. It > would require updates to all of our SONiC drivers to support > stopping/remapping/restarting, and it is unclear if that is > acceptable. It is certainly less preferable to pre-reserving the > required space. For our embedded product, we know exactly what > devices will be plugged in, and allowing that to be pre-programmed > into the PLX eeprom gives us the flexibility we need. If you know up front what devices are possible and how much space they need, possibly your firmware could assign the bridge windows you need. Linux generally does not change window assignments unless they are broken. Bjorn