Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7693357rdb; Thu, 4 Jan 2024 05:02:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHqpX2B15tRyWGZ6+9/TQ/C8MaI+w5s77a1mWQCx0jO3Z8aCOzdws571O+vzqzBzhCFIHx X-Received: by 2002:a17:907:9009:b0:a28:c638:40a0 with SMTP id ay9-20020a170907900900b00a28c63840a0mr139549ejc.77.1704373355909; Thu, 04 Jan 2024 05:02:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704373355; cv=none; d=google.com; s=arc-20160816; b=K+YlzLm0v1qGnVaP3eH9MtkRUYLhRm4pTZKL1inZpfDq69jZd2q+8ETz9DrJ8fcjYw /P1OdY602xx+cxmyURK/h27HwXGzL4mIYgkAKQ6Savr5HmBdYVuS3qLEeg8sp8hnMm8t 9Yo7dgQEugZ4SrmydVG50c0CD398Np5PXLrv+o2mKMgEpSN0bhldg3McebPrBXw7wFTx Qj5uhpQuzP0gJGX3MIHpZgkPMtjapy1setr3HymKKE0ndSU+GN5dUNYP5YDb5c7Kd1cO nW0bNZu8W2W/ydQQc+2CCNkG9v4wESSjIxrr1CFsiL/E0U2dK7Pz/v2PQgj9kZp2pPeI Fv6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=opVDF4AOHQah3OrT16oGMK2ccRRJHeIMJXkpc+aZwFs=; fh=1uFngekeZT2FVGQaKpK4gjTIex4FU0hdfexTfOUKej8=; b=Dr6U0pRgEU0AgWMpc/ZNmYejlqsClqGiK0pjmanGzmRPbwmfeZEKcTWWLOjD3FxOuu gM0lqe5TnM3Y/RvP9hXro8Qzr3ZpV1LeQCjqTgdiXoYWo+M1pXSlHOY13ievK55Nz1xF U6KnPu/6yCtHkZ341WfrxhPExidrzk9aGrPKRfdB7Xksqc3YQrEPN1TapB/PxMfOHti6 AN1GvTwOvYBvxlfGaUG6F314lx90a+OGFvN3X+nWC6l81oJw8IY5Ky/X4bYixCN1Nywo yoISl86lhguXk/ZOgcQd+qfS8v5nm0q9wQ382v7xLnWC83RhKJSxGqHi44J+0csglhEv RKlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=WK1xaleo; spf=pass (google.com: domain of linux-kernel+bounces-16674-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16674-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id rs25-20020a170907037900b00a27dc6f2477si3778181ejb.203.2024.01.04.05.02.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 05:02:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16674-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=WK1xaleo; spf=pass (google.com: domain of linux-kernel+bounces-16674-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16674-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A4CA41F2182D for ; Thu, 4 Jan 2024 13:02:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B36D6224D7; Thu, 4 Jan 2024 13:02:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="WK1xaleo" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AF75224D4 for ; Thu, 4 Jan 2024 13:02:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-3366e78d872so414457f8f.3 for ; Thu, 04 Jan 2024 05:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1704373322; x=1704978122; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=opVDF4AOHQah3OrT16oGMK2ccRRJHeIMJXkpc+aZwFs=; b=WK1xaleoMk7IVXPllfXEUF4Xo7mTNqo5t2Eu1pESyW/Y+enVzlgw2jNS6NG0ix03uW R3eEPFGjgzWgVBUx6oChjpFfyhCOFLNySVeIg9x/1AyeyCOnHphPJBYjCU11dCsbNd67 jD4Hsp6G8K54zNh+9zAbbMQJODkn84rl4B92p9Efk6QQ1cboEVYDHPFVdBH2wLBTzHyc o33J/zut+6c66m+g+0Qjkogk7AG+SVphmFVCUlA04TUnXWHsucHF8yBrWPh9MbphLmYk Xjo7Y2Xsk+yhKozFeEUyIquoRJwCHZylOWw21UfOv/pobf7YH8XTUf/8rvEGFVGuVWCy ABaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704373322; x=1704978122; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=opVDF4AOHQah3OrT16oGMK2ccRRJHeIMJXkpc+aZwFs=; b=sb+MP6d0OrWRdYY7iWQ2gskT9QgGbpt++yPOeEAc1Yi+MVv+sOhkL0Zq38gKEmgSEz l+yZ82lGQHi79XPjjb8XpVzvjuYw+zrV3RMcohP1javM+ZZtu20K9rIjYxwYsRs8fX4x 9LpUkp4epl7fdP4QwOtvBSmrUuoQyPT2qob6Rlb1MZSMnvBN12hdE52McQ3zfgDYxdSV ufwkTPSopYp1+p5T37KOt1+FHx/xTkeUtsjydMEN0kenc/vLzhekychAmXOG1XbIkyEW 4ZZf4p9SiEG0rkwqEkAQyONqxTFTRFITygAJKa1XQBTNj0oARHreXssX8wtKZdz9vUTs qOag== X-Gm-Message-State: AOJu0Yxd+YTd3COxbSjME2L24BazSMN1qehmrek/JMQXuPNsI5NqwMxR kpuJ7WTRyaB7tIcJvL7WPFIG31SSkIOzvg== X-Received: by 2002:adf:cc86:0:b0:337:157:2d3e with SMTP id p6-20020adfcc86000000b0033701572d3emr161961wrj.222.1704373322145; Thu, 04 Jan 2024 05:02:02 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:5b69:3768:8459:8fee]) by smtp.gmail.com with ESMTPSA id w5-20020a5d5445000000b0033660f75d08sm32887387wrv.116.2024.01.04.05.02.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 05:02:01 -0800 (PST) From: Bartosz Golaszewski To: 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?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Kuppuswamy Sathyanarayanan , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman Cc: 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: [RFC 0/9] PCI: introduce the concept of power sequencing of PCIe devices Date: Thu, 4 Jan 2024 14:01:14 +0100 Message-Id: <20240104130123.37115-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Bartosz Golaszewski 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. The consensus during the conference was that we need to introduce a class of "PCI slot drivers" that would handle the power-sequencing. 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. 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. The main advantage of this approach is not modifying the existing DT in any way and especially not adding any "fake" platform devices. 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 .../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 -- 2.40.1