Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp5136437rdb; Sat, 30 Dec 2023 07:19:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlmhB7rsEAmva+ee764PxCplVKSEfQQC9/Dn7lsfOMUABaVDxqF2WuWSHaqtHYfoNkoHdX X-Received: by 2002:a05:622a:100b:b0:428:1540:5059 with SMTP id d11-20020a05622a100b00b0042815405059mr669749qte.23.1703949586771; Sat, 30 Dec 2023 07:19:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703949586; cv=none; d=google.com; s=arc-20160816; b=b5VpKfwRA5zyJwQjUPFYchMPlxDusOH1CvlyZMb/3wC7ypCXxsy1Ymbva6KLxOtlPW pSzRJp0xT74NjDDzkCZOsatbf9++EsjP3PWTnIc50d8HHaOPS8XxIbvPzouOTCMC9xai l1u0CneVtdP/8WFbR2lpqhlTTn8JaduSZ7egPe5yML4gx8As/QTLuayTL1FnY8l3u9QW yJXU5RmPN/0pcYFp8g2mN/vHcCBHx9U6ayG5q9uVzHQNkmhTtQxCLiI3qX6taEoje0ii hVyeHSQEm8xcZ3a3vSNbm8404+8dqRzbZ1Zm4UXeI/6VYnlfcyNAJ36iZWnmFAxB4zZs DiKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date; bh=CUpjJzrKiYoCBJk4/Nw5Xlro3Y/pg3hk716NKIRc1ck=; fh=XjlWRknf/6Q700T60yrQwGDm4VYbp8Ji6vI7Gcejp0k=; b=wpVMQ8+iGCFcWvJ4I5h4MoQ39aBX3Df29bSgfD8w3e5mYpTjc1RLZ+k4GfnNGlqpzo rSX0K2gDwiGfTPp3V26uGttS4S9VsGjkTescIPIrJJv/adD85zQe6LSPeUIktr0CgdA1 r+gVGze9o3mvVUwOE/B0wQSD/gP620XLLX5YFaHdHVQb4+oD8gWt/USZIV9DV2twJv9l zCIlruP8dv/Rfue1BVxxG5Qj1cS5LOfeafCm4Sy/E+aCXeQloqOBYFTnp/M61qUqX9hT yrD/liJ50diP2mVs/2CUx8IVpk9LJRcAzkhQ1eRF8nIVnUjgkyJ2LvyLZa/7C6iJQhJN Cbcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-13454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13454-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v5-20020a05622a130500b0042811ba9712si1198096qtk.242.2023.12.30.07.19.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 07:19:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-13454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13454-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7E0511C212E2 for ; Sat, 30 Dec 2023 15:19:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49BBA9473; Sat, 30 Dec 2023 15:19:37 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [83.223.78.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 437BE8F59; Sat, 30 Dec 2023 15:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id CD95D2800BBD8; Sat, 30 Dec 2023 16:19:31 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id C07F640FBD; Sat, 30 Dec 2023 16:19:31 +0100 (CET) Date: Sat, 30 Dec 2023 16:19:31 +0100 From: Lukas Wunner To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , Krzysztof Wilczy??ski , Alexandru Gagniuc , Krishna chaitanya chundru , Srinivas Pandruvada , "Rafael J . Wysocki" , linux-pm@vger.kernel.org, Bjorn Helgaas , linux-kernel@vger.kernel.org, Alex Deucher , Daniel Lezcano , Amit Kucheria , Zhang Rui Subject: Re: [PATCH v3 06/10] PCI: Cache PCIe device's Supported Speed Vector Message-ID: <20231230151931.GA25718@wunner.de> References: <20230929115723.7864-1-ilpo.jarvinen@linux.intel.com> <20230929115723.7864-7-ilpo.jarvinen@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230929115723.7864-7-ilpo.jarvinen@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) On Fri, Sep 29, 2023 at 02:57:19PM +0300, Ilpo J?rvinen wrote: > The Supported Link Speeds Vector in the Link Capabilities Register 2 > corresponds to the bus below on Root Ports and Downstream Ports, > whereas it corresponds to the bus above on Upstream Ports and > Endpoints. It would be good to add a pointer to the spec here. I think the relevant section is PCIe r6.1 sec 7.5.3.18 which says: "Supported Link Speeds Vector - This field indicates the supported Link speed(s) of the associated Port." ^^^^^^^^^^^^^^^ Obviously the associated port is upstream on a Switch Upstream Port or Endpoint, whereas it is downstream on a Switch Downstream Port or Root Port. Come to think of it, what about edge cases such as RCiEPs? > Only the former is currently cached in pcie_bus_speeds in > the struct pci_bus. The link speeds that are supported is the > intersection of these two. I'm wondering if caching both is actually necessary. Why not cache just the intersection? Do we need either of the two somewhere? > Store the device's Supported Link Speeds Vector into the struct pci_bus > when the Function 0 is enumerated (the Multi-Function Devices must have > same speeds the same for all Functions) to be easily able to calculate > the intersection of Supported Link Speeds. Might want to add an explanation what you're going to need this for, I assume it's accessed frequently by the bandwidth throttling driver in a subsequent patch? Thanks, Lukas