From patchwork Wed Jan 17 16:07:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13521974 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88BB4C47DA2 for ; Wed, 17 Jan 2024 16:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=yugVg6w4S3OUXlvSW+tlxMJsmGjzBj8/YG/HxJPktb8=; b=vV6DLF1Xi8iuI2 wlg0sbnlf19wUHC2CE14n9jeufoj87szLAX1tnpE5Cdr4Q4nWo3+KOXvk4WYgUKd8lc6bnKCfzspb 7qgVbAvtKh0+snymPCUM5Gk3WZcPmeRp0ppsVACgG5dKYMBdyxnS9jrs1eIK9q8PkHmblP4nJGwxu sAP3FFDZJ+HFnNHR4u35lXlOUAMAoS/3prjHyC1mrCX3q4DdCJjxLbf/jKKx5qmVy1gXwTNB6gaiC TA1wojpYWIT/G2dnD898XJH8KSXWB9gkSZLokbKi17cJ0B5oABIlJk8B5eGJFjjOedSMZMpigYcQD uxUl1zl+E7QTSOJSLEvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQ8Sz-00HZpC-31; Wed, 17 Jan 2024 16:08:37 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQ8Sw-00HZm9-21 for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 16:08:36 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40e5afc18f5so68721805e9.3 for ; Wed, 17 Jan 2024 08:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1705507707; x=1706112507; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MyUo/UL6AejHs5hrhdv6/x2YU8XtvFhHsaGgxgVP4HA=; b=cUJYlPSSs3fc3IYsGRp7DUaUqFGZ7amdlG4U3Y8MnOtdmR5L801ItqEqXE3BNgI/Bx xoH0GiCJ0rVIJWXPQjQlH2L1+2bP/I1OtezlKgf7ud/RYDJg1SrkFgPMs1b0YSKsaHpv cbhyTFcC/jQ+2s+llrkY1x+vbHVm1Fda4ajR3GhXQbUZ0zEolZBlygZ/3JKsWNwGz/LX gi9WJGbmPAK56UEt1T19VCbd7UqjjOHCcatgbx71gYcwi8GkHbQC//i+Oqdx+9LZC+1R HU+wQ5cQci+YDzxVrNAIikghziDpgt63+DijGfBps+tmL21VSZJnH5rx7TfwPBAvGP/9 i98w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705507707; x=1706112507; 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=MyUo/UL6AejHs5hrhdv6/x2YU8XtvFhHsaGgxgVP4HA=; b=azMQJzdSb6KKxC0ANAmWqEwki6nF907fil74Z0TzsHFOCyMIsMkSypKxgbKaAi8i3S Hmo/TOM6g+9IA/VMSpnBkms5MtouP2Te364wNe9Q43Ee+kl8yAZoaDgIGyNaCoSe3y6C e879KYMKlzHoCZPuZnd09vCeH59hRpe+j/B6aDHWrs1vCU7xmzYnZ5u5ifx/4XgKNJ9X +sN0vsZSTb1s0sYoV6+rZ2RM8kZPOJ1lp1p8NUHpHofVm190yv1Beihe/Y2HQg4hd19f w3qKnQnIk5ylsVXuim8qFkX59TmUGwAbajq9Rvumaa4ojwZ4xY1ZuoAayXzvS3LOWafq IT7A== X-Gm-Message-State: AOJu0YxyuRdZ2aB1THYYRjitWh6HwaCG1tGQe3TuOeHJEhRKEs+T4eJs d1KjAKSbiVGve9NHnd6CtAtBLu69bH89IQ== X-Google-Smtp-Source: AGHT+IHlxHbmKVJpdUR6FTOE1NTTevtRRWD6ZNjn5U6+9dnAYa4RC2TRfYigQaqhNQbHmnO2nJkODQ== X-Received: by 2002:a05:600c:3506:b0:40c:3e6e:5466 with SMTP id h6-20020a05600c350600b0040c3e6e5466mr4763135wmq.182.1705507706783; Wed, 17 Jan 2024 08:08:26 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:d0b5:43ec:48:baad]) by smtp.gmail.com with ESMTPSA id t10-20020a5d6a4a000000b00337b0374a3dsm1972092wrw.57.2024.01.17.08.08.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 08:08:26 -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_F_=2E_R_?= =?utf-8?q?=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Lukas Wunner , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa 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: [PATCH 0/9] PCI: introduce the concept of power sequencing of PCIe devices Date: Wed, 17 Jan 2024 17:07:39 +0100 Message-Id: <20240117160748.37682-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_080834_895144_AEF63B43 X-CRM114-Status: GOOD ( 20.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Bartosz Golaszewski The responses to the RFC were rather positive so here's a proper series. 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 DT maintainers won't like adding any "fake" nodes not representing actual devices, we decided to reuse existing PCI infrastructure. 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. Changes since RFC: - move the pwrseq functionality out of the port driver and into PCI core - add support for WCN7850 to the first pwrseq driver (and update bindings) - describe the WLAN modules in sm8550-qrd and sm8650-qrd - rework Kconfig options, drop the defconfig changes from the series as they are no longer needed - drop the dt-binding changes for PCI vendor codes - extend the DT bindings for ath11k_pci with strict property checking - various minor tweaks and fixes Bartosz Golaszewski (7): arm64: dts: qcom: qrb5165-rb5: describe the WLAN module of QCA6390 PCI: create platform devices for child OF nodes of the port node PCI: hold the rescan mutex when scanning for the first time PCI/pwrseq: add pwrseq core code dt-bindings: wireless: ath11k: describe QCA6390 dt-bindings: wireless: ath11k: describe WCN7850 PCI/pwrseq: add a pwrseq driver for QCA6390 Neil Armstrong (2): arm64: dts: qcom: sm8550-qrd: add Wifi nodes arm64: dts: qcom: sm8650-qrd: add Wifi nodes .../net/wireless/qcom,ath11k-pci.yaml | 89 ++++++ arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 29 ++ arch/arm64/boot/dts/qcom/sm8250.dtsi | 10 + arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 37 +++ arch/arm64/boot/dts/qcom/sm8550.dtsi | 10 + arch/arm64/boot/dts/qcom/sm8650-qrd.dts | 29 ++ arch/arm64/boot/dts/qcom/sm8650.dtsi | 10 + drivers/pci/Kconfig | 1 + drivers/pci/Makefile | 1 + drivers/pci/bus.c | 9 +- drivers/pci/probe.c | 2 + drivers/pci/pwrseq/Kconfig | 16 ++ drivers/pci/pwrseq/Makefile | 4 + drivers/pci/pwrseq/pci-pwrseq-qca6390.c | 267 ++++++++++++++++++ drivers/pci/pwrseq/pwrseq.c | 82 ++++++ drivers/pci/remove.c | 3 +- include/linux/pci-pwrseq.h | 24 ++ 17 files changed, 621 insertions(+), 2 deletions(-) create mode 100644 drivers/pci/pwrseq/Kconfig create mode 100644 drivers/pci/pwrseq/Makefile create mode 100644 drivers/pci/pwrseq/pci-pwrseq-qca6390.c create mode 100644 drivers/pci/pwrseq/pwrseq.c create mode 100644 include/linux/pci-pwrseq.h Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Neil Armstrong # on SM8650-QRD