Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1694044rdb; Mon, 8 Jan 2024 07:25:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFILn2x4L89k/kO0LO0Hx9BZ4LiORjpwDM2E3bvX5cjYDkZig7+quGugmibPeHRYceA575e X-Received: by 2002:a05:6808:640f:b0:3bd:336c:ddb with SMTP id fg15-20020a056808640f00b003bd336c0ddbmr1189247oib.112.1704727516753; Mon, 08 Jan 2024 07:25:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704727516; cv=none; d=google.com; s=arc-20160816; b=X4EJd5iRRKuYTTUPiUmkR51dKof36EunzOBxWvjZ0VnFFm8z5FHozeFdA/ULlR2JYR +ljg0Wtde1+wpuyk5J6BpQz/ODzjG/3vmx4kRWCOSzs8iyf1C9mqvuZ7G4YFtkZPTaqF TZAUpiB3dB6fx4YWdJB/ncMiSwq8uKQ7qmPzT0pU+XHpHGudbTU+2qgAMK40Gc0/7rIC 3iKdEMjrIDSLC3Cr/mRMM3gd2BBzzImW/5YD6HRV71ZsYCfThaQmWHYExTLE5X/VeV9b kSVOb/lIxgwvZ/Gin9Pn5nKjoak0C4WS/aMX/UQlQwf0GEgTwa8WQ58OkOLgXO5kKJ5n 46ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:autocrypt :references:cc:to:content-language:subject:reply-to:from:user-agent :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=VDfXxaJLBdAHE/PCKaUTkc4Ha2Yd2YR4JkUzxupj3v0=; fh=NFdJk6hegdmV4eRznp2Tjan3qB/eR6bAxpYfGqcnZnI=; b=snD27Y7UQqigRgcVU2BAr0z77+wT99pQEREdASkQMqIMdohBTyim7tgryNAC4s12Jp XrP71OhEvUptJzgQmVFKyzseRx9Y3SSWVu+LHlBY27CanKUPfF5Hls+cpe+lObvjM3RC 9kJztIQGAY03/gmfJPPzMAxBofON43BsHcgK1QfPDERwPPY2Hi189Vdd6f8tskkMbMt4 7h9eGuel4CexCbXtmQvd4gUp827FHaaWURNVDlGdW6lG4ItNsFM0w0QoKxaMBoNCGFo+ C0h21mc433otm7vpkAs0ckOHASdEdEQS6EA74qLJvAGtQGrcyKf2bW+qEs85iP2GntlM 3nYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HfRsZzVp; spf=pass (google.com: domain of linux-kernel+bounces-19758-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z20-20020a0cf014000000b006805f4f3d15si85321qvk.486.2024.01.08.07.25.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 07:25:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19758-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=@linaro.org header.s=google header.b=HfRsZzVp; spf=pass (google.com: domain of linux-kernel+bounces-19758-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19758-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CD4051C21F14 for ; Mon, 8 Jan 2024 15:25:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D30875100D; Mon, 8 Jan 2024 15:24:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HfRsZzVp" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (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 B5B555100F for ; Mon, 8 Jan 2024 15:24:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-50e5a9bcec9so2273942e87.3 for ; Mon, 08 Jan 2024 07:24:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704727486; x=1705332286; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:autocrypt :references:cc:to:content-language:subject:reply-to:from:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=VDfXxaJLBdAHE/PCKaUTkc4Ha2Yd2YR4JkUzxupj3v0=; b=HfRsZzVpwz7gN1C4c+TM9/cOZ8kaQoM3VdD27geWtxvv2YEovQWTC7auApwsG7sQTI HZTqnrBTHyTfDORhzOjlkSNGvlawYk51wrZeucPuXF/NFwU2QDaNfsKPiQlGdws7oTFg CFLv+02uUINvfdMlN/MTAnVS50d7yAf6pWGVIhaDpRfTurt4yHp6tVhy4XcETpAJT/Qm XzfCzooqf0khLb+zcDw2fXgNkojc79cmcOQbuRwfreTuzMTszmtICANJl2V/I29HZttg y4YPX2aLgdtEJwW8D08E8CI4i+mim1JJMOzTv+E1zIcQEFPiRQ9nAt7ULYPptKvP1g+u VPlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704727486; x=1705332286; h=content-transfer-encoding:in-reply-to:organization:autocrypt :references:cc:to:content-language:subject:reply-to:from:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=VDfXxaJLBdAHE/PCKaUTkc4Ha2Yd2YR4JkUzxupj3v0=; b=GU1/Q4Gw6eNTJyKvtRcVcignu3tm5L2tIAou5NK5vf+dxj/2XwPOqAEdiqDV2+yecy QMPxYMcAcAdWDHtnpK4w64t21Sgp6vlvjjqOPBFXzASN/M6H7sGXNkRbXtWO6H8nENQX A310/+CTz0lArRhteuj59KQwXeeo/4lcwD6KAAcSQsI2gnmAXFeNaT3y4wNtrz48Gpg6 qm8Smrj9BIaU01BJuEsHxLQ3PXjWPq90MAaziXOAGYMt5cV/0J/F69PeFNSH7Pw76tPN 6UFTyZmTZXwuyjKcDfUjD+DnNCXwwE90HkUpc7mEmf5zw2nwhrjXE6HASCvWm9Mf3tIo jPhw== X-Gm-Message-State: AOJu0YyEV9OxaMkSivTBnMzicKI1Bd5olcM9+1jg8sWL4DonvUGgO2f8 tF/OE/YRAu3H0PqAKgZ8LPjiCQ0E0g3kSQ== X-Received: by 2002:ac2:4822:0:b0:50e:6ddb:551d with SMTP id 2-20020ac24822000000b0050e6ddb551dmr1425719lft.73.1704727485712; Mon, 08 Jan 2024 07:24:45 -0800 (PST) Received: from ?IPV6:2a01:e0a:982:cbb0:32b:5e85:79f9:3fde? ([2a01:e0a:982:cbb0:32b:5e85:79f9:3fde]) by smtp.gmail.com with ESMTPSA id qu27-20020a170907111b00b00a2af877a85dsm457794ejb.6.2024.01.08.07.24.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Jan 2024 07:24:45 -0800 (PST) Message-ID: Date: Mon, 8 Jan 2024 16:24:40 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Neil Armstrong Reply-To: neil.armstrong@linaro.org Subject: Re: [RFC 0/9] PCI: introduce the concept of power sequencing of PCIe devices Content-Language: en-US, fr To: Bartosz Golaszewski , 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 , =?UTF-8?Q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Kuppuswamy Sathyanarayanan , =?UTF-8?Q?Ilpo_J=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 References: <20240104130123.37115-1-brgl@bgdev.pl> Autocrypt: addr=neil.armstrong@linaro.org; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98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FjwB0b6a12opuRP7yo3E3gTCS KmbUuLv1CtxKQF+fUV1cVaTPMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro Developer Services In-Reply-To: <20240104130123.37115-1-brgl@bgdev.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 04/01/2024 14:01, Bartosz Golaszewski wrote: > 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. I've successfully tested this serie for the WCN7850 Wifi/BT combo onboard chip present on the SM8550-QRD and SM8650-QRD boards and it works just fine. Here's a branch with the wcn7850 vreg table added to the pwrseq driver, and the DT changes: https://git.codelinaro.org/neil.armstrong/linux/-/commits/topic/sm8x50/wcn7850-wifi-pwrseq/?ref_type=heads Thanks, Neil > > 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 >