Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1703659rdd; Thu, 11 Jan 2024 07:02:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3zsHZYrILFzssMLS16g1fwaDn/gg6m6ncU3hH2jAFHSGIb9Ac6mTsN1UXLtsP4pl/HsSW X-Received: by 2002:a05:6a20:49af:b0:19a:a87:c739 with SMTP id fs47-20020a056a2049af00b0019a0a87c739mr956007pzb.118.1704985374458; Thu, 11 Jan 2024 07:02:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704985374; cv=none; d=google.com; s=arc-20160816; b=lzvDXk+6hzpGNuTE5P7vJxPSCKHrYoNFAVYl8CGO2CwyVi41blNdpfweJY3xfAgvsy KUIolyN9SCBHVCePyySHV6QH7UecDN31Pmrem30Yca3XnMZbCZTcxEE4eqDMFGgNf0l6 HI6awjgS75Irzfr7fwZ1U1mVuNQJHE6rqpd0oTzxR9m3LrKsWUA/WEEpPrdL/doxd2LG 7j3a9mxvDu4ODpIKI2YseSwvw+//9RcHOwIRPy/HTM8rlDU4aidxLg8qqWWhu4q5VKC5 jsuLViGiYPcTH9x6h1F7e9TZZrT5zwkXTXkt9m4a+WI9VQlc41QSQKp91/rGjgEWqJfj K+sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=iC1zO9rTssbi+TfMzfKQOKVipIFwy5rm/8iAHyYxkE8=; fh=J0fXr2XTQazfk/QHL/kMggvUdvjoAwM8TFsoE7HFOlw=; b=pozgisJhNlcELion6M4vetT+i79lnyToO378IWiFNBPa1qckd7uOLtJ938o0xcmJBu hU6hB/+QKdACPId/IEiWHoqLq7NVXF0pNohwXocaxEfvIJseyFkW5pOvtwoMw/f5aZIs gGQoLFDJ4hvUSinsiF/3yriAxYGL+Uu19nsWGOl/1MXGN7YJK36U3+oJmSqw6RBAHc1n 3VGCPsFwiDf5QBAMzqSpslAQfYYBcSLuORvc2KBDeuZ250cbjIdQtleTnWV2LJqcmlUP D6uNHizGfBPSdOsdGTPnQR06DG9irpg2WONkL3Wq5rh8QitbEXtidtN8Dy31z4gYKA6p g1ng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-1721-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1721-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q63-20020a634342000000b005cf268638edsi1285057pga.177.2024.01.11.07.02.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 07:02:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1721-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-1721-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1721-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CFB0BB212F0 for ; Thu, 11 Jan 2024 15:02:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD8BC4B5BF; Thu, 11 Jan 2024 15:02:13 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [83.223.95.100]) (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 74AEA4A987; Thu, 11 Jan 2024 15:02:09 +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 bmailout1.hostsharing.net (Postfix) with ESMTPS id 9E573300000BE; Thu, 11 Jan 2024 16:02:01 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 8FBBBDAB62; Thu, 11 Jan 2024 16:02:01 +0100 (CET) Date: Thu, 11 Jan 2024 16:02:01 +0100 From: Lukas Wunner To: Bartosz Golaszewski Cc: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?iso-8859-1?Q?N=EDcolas_F_=2E_R_=2E_A_=2E?= Prado , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Kuppuswamy Sathyanarayanan , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: Re: [RFC 3/9] PCI/portdrv: create platform devices for child OF nodes Message-ID: <20240111150201.GA28409@wunner.de> References: <20240104130123.37115-1-brgl@bgdev.pl> <20240104130123.37115-4-brgl@bgdev.pl> <20240109144327.GA10780@wunner.de> <20240110132853.GA6860@wunner.de> <20240110164105.GA13451@wunner.de> <20240111104211.GA32504@wunner.de> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) On Thu, Jan 11, 2024 at 05:09:09AM -0600, Bartosz Golaszewski wrote: > On Thu, 11 Jan 2024 11:42:11 +0100, Lukas Wunner said: > > On Wed, Jan 10, 2024 at 02:18:30PM -0600, Bartosz Golaszewski wrote: > >> On Wed, 10 Jan 2024 17:41:05 +0100, Lukas Wunner said: > >> > On Wed, Jan 10, 2024 at 05:26:52PM +0100, Bartosz Golaszewski wrote: > >> > > Seems like the following must be true but isn't in my case (from > >> > > pci_bus_add_device()): > >> > > > >> > > if (pci_is_bridge(dev)) > >> > > of_pci_make_dev_node(dev); > >> > > > >> > > Shouldn't it evaluate to true for ports? > >> > > >> > It should. > >> > > >> > What does "lspci -vvvvxxxx -s BB:DD.F" say for the port in question? > > # lspci -vvvvxxxx -s 0000:00:00 > 0000:00:00.0 PCI bridge: Qualcomm Technologies, Inc Device 010b > (prog-if 00 [Normal decode]) > Device tree node: /sys/firmware/devicetree/base/soc@0/pcie@1c00000/pcie@0 [...] > 00: cb 17 0b 01 07 05 10 00 00 00 04 06 00 00 01 00 ^^ The Header Type in config space is 0x1, i.e. PCI_HEADER_TYPE_BRIDGE. So pci_is_bridge(dev) does return true (unlike what you write above) and control flow enters of_pci_make_dev_node(). But perhaps of_pci_make_dev_node() returns immediately because: /* * If there is already a device tree node linked to this device, * return immediately. */ if (pci_device_to_OF_node(pdev)) return; ...and lspci does list a devicetree node for that Root Port. In any case, of_pci_make_dev_node() is the right place to add the call to of_platform_populate(). Just make sure it's called even if there is already a DT node for the Root Port itself. Thanks, Lukas