Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp103430rdd; Mon, 8 Jan 2024 20:08:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqODC7CBBxUjq/YY3bfUso6C1zgLcaL1yGObOcVv2AXRB6zhoQctl8G+tM6udcswSGXHsx X-Received: by 2002:a17:902:ced0:b0:1d5:36bd:fab with SMTP id d16-20020a170902ced000b001d536bd0fabmr1936126plg.70.1704773334900; Mon, 08 Jan 2024 20:08:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704773334; cv=none; d=google.com; s=arc-20160816; b=NTVKYR9tvWGiskTwvz4SktJg7RC+9sfmRPSlSKuqR4VCj7ymYyxRYSrpP8MpS4gYNx 1maVXYbZL62AvP8T+AP+Dat1b5gf0CghnKX3nU8ahRnM4pd5eNzsmUwRaW2bnas6mfrx EuIDQKyEsto3+9HMd9qw6Nj4A3GVdzK2ZGmXU1SJ4jdheCmFIGywjCCLcoWJ6fWQ5pnd LOH6VY79sEV5u52C7ipHNkwQ/AcN1unjfjAWzRMTEpRw5M4TeJ3mOjb+ZfFgMZ+oVwbz SsEAy9I4b0boYXOBq+PuvknfjJpCQG+nHXKMRD5Zp+ki6FGLV3cBacNL4EL6FIfwcPtc QuTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=I/XC7+Hzrqaul1JzDjqFzwqKQMzBB3vpvjl8qHZ5in8=; fh=/1oa8PCRA/ZUuNzHV9zc6jVIWdqyvCAaHQa1UXqxKJ8=; b=ViNX495bnGYK2PK3q9B/EhO4vc9g9yT8eNRKMC65EoIuSOpi9UhNh/dWZMFF3q9GxM KFf8W38kfHDgDjCVFzV8Mt0p1U9PLdS8LF6pWYlcFXNG4HMzWAM65TKl1DTC5Ewzk/gQ v5Dbu2Wj+zQ/74YU2LpkcyG17Z6r0la/soflfKHEoz3J/IJC1eOnRXjYSHuddAdSgUIo lXJbh1kexkXBzr9FT2i2EjZnPDI7tvAWMU3qHb/W+A1ulci+mKLpE7Zm+s+ZBIf3mlxT EZ/N9DyyVdkldFvgzlQWisq8EezLAG1f2NVgfcK8j8/G0WV4SOn9np0n5t11dUbAle0U FdBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mzQpVpKe; spf=pass (google.com: domain of linux-wireless+bounces-1611-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1611-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l14-20020a170903120e00b001d4bd22adafsi861373plh.318.2024.01.08.20.08.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 20:08:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1611-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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mzQpVpKe; spf=pass (google.com: domain of linux-wireless+bounces-1611-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1611-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AAAFAB2324F for ; Tue, 9 Jan 2024 04:08:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0F6D568B; Tue, 9 Jan 2024 04:08:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mzQpVpKe" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 72CF813AF8; Tue, 9 Jan 2024 04:08:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1d3e416f303so7056215ad.0; Mon, 08 Jan 2024 20:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704773318; x=1705378118; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=I/XC7+Hzrqaul1JzDjqFzwqKQMzBB3vpvjl8qHZ5in8=; b=mzQpVpKeXwKSKcLWKuNiVogLVrykrSt+T9LetCfOZdRtvCZEodDvqYjY581i7y5Vu/ 6bgdpjnR4R6AWDeKAG07+BtF2VyDe1J13/De7jLDPBRsLBnQqjPu3LrRrzMSqN3iug51 T02KBWeNwZk2ntZAXW51sfabCLnavW9Rp8k2KEz5uE89yWg/9BOwgvb6huoby+LwTUny TjBIWpeR9Xyrzcfx6bOMTAu2Cuk0m7ZmDK7Ar3kVmKoSwYeBglmVEc5ZbXGnrUZp94PR VR1WfYEKtStPNx4ecMRK3tb/Azk6TvJKKJypAHKJZdmoEe1fDSCGD3PlGe9IyRNMmCfI Buzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704773318; x=1705378118; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=I/XC7+Hzrqaul1JzDjqFzwqKQMzBB3vpvjl8qHZ5in8=; b=hohrWUeNRgY+MVbEFwWM9ItMTuLR2pqP/Qdapj/sR6DJO9CiRmNsrEi1UDySHJZVVT clwajkP9RLspWFj62wttbC8xBaIaNKszOhwFbB0lR3n2mHquLcjCSlFt2jkTZ5Emg5/1 D3HE0d4Yailxth98CiLKjJ646PrZrTQD9wVH4G1FgLD9GyLl4cZ52U+dQwukoPxewYWo R7x8BrgeDcVpzhSDUA5KYU3KcqMwVTJcLJMxi+DSdsbHe86CuZ5o90jr2y03yVcdnI/D tSdEt1sKQdtQC3qU2HsUjk1/9ial+BVtHVOi7ogLIwvGIyAIuoYAB9/R9TJCKFZtyAc2 9XUA== X-Gm-Message-State: AOJu0Yxa6XUBETVailmVRUk8oVO8q4Y0iW4BxY0kTUWg3zJjMhHLf0pO yhxBn8x4Q0f9jBc2YHJYtGg= X-Received: by 2002:a17:902:dac8:b0:1d4:524d:96cb with SMTP id q8-20020a170902dac800b001d4524d96cbmr2692987plx.109.1704773317516; Mon, 08 Jan 2024 20:08:37 -0800 (PST) Received: from ?IPV6:2600:8802:b00:ba1:c927:f415:d49b:1377? ([2600:8802:b00:ba1:c927:f415:d49b:1377]) by smtp.gmail.com with ESMTPSA id z3-20020a170902834300b001d1d6f6b67dsm651885pln.147.2024.01.08.20.08.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Jan 2024 20:08:36 -0800 (PST) Message-ID: Date: Mon, 8 Jan 2024 20:08:33 -0800 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 0/9] PCI: introduce the concept of power sequencing of PCIe devices Content-Language: en-US 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 , Neil Armstrong , =?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 , Jim Quinlan , james.quinlan@broadcom.com 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> From: Florian Fainelli In-Reply-To: <20240104130123.37115-1-brgl@bgdev.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello, On 1/4/2024 5:01 AM, 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. There is prior work in that area which was applied, but eventually reverted: https://www.spinics.net/lists/linux-pci/msg119136.html and finally re-applied albeit in a different shape: https://lore.kernel.org/all/20220716222454.29914-1-jim2101024@gmail.com/ so we might want to think about how to have pcie-brcmstb.c converted over your proposed approach. AFAIR there is also pcie-rockchip.c which has some rudimentary support for voltage regulators of PCIe end-points. What does not yet appear in this RFC is support for suspend/resume, especially for power states where both the RC and the EP might be losing power. There also needs to be some thoughts given to wake-up enabled PCIe devices like Wi-Fi which might need to remain powered on to service Wake-on-WLAN frames if nothing else. I sense a potential for a lot of custom power sequencing drivers being added and ultimately leading to the decision to create a "generic" one which is entirely driven by Device Tree properties... Thanks for doing this! -- Florian