Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp172770rdd; Mon, 8 Jan 2024 23:43:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyWIh2O+c8ZJnT71SqUuCxMhsJWz+3FyhHfBNpi8C9m3vWWInhdPuVSd/DkPJDzr+C4Q8k X-Received: by 2002:a50:9316:0:b0:558:40b:8987 with SMTP id m22-20020a509316000000b00558040b8987mr244141eda.16.1704786187863; Mon, 08 Jan 2024 23:43:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704786187; cv=none; d=google.com; s=arc-20160816; b=IUk5wjb7qh9EkUpqC8LnvKrNb1hgo719OitZsLZtxk39UgyI+B7NNbTn3N/CotmMN1 yV40iRyxsCbFBamQw4JykUDRUIEOfA3zBEoeI/Oh/8p+P8xQKcp43w0k2UbHjMchTJ6v qPgMCR2J7sUywsF6UEWINZ6s634UOr+Qdt1XBUyBn5kifEW0lz4dR2V1BtR9/3NhVrAF /my+v4jJ45MnVcBLBl7KCmE8GryiU0Qyc5neQhze5ASkrp81aDyJKEfU5sSkxTKV+enB J1Mcs1OMLyB2EZ2LQRFKujb9e5bM9OHXX5UbCEkAqgsSgtPbPwq2SQ/hSfaJalI0nPbk +UIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hbh9aOHx7+CSCvz+p9Wnk1Alp9/EgNmTd2TSmQXJErs=; fh=mf78LJT4rtIFH3wBA8K+fK5a5V0XeaNX31B0FpsG5IM=; b=R1dyXm14oOj4DPHFBP/uITkdN37aSEelB773nuMc78i84w0by7S2KNWL8mHfBdD9VJ hkOLqeWITBYgvkpRwTgMcZzpkjJrAY9Fe0XY0hgDkOhlcloqeSK7ejosoqm+rRHg3n5i zmPEjhlY0Ce502Nj5lSV2a65KZyCLcLbCULrKLgfAGv4XLR9Nsm+DmBao7wnvGlYtrt2 OuXRRg1Acp2GEb3RtRdYjryVWeN6NALsjqcjBBIzaKjhAHyEnw/X0IxXWkwPwgijry9V ulNSed4p84vuU71KFoCjMCvj442F+bHu1BHVsrWgmUxzhwcZjmFFU9u4bi+qW5epVTLC /6mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rzR+v8jR; spf=pass (google.com: domain of linux-wireless+bounces-1617-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1617-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m13-20020a056402510d00b00553fc60e8d6si578735edd.617.2024.01.08.23.43.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 23:43:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1617-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rzR+v8jR; spf=pass (google.com: domain of linux-wireless+bounces-1617-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1617-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 406131F21FF7 for ; Tue, 9 Jan 2024 07:43:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05882B652; Tue, 9 Jan 2024 07:43:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rzR+v8jR" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (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 83CCC9471 for ; Tue, 9 Jan 2024 07:42:59 +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-pj1-f44.google.com with SMTP id 98e67ed59e1d1-28c9d424cceso1812591a91.0 for ; Mon, 08 Jan 2024 23:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704786179; x=1705390979; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=hbh9aOHx7+CSCvz+p9Wnk1Alp9/EgNmTd2TSmQXJErs=; b=rzR+v8jRYlcV6Du2wjV9SWn/leGlSxC2xqyL2rlmiqdSltIK5DjRyYmjpE/pmpJK+O sydKGwyjCh4x6VFYcjoKMhTXDZlJj9k1+ttsomsQxlGv2k8mI5j1nqlxeGIGORjfPq7d JLhDFFHFU1d957w5czZAy/H68MUIK7COMZsSXXn2w2MlrFxq1ERIoWZUfrw3QWfiPdPp U6QWmOWa6jDNlPT0zVTjRFzS2vZWeh/GfW125WTC4ltk7LQ5/Y6R2Xm5zsxLEgGGNpAP d3jQLu4SHPkh+dju8hNV7IiQDsXDzOFzKxRRWlk1pjj73nn/0SiobOs+x7MwDNEyxTaa +A6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704786179; x=1705390979; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hbh9aOHx7+CSCvz+p9Wnk1Alp9/EgNmTd2TSmQXJErs=; b=HD54RJa+ZYKxJxeHb0hS7AWnnULjqJa/A5cwwx7eaCYtRCTO77ZL7VM+bdQULONofu f47VPiDs4/nNOEqpapaHn/eK76tUl2KvpcqfItsxseab3qmW3AZx5heSsn9tCd8IHJN8 W5KY+MeD18jUhgApkAqH4sdvjnOdb0qizPm67KR/nGBdHBT/kSYzPjkMmoHc5lbkpMzz FSKEY9ZDrDii3IJetDNG595eKRlzepD54nN428YiGN0IJQWYXz2hD/X5FW02XYqvXa6u nirYF1Yjf4x8l+5UVocmH9N6QDXYsHABmStRpuFQmq4uShwNoPdo1s5pSqxeiC5J9IvU R9kw== X-Gm-Message-State: AOJu0YxIEjfDpTF2IZTmpRQndrPGkMmDceJKstSdc/c4FoRawoyHujLX molJ8QavLmRs1tXl9sJA2COzSmxFK/Ze X-Received: by 2002:a17:90b:f0f:b0:28d:9b5b:e70b with SMTP id br15-20020a17090b0f0f00b0028d9b5be70bmr429191pjb.0.1704786178748; Mon, 08 Jan 2024 23:42:58 -0800 (PST) Received: from thinkpad ([117.213.102.45]) by smtp.gmail.com with ESMTPSA id g7-20020a1709029f8700b001d425d495c9sm1083349plq.190.2024.01.08.23.41.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 23:42:57 -0800 (PST) Date: Tue, 9 Jan 2024 13:11:24 +0530 From: Manivannan Sadhasivam To: Chen-Yu Tsai Cc: Florian Fainelli , 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 , =?iso-8859-1?Q?N=EDcolas_F_=2E_R_=2E_A_=2E?= Prado , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Kuppuswamy Sathyanarayanan , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Jim Quinlan , james.quinlan@broadcom.com, 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: <20240109074124.GA3303@thinkpad> 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: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Jan 09, 2024 at 03:08:32PM +0800, Chen-Yu Tsai wrote: > On Tue, Jan 9, 2024 at 12:09 PM Florian Fainelli wrote: > > > > 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. > > I think the current in-tree approaches mostly target either PCIe slots, > whether full size or mini-PCIe or M.2, or soldered-on components that > either only have a single power rail, have internal regulators, or have > surrounding circuitry that would be incorporated on a PCIe card. > > These all have standardized power rails (+12V, +3.3V, +3.3V aux, etc.). > Right. But ideally, they should also be converted to use this power sequencing driver at some point in the future. > > 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 don't think it is necessary to add PM support in this series itself. Even though PM support is always nice to have or even necessary for controllers pulling the power plug during suspend, it makes sense to merge this basic implementation and add features on top. It should be noted that both the controller drivers and the power sequencing drivers should be in sync during suspend i.e., if the controller driver decides to put the device into D3Cold and turning off the controller power supplies, then this driver should also power off the device. But if the controller driver decides to keep the device in low power states (ASPM), then this driver _should_not_ turn off the device power. Right now, there is no global policy for controller drivers and each one does a different job. IMO this should also be fixed, but that also requires an agreement from PM folks. (Well there is one more entity in this loop, PCIe device drivers... sigh) > > 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... > > We can have one "generic" slot power sequencing driver, which just > enables all the power rails together. I would very much like to see that. > Yeah. And that "generic" driver could be used for simple usecases mentioned above. > I believe the power sequencing in this series is currently targeting more > tightly coupled designs that use power rails directly from the PMIC, and > thus require more explicit power sequencing. > Precisely! - Mani > ChenYu > > > > Thanks for doing this! > > -- > > Florian > > > > _______________________________________________ > > linux-arm-kernel mailing list > > linux-arm-kernel@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > -- மணிவண்ணன் சதாசிவம்