Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7768560rdb; Thu, 4 Jan 2024 07:11:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPL2lJDqsWWFdv6+O92tZYRpTnxrxTZBkN2n0+g0hsuJZrx7G5M6RRSKBGXh7EtMk1PYif X-Received: by 2002:a05:620a:258d:b0:781:538d:afb3 with SMTP id x13-20020a05620a258d00b00781538dafb3mr821323qko.77.1704381081062; Thu, 04 Jan 2024 07:11:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704381081; cv=none; d=google.com; s=arc-20160816; b=xieZOWzNOvkEZ5o5xoxpTTwPs8hU1bbr36NnCTjP/HBfEufEJARXClAZIGXE6iASTV qPY1liJvsTQYWUpm93cX1vWkEe7PMWCV/vRBtCBGYQRilJn3gfbbqrsSep/2eGJCRRz+ CE7l8bFEjpfdXv7aiWD10G7kvCmzhLhwoKVguJmSM2M9qINY6xP49G79FoWSKUzpwf3O fa9Oq6AA+z/g6GyPsU0VakzkNcaFzhNPVaLSmWO372r9ewxurK7xSEGTFgIv+Fb+2jFG SCmQJdJoaVBVVbUdSLHjalx2mSieg9flX4jXamBasJ3Dsnr6sGvKNV/r9ywNaUUDHKKu PCBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WrkWlfEFFlmA+QpimvQaHRO8AbH5jaj8BQ80RYd+6VE=; fh=rNbqFU/yp7tiW1EWxI9EBJT4KFZPF3UPVRkDCkCczXw=; b=cgOjmOlGVcDv0a/q/zZpq3BPnYbM7wj9DT1yf5t62kzE8ljHMEcx/t2v+7RIzMZZmW Rock49FyhjQwTuwx9Xtw93rwfjiQ29kTlgASZdvgdwxhXN2HJ5S6yKxcifQYnRR7f2Gc JzhhZp4Qj/BOjmW+HT5wj46onNsudCYBIBjeAUzCtBO4DIaOROOWg7vD5zZqUQJSQBoe gZ8+tEPzRg1f8P/5rD4iCmCqtjpfMKR7bfvXjWgiboPe3PLCLXq6HPJ6IB0lnaDPDd4l OZGKYbbeYYbqfzyuhpWjn5zBAu5xUgUUzIbpv9OUxmwpnI9GffS4Z9FooZ8H1UNLYClQ 9iHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=4ChAmfhZ; spf=pass (google.com: domain of linux-wireless+bounces-1499-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1499-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l19-20020a05620a28d300b0077f0c19e400si33431456qkp.610.2024.01.04.07.11.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 07:11:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1499-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=4ChAmfhZ; spf=pass (google.com: domain of linux-wireless+bounces-1499-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1499-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 993C51C20B14 for ; Thu, 4 Jan 2024 15:11:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83FE02377B; Thu, 4 Jan 2024 15:11:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="4ChAmfhZ" X-Original-To: linux-wireless@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 DF0D223777; Thu, 4 Jan 2024 15:11:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1704381071; bh=xGey7Z1qQaWQnT1BT1OSgP8+WbNEdnTjqtNlvMAYTEc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=4ChAmfhZHGzmTHDk6ZhIvFJl79kIFmstiFicB1/eDtYeGIx3/Zyku422RNxzoscnw mUHMHLqiSDOZuuNdOq2ivfS2/AEjy63PRhlBp49i+/awtqVt7NnKRVR3dqsqDbLJUX BaGU/dDvtrNjPkeXW1nqJhbcqHZT8tdvKXFWDBjsCf/FBm3CabECr2ROE/nizIXXJO WYOz4TxONG4A3t/1r7yuwhU8dhr20SitlxiDOQ+LvgTQ281EKSqxI/U0G8AF81LkxS QsGTLwnkP+UWvg7sHK1thLiI5Zn20h/9W5S3cByXFxOSkq6+h3ceT957q4IByomHCO 8WpwGMPLmjpRw== Received: from mercury (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 7F9C2378200D; Thu, 4 Jan 2024 15:11:11 +0000 (UTC) Received: by mercury (Postfix, from userid 1000) id 1ADFC106062F; Thu, 4 Jan 2024 16:11:11 +0100 (CET) Date: Thu, 4 Jan 2024 16:11:11 +0100 From: Sebastian Reichel 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 , =?utf-8?B?TsOtY29sYXMgRiAuIFIgLiBBIC4=?= Prado , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Kuppuswamy Sathyanarayanan , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , 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 0/9] PCI: introduce the concept of power sequencing of PCIe devices Message-ID: References: <20240104130123.37115-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cy6uey62v4nbmwrk" Content-Disposition: inline In-Reply-To: <20240104130123.37115-1-brgl@bgdev.pl> --cy6uey62v4nbmwrk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Thu, Jan 04, 2024 at 02:01:14PM +0100, Bartosz Golaszewski wrote: > During last year's Linux Plumbers we had several discussions centered > around the need to power-on PCI devices before they can be detected on > the bus. >=20 > The consensus during the conference was that we need to introduce a > class of "PCI slot drivers" that would handle the power-sequencing. >=20 > After some additional brain-storming with Manivannan and the realization > that the DT maintainers won't like adding any "fake" nodes not > representing actual devices, we decided to reuse the existing > infrastructure provided by the PCIe port drivers. >=20 > The general idea is to instantiate platform devices for child nodes of > the PCIe port DT node. For those nodes for which a power-sequencing > driver exists, we bind it and let it probe. The driver then triggers a > rescan of the PCI bus with the aim of detecting the now powered-on > device. The device will consume the same DT node as the platform, > power-sequencing device. We use device links to make the latter become > the parent of the former. >=20 > The main advantage of this approach is not modifying the existing DT in > any way and especially not adding any "fake" platform devices. I recently ran into this issue on a Rockchip platform using a PCIe based AP6275P WLAN device (broadcom based). As far as I can tell your proposal should also work for that one (obviously using a different pwrseq driver). -- Sebastian > Bartosz Golaszewski (9): > arm64: dts: qcom: sm8250: describe the PCIe port > arm64: dts: qcom: qrb5165-rb5: describe the WLAN module of QCA6390 > PCI/portdrv: create platform devices for child OF nodes > PCI: hold the rescan mutex when scanning for the first time > PCI/pwrseq: add pwrseq core code > dt-bindings: vendor-prefixes: add a PCI prefix for Qualcomm Atheros > dt-bindings: wireless: ath11k: describe QCA6390 > PCI/pwrseq: add a pwrseq driver for QCA6390 > arm64: defconfig: enable the PCIe power sequencing for QCA6390 >=20 > .../net/wireless/qcom,ath11k-pci.yaml | 14 ++ > .../devicetree/bindings/vendor-prefixes.yaml | 1 + > arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 24 +++ > arch/arm64/boot/dts/qcom/sm8250.dtsi | 10 + > arch/arm64/configs/defconfig | 2 + > drivers/pci/pcie/Kconfig | 2 + > drivers/pci/pcie/Makefile | 2 + > drivers/pci/pcie/portdrv.c | 3 +- > drivers/pci/pcie/pwrseq/Kconfig | 19 ++ > drivers/pci/pcie/pwrseq/Makefile | 4 + > drivers/pci/pcie/pwrseq/pcie-pwrseq-qca6390.c | 197 ++++++++++++++++++ > drivers/pci/pcie/pwrseq/pwrseq.c | 83 ++++++++ > drivers/pci/probe.c | 2 + > include/linux/pcie-pwrseq.h | 24 +++ > 14 files changed, 386 insertions(+), 1 deletion(-) > create mode 100644 drivers/pci/pcie/pwrseq/Kconfig > create mode 100644 drivers/pci/pcie/pwrseq/Makefile > create mode 100644 drivers/pci/pcie/pwrseq/pcie-pwrseq-qca6390.c > create mode 100644 drivers/pci/pcie/pwrseq/pwrseq.c > create mode 100644 include/linux/pcie-pwrseq.h >=20 > --=20 > 2.40.1 >=20 >=20 --cy6uey62v4nbmwrk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmWWyn8ACgkQ2O7X88g7 +pqYEA/7BHxRVVJzOzyU8+oTZ3jVVPdgfWWRB+8eVAxg6+O3OKc31B9UlAXlEVHU BLYObChFlR8wfoA88johSDUjE2GGCTNeC0oDA12GVCdP0RzosAdmnW24uv8IdJvH 471Kw2n08jnMrzh32HnnehetOZIoF3vORkxkLpH26pZVayzGA8CCq8XI45S16Pfx IbiZ3nYuJM0LB7rxj1R9aR9uL3MzH+rCBBKqcbtKJTAvkLkvHhTrFWPhIIm4+Fwh anIwi8jhwxHeZ4cQKEuxJF0PzpnXQnUhAj1kUaoUSj6G5ffmJo6pyEgNSXqpoizU qAtWaa5zHClBwgEdqjJqMaaXZK7yDFkSekTsKciZeqZzZW476i3ZefIendZSitNT IcAVHwGvL+XuI2y2WpET9dtx+Ij+R1FSmk+6HIn24BFu3GV3KaG2+thgfF1J2l0y lV76WK3vQDSshWC+9p9f72Ug+h9Wi1UIWBXyLPuA17NjD/v+RG9YV4IntjaHHBZk 5SjzHrrqyHjIn+s16JU0XH2Wt9oFl+gnPJlhLvx3HdHdNYCCVjR+37T55SERvMlH KHWcCk+9qWRJnTdDtkE97T1TWxd803PU6a/pzK/u/m4Hf7/CBnrZmbxQnP7jq/pF dm0V0duiFUCn/HckPL1VLuF8IUuSlGTKSj7ypDRR7O8On0KxghE= =kqNZ -----END PGP SIGNATURE----- --cy6uey62v4nbmwrk--