Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22433354rwd; Fri, 30 Jun 2023 08:01:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlHOU+CZC5QesHcfVmjBwd38jk3NjreQJMeOanpctREImT2wMgfnUwWuqYfsctr1p9JMkrBi X-Received: by 2002:a92:c70b:0:b0:345:71a4:bb36 with SMTP id a11-20020a92c70b000000b0034571a4bb36mr2265289ilp.23.1688137281026; Fri, 30 Jun 2023 08:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688137280; cv=none; d=google.com; s=arc-20160816; b=prIMBn2Q1k6BR0aXW4K7N8TeCfypRylwL7sPpj+Kpfa92ovD2vB3wlHTwji9UIjSel 2iEA6ZyUGCc9dd8TA9tifYwRdx0UWO1TxPf/zFCMj03RZl9u6p86cgVEtVHZO9PMQEJd MNAqqm+ekG4h9nBleMGKim7wuovgWBw5HoOwrchzVDXb49fT5VRhZRfF0Lmcp19l94UJ iIlCfn14pwQVSfDvTpFM6linNQYkr5Od9IaGtZeMgv0OQIgUCEv6/mA8U162nRQ0Ozjg b/lX3eoLMf5xj+M0mIKbNFXMZpArT8Dr5HrVQaf/dPGknshgzIGxoxRniowbJoGQwCoe DCew== 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=zkp6THFWJuXAmU27P5S8Lua35Bs36ygUjUWsGqxaZJo=; fh=wpP9zqfNV4tAoAZwGB6/nTjAmOkAgEhjGMTuPe9YrnI=; b=nPbW0xh5pKWl+XHnK4PjjKohKsu0HUYADZvxvUL96vOzd3kIJEcdgOSqWPyLQVxt13 flbOckLndjZjCTGaaZqSzFdAfq7VaTWYIC6kBGCanCsHOp6u4Ith6CDa8jzd7WOegSRn oUcxd95ey701i8PyRVP14nuuj9VFlEoKK+30MiNnUEecwIPhdDMqRGqvDCiaKXu0AgpW ACljXjTXDVLMnMZhwLbDHG/MgU5Ko2/qjpl+rj5OKzUI+0jQV6Zgw4U4Nm8GT0hNx34r tFJxIUR56dLbPfct0BrGABcQdk7L9nkhCI2nsqZYvVHJ9qfGg0DQtReXcaN63KKHwXL3 qygA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZEO2dSFD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h193-20020a636cca000000b0055793097dbesi12213096pgc.469.2023.06.30.08.01.06; Fri, 30 Jun 2023 08:01:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZEO2dSFD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232186AbjF3OnJ (ORCPT + 99 others); Fri, 30 Jun 2023 10:43:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232604AbjF3Om7 (ORCPT ); Fri, 30 Jun 2023 10:42:59 -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 636823C06; Fri, 30 Jun 2023 07:42:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EDCAF6176C; Fri, 30 Jun 2023 14:42:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16954C433C8; Fri, 30 Jun 2023 14:42:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688136157; bh=FobgviI7+8dwx2oijrp2XqAsD6wlFH06OENkuR5Y50g=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ZEO2dSFD4R0cumSQ4KDz5a/xHsp+PHKKOqrleiwbGQWliL7M6QRQL3SI2fjxSu1/c DPrZlpsMi9p+MbDq8YRTskpM8iHGZZ2Da21v2F6dsYGd5W0RWL1nJKjni7/JCt5wHf r1DyKC01cKJyK93I5AT+W9u+RMYg5NMxBAmSwqWM0c7L7OtQOBriffyjkbtxiOET1k 0CDlBcMIe8WZtdT5Ahl/iF+kTtFjRnSXJfkcGdm0SLMLb0dn1K6sH0Q1ORH3EpiEpM aTKIrBolB1mZRob90MIuRPw4QcORcVjnPiAYAgKYBr8FYllUafmLgNkisCFneynHJz 8YQVaA1qHSWPQ== Date: Fri, 30 Jun 2023 09:42:35 -0500 From: Bjorn Helgaas To: Rob Herring Cc: Lizhi Hou , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, max.zhen@amd.com, sonal.santan@amd.com, stefano.stabellini@xilinx.com Subject: Re: [PATCH V10 2/5] PCI: Create device tree node for bridge Message-ID: <20230630144235.GA483557@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230629235551.GB92592-robh@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Thu, Jun 29, 2023 at 05:55:51PM -0600, Rob Herring wrote: > On Thu, Jun 29, 2023 at 05:56:31PM -0500, Bjorn Helgaas wrote: > > On Thu, Jun 29, 2023 at 10:19:47AM -0700, Lizhi Hou wrote: > > > The PCI endpoint device such as Xilinx Alveo PCI card maps the register > > > spaces from multiple hardware peripherals to its PCI BAR. Normally, > > > the PCI core discovers devices and BARs using the PCI enumeration process. > > > There is no infrastructure to discover the hardware peripherals that are > > > present in a PCI device, and which can be accessed through the PCI BARs. > > > --- a/drivers/pci/of.c > > > +++ b/drivers/pci/of.c > > > @@ -487,6 +487,15 @@ static int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args * > > > } else { > > > /* We found a P2P bridge, check if it has a node */ > > > ppnode = pci_device_to_OF_node(ppdev); > > > +#if IS_ENABLED(CONFIG_PCI_DYNAMIC_OF_NODES) > > > > I would use plain #ifdef here instead of IS_ENABLED(), as you did in > > pci.h below. IS_ENABLED() is true if the Kconfig symbol is set to > > either "y" or "m". > > Actually, IS_ENABLED() with a C 'if' rather than a preprocessor #if > would work here and is preferred. Makes sense; I see the justification at [1]. I do wish it didn't have to be different between this usage and the "#ifdef CONFIG_PCI_DYNAMIC_OF_NODES" in pci.h for the stubs. But this is OK by me. Bjorn [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=v6.4#n1162