Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp381781rdb; Thu, 18 Jan 2024 06:29:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwYse1g7nW8zN4C2Yc9wBFrk6vkMBZ2Qn/b+nGu6neqn0A12NnnYUpdOSvF9t3VfOosWA4 X-Received: by 2002:a92:ddc7:0:b0:360:8ea0:e3ad with SMTP id d7-20020a92ddc7000000b003608ea0e3admr870765ilr.103.1705588195521; Thu, 18 Jan 2024 06:29:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705588195; cv=pass; d=google.com; s=arc-20160816; b=sbGDUUvBE4MaH21G3ZIY8GmH1M2ADOo50lfSeLCAqKJ13red09TWIRMXXypTyO9hVz vIg9WLt6jp8APOBcKXKhb/i2UaLcT4P8bqFhIBD+56Q2YIeIoo/OTFSVJOQJowDPT00W TyhjgKoEm15FH0x7BREnBpYiQ8/3Uo371FP7VNBCHqDi6WlTFgHE1u2oB7OO01/NbRZS OtKxSj8L7aoXS5jcW5pFv+N8P9bDakk+prV7R5HqU7svVCJOAp+VdFf+Y9ICzqdppj7B Q6n7g24dH3fFpyDZgiBmXgtgRk6uu2/CAgsNggWfRMTNTtgbhkDT2ucaOlHrihQ8tXCO 91QA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=iPGPVXXwyd5DFSfC8msMPU1CSz0Q7jm4kMOswDCGfn4=; fh=TwWd0aZN+s/GsHtRxmp+juW/YhgRbLyWCmzViwm/EaE=; b=v9dQBW5AcNnCxz24GBfluQs6obvewoPb1sAwldBLviIncBbiLhYBpT3Yh7zQmFCmsR 8rh1oKyMzMle0q9V+ygEPs5OWekQtbdSXLuB1sSLNFm0OV/9S1/p/N68BYOA2BMAJWJ3 tzLmXo7MLx+fkOV3iT0HwY2cDDsl4DErvm6Uvm3F/omH8u4CcD1A0gwp53nqaTQfkF0z beXhsunBblzPjuN1Knxaa6lqI9+tR5HahvjVFOXot7j7EdMpOWIH1RLV1iRXd5tdWHOK 2R+Z9KcwuJDm/UHAqUrugNBdiGvkCsKevoChHYIRbtnP4sXgAyb75tiqsR8PBKSNWV8w gtaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VsdvZXqg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30196-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30196-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m187-20020a6326c4000000b005cdfdfccfffsi1561356pgm.403.2024.01.18.06.29.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 06:29:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30196-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VsdvZXqg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30196-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30196-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2BC1A28A7E2 for ; Thu, 18 Jan 2024 14:29:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B044128DB6; Thu, 18 Jan 2024 14:29:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VsdvZXqg" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFFA52C9D; Thu, 18 Jan 2024 14:29:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705588175; cv=none; b=u70VFdKdP4AofmIcGxfRPgoo4XFQzWjIAeKl4xbuQlONN9HYNZBnJ5SytTMa2PazJtvlFsqTUlPfgx4ZW2Zb7qKi2Z/Sg8UpwRVHvBVHgvQNx9LLTP8I6Np6qqtwoW6/TDYiQl5iXjh1QqFBvmaw3wH5jtPLwHmUEV6hIHDeWSk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705588175; c=relaxed/simple; bh=iPGPVXXwyd5DFSfC8msMPU1CSz0Q7jm4kMOswDCGfn4=; h=Received:DKIM-Signature:Received:X-Gm-Message-State: X-Google-Smtp-Source:X-Received:MIME-Version:References: In-Reply-To:From:Date:X-Gmail-Original-Message-ID:Message-ID: Subject:To:Cc:Content-Type:Content-Transfer-Encoding; b=ip9Lb9o5+v/xopGfYyqJRx92WpEtbAG+CrCRt1RuFghv+Dgep6PKtKedvtyfUJyKifPt/25VlEbnfDlnlNiZuH/mP8/OP1NSc3wB9gdGVYW7EFeYtcs+ihvgPN8TtvTtactFfPYCk8w3+B3f/v9/yNK0BPGY76IEF9nW20RmQjQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VsdvZXqg; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52F12C433F1; Thu, 18 Jan 2024 14:29:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705588175; bh=iPGPVXXwyd5DFSfC8msMPU1CSz0Q7jm4kMOswDCGfn4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VsdvZXqg71HEfgsj0TMAnjwKaNJMB8YfV6RHoZIdngwczm2R9BalAiS5dSBxF/NrL erLZWbXItZ4BJ6n81aA/hPD0PYCZm6fEu12ayLT9FZfGysL7vb2J3y09rJV1X4911/ MBEXc9UdwGEo5F/NM5qneMKqNPWFdbpUWfna3Q/ATOmcFlFSvJ2ZCnK33394PoGWWK 0amzGNrDh/+luAUELiD7dijo+uyMJYTqc79GJ+76E/xh/UgqUBpv1lRLL3oqgVICPv asLg/+x7hG0hL+vbHXy42so1VIPsEp6KBRMfkbqOXFA/Jh9AV/Vi2eFCKuWmkZUqoH m8Kn5sBfqvM/Q== Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a28f66dc7ffso150582166b.0; Thu, 18 Jan 2024 06:29:35 -0800 (PST) X-Gm-Message-State: AOJu0Yx7lQmVM/2uB32FZsOLjE6ponPfM/bNQEmtmqIkOCd2+SmISR63 6RSy8Zea6NCZMIW1YPi39cIitzfw1Q4F9wadORGJWte8rkb9J4aX2EVxDFYWrC8/a957ZoHOYAY pJZJImWuYEM5jALqfFzTTmpBxIQ== X-Received: by 2002:a19:644a:0:b0:50e:e1c3:f97b with SMTP id b10-20020a19644a000000b0050ee1c3f97bmr1677678lfj.3.1705588153618; Thu, 18 Jan 2024 06:29:13 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240117160748.37682-1-brgl@bgdev.pl> In-Reply-To: <20240117160748.37682-1-brgl@bgdev.pl> From: Rob Herring Date: Thu, 18 Jan 2024 08:29:01 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/9] PCI: introduce the concept of power sequencing of PCIe devices To: Bartosz Golaszewski Cc: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , 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?B?TsOtY29sYXMgRiAuIFIgLiBBIC4gUHJhZG8=?= , 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 , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 17, 2024 at 10:08=E2=80=AFAM Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > The responses to the RFC were rather positive so here's a proper series. Thanks for tackling this. > 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. Thank you. :) > 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. Suspend/resume has been brought up already, but I disagree we can worry about that later unless there is and always will be no power sequencing during suspend/resume for all devices ever. Given the supplies aren't standard, it wouldn't surprise me if standard PCI power management isn't either. The primary issue I see with this design is we will end up with 2 drivers doing the same power sequencing: the platform driver for initial power on and the device's PCI driver for suspend/resume. Rob