Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2235956pxb; Wed, 30 Mar 2022 20:14:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuU+40KjptGsxNEZVIJnOTbTqNvwHqvlKO/EoaAKGeTopJhQu5Zk5LdWHXW6iGWHOuWzyu X-Received: by 2002:a63:1c14:0:b0:36b:28ef:f8ce with SMTP id c20-20020a631c14000000b0036b28eff8cemr8947538pgc.96.1648696497625; Wed, 30 Mar 2022 20:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648696497; cv=none; d=google.com; s=arc-20160816; b=XOk6hBkSt9IlVJKnN5LtQQZXQBRLoLLePetsVq66H/SD8T4yv4gCaKj2k5FbSPY282 L8TJi5lU9JW5snDzE97RPTUN7UHijlfbW1q04WHWeXA02t5wRMI+fZRn8AoMN9rK/jHJ A3ZX5jofpnYMxVMmN649xfz6S0oY6QcTyhsdXUcuBVi82qKsXicPpPJh8xW9dsAcQC5g /+BaWkg88yCHCzN4s1b0tzT9Acl3XiOqql7s8MJqz2Tj3lv4P/kRusCEauE8WxzTZWt5 YXgHvRHchWPiPnu1sm0JBS5bY7CrqSUz0j8PBcHYN+P7oSc0wmU0X21anObV1zNG3JwW hquA== 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=hktJ1vFVcFdcXhu2nP+5tsSu8Ue8uks0R9f4enHYgcA=; b=bmUAma2WG7cD+F1xBeCEGWLQKM8yDt1C+GKjd60Vs7SvLLKj9hzNrToO8sWOTZG2k6 XFUgIvuLhlotPtbCOtuGcIFZRiH6XdMVvNghQ1tuEbNDLrjTKeQTw6mBV2BcnazIhzEG yKLJwmskxkbq8XzJ3wm73lHVCszCH+ytqHw80MAj8MItn1KCJGisCceynxdB9zpF3sRL Mjq1Pgo1gg0BaA4uQX6HyQ57CWqLRNbc6tcrGJoB+Ebqd9Hd8jAyBpfkxi9jgagSHXbA SfcXoC5k0QzPM/ZhOiDH4vJ9pKzd4AQofD0iB8VwieE9XPtlJe1lflsRhcwHWbrwOwSj oZjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C3KMnOik; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r2-20020a63fc42000000b003816043eeafsi22524685pgk.164.2022.03.30.20.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 20:14:57 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C3KMnOik; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BD914F9F88; Wed, 30 Mar 2022 19:48:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350817AbiC3TMq (ORCPT + 99 others); Wed, 30 Mar 2022 15:12:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350567AbiC3TMc (ORCPT ); Wed, 30 Mar 2022 15:12:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F09BA33EB5; Wed, 30 Mar 2022 12:10:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8F8DD61382; Wed, 30 Mar 2022 19:10:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5A1AC340EC; Wed, 30 Mar 2022 19:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648667420; bh=Bd5+M5VE8rRc0rP6ib+x8ifz4fFdKR2N/GFKCemE0wg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=C3KMnOikqv1wcAcW5I1otZz0XYVl5QKrPmo8+DHJvrqgMgQ/iaxOiDIbQQx28K/m/ qK6yU594heIvLs2Q5i6yxe7kFwKScfDvs3H+jCQprM6tO/OSuIKtNW1cnjxZ0+sPmE 0VGNvAWxSGQr5aAoWLP4hZH+TLebHIXEu6B6nOmXE3Hg7mzXfR+Hq0jI+brUzIb8OH 1WTwhxKswpv5mMEKr/BILx9k4x17MK8NOs++6eT3ldzDXYTy1s5w6lyhjGHOX8rpvD 3qZ07JMWKAu/sjux2lp/nNFphtTkn1Lf52LnyyJUIpkLcQJsKNz/Ngr6XtJA8YwTVR 9f/uAEuvaE1KQ== Date: Wed, 30 Mar 2022 14:10:17 -0500 From: Bjorn Helgaas To: Jason Gunthorpe Cc: Shlomo Pongratz , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, andrew.maier@eideticom.com, logang@deltatee.com, bhelgaas@google.com, Shlomo Pongratz Subject: Re: [PATCH V4 1/1] Intel Sky Lake-E host root ports check. Message-ID: <20220330191017.GA1700536@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220330153720.GF1716663@nvidia.com> X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 30, 2022 at 12:37:20PM -0300, Jason Gunthorpe wrote: > On Wed, Mar 30, 2022 at 05:08:23PM +0300, Shlomo Pongratz wrote: > > @@ -350,7 +353,10 @@ static struct pci_dev *pci_host_bridge_dev(struct pci_host_bridge *host) > > > > if (!root) > > return NULL; > > - if (root->devfn != PCI_DEVFN(0, 0)) > > + > > + /* Is it a host bridge or a root port? */ > > This is a better comment: > > /* host bridges must have a 0 devfn, but some of the entries in the > whilelist are root ports that can have any devfn */ Is this something in the spec or is it just common practice? The PCIe spec says very little about "host bridges" and I don't remember anything about them having to be devfn 0 or even that they have to be materialized as PCI devices. > > + if (root->devfn != PCI_DEVFN(0, 0) && > > + pci_pcie_type(root) != PCI_EXP_TYPE_ROOT_PORT) > > return NULL; > > Indentation is wrong > > Jason