Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp953084rdb; Fri, 2 Feb 2024 08:52:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGX/iDGNgbhhrl/bWkgxVToQCf3JZZwEkOFSv78r481x1IrejjzbePKH0yYeP35Jt5y/xJx X-Received: by 2002:a05:622a:138b:b0:42a:a9dd:3f36 with SMTP id o11-20020a05622a138b00b0042aa9dd3f36mr2858993qtk.3.1706892752594; Fri, 02 Feb 2024 08:52:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706892752; cv=pass; d=google.com; s=arc-20160816; b=cQCFFu9XwoRUnQFHdAEkfH+Wv1IUSPDmlZBFZ3Vfmfy74V3obY7RxspjYrAgWBTq9l Mak6WfKoV79Lqe0GDuJ+2rzEuYaldj2+lTo2GzC2a/MWeQynDylZ4AOx4xMJdiUCNcy6 WPVrR79/W7yFQ6Dutec1VuHf9EzNR1V0ITwGCwy1F24R1I5CC8Hb5K5t+CkwI99PWiS0 7LDzf15fT/2jtuwootOPhPp+O7buQGNvC9slWutJClfQPtkx1lJ595VgGJ+7aDnAJN8X r1AhptZDiubBV+rcw5K7Gzl9DeMicSlfg0EzwwXTEAZ+PnKhGW2DMgUh+7jQvQw/ImIE xUGg== ARC-Message-Signature: i=2; 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=9Is/nIvERCUaWb0stGen675avF2/xqOHspP4iuuDWVs=; fh=p5goEhjNEHK7ba09ZXj3cjDzykEFRKEe4CI6ncO45cs=; b=Gdvs0kF1+5EVGxiKI+eMsg5Y+5RBK1R2aD9S09GSiQ7UlEAAoQVwRk0mqxceTpqQA9 bpCbiTofdHIzZlS7M5zLP8v4/QfHZpt/iaiDZ1O6R/GDEo30DMxIUqHxYpbbLVnjSFDN zavmQ9g4Q9fZcnLeo5962HYFr7vqmEP32CAY6MNlDaQEWIHX73ZQCdMsFGg9uuAk4RdG jx6Yt94UXEFZlr8Ce3ljA+0J/L4yjhlp/bEPPq1Yehf2atb3hau2uR/3HwQGOezVT+yP A6oFkf1Rnh+bmv7unrcH2m13OWwgX+MNDWChpvcpBF91yT3AojwmCYYb+C6hDtBU6rvJ fbSg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f2D9EslL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50179-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWa4m4CP8pdO3cpQ34gcReQKZwN3r2OWr5RnRBoLm86ljGkaK4Eg6XS6iL982IVtzu+iGftve0vYLNpYW8OJcvv6Xpl0tnmePYKNQUOHg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id wg12-20020a05620a568c00b00783f7ba12efsi2329260qkn.675.2024.02.02.08.52.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 08:52:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50179-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=@kernel.org header.s=k20201202 header.b=f2D9EslL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50179-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50179-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4B8351C2753D for ; Fri, 2 Feb 2024 16:52:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2181148FFE; Fri, 2 Feb 2024 16:52:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f2D9EslL" 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 2DDB6148FFA; Fri, 2 Feb 2024 16:52:15 +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=1706892736; cv=none; b=msi8S+hEbvxEt3m6/f87l00AbL7gQdvMu/cZjDzUMqlj8LoUYYIxpW0mXxU2PFWzcDOxmJ9i9ij1JaZsJbWgbRLkHrkgYdz+SRLGjlQ+Jq1gMdRGAbDVWQjb4taRStSvnFpKD9aVzhZ0DdMBITp97486PwLac1x9HHizBAEICTk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706892736; c=relaxed/simple; bh=o6Wk5X1+6XzuAVSiW3qXZI3/x4eFqjgXnq87Cvd29GI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RtCb91fRUVqajnrpaQ8mpoiCY35U8T8pPscEXWaDjmmgRE5Keg5lzI8TOmU61kHf37d9HRYGdVfS5TVy4gKZ+04/lomprZhrd9RQGNsie80i0E0IQEpuCX9LmZkyWwbjevTADjaOfNLx0/caBBi4q0vJQrbQuxYNfI7EtxVzt9U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f2D9EslL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E628FC433F1; Fri, 2 Feb 2024 16:52:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706892735; bh=o6Wk5X1+6XzuAVSiW3qXZI3/x4eFqjgXnq87Cvd29GI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f2D9EslL+3JfRKRa4YVOQ6d3cpGJBLXuXVPoK7d3gweqK5VgBTvQvTMm2uTxWg6AF FsjPVQ23903rAzgBgl5LC+dLx7E8JI8a0il9LUcp5exeLA6UXPHIaTwBOcZXr3Wk0H 661iqFLChJGxHaRXPSNiTN6dEtPMs4YFlogPE7ooBrt6vw/g0iv9J50tlIBW0sNAlH QG6wEOudTpX/y3Ilp/dsZYX1XCfdEdR0GJxfyR4yrtOZMJColGW8gdbvr41Nnebooa BK8OadhTp8LBEa3R1tzpgx4xwZ2KXER3c2SW6NHaAaBia9jiZq6JjEGIsZ9rEfLmQE 5RZOmsYJmtOJw== Date: Fri, 2 Feb 2024 10:52:11 -0600 From: Bjorn Andersson To: Bartosz Golaszewski Cc: Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , Bjorn Helgaas , Neil Armstrong , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Arnd Bergmann , Abel Vesa , Manivannan Sadhasivam , Lukas Wunner , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: Re: Re: [RFC 8/9] PCI/pwrctl: add PCI power control core code Message-ID: <2q5vwm7tgmpgbrm4dxfhypbs5pdggprxouvzfcherqeevpjhrj@6wtkv4za2gg5> References: <20240201155532.49707-1-brgl@bgdev.pl> <20240201155532.49707-9-brgl@bgdev.pl> <7tbhdkqpl4iuaxmc73pje2nbbkarxxpgmabc7j4q26d2rhzrv5@ltu6niel5eb4> Precedence: bulk X-Mailing-List: linux-kernel@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 Fri, Feb 02, 2024 at 10:11:42AM +0100, Bartosz Golaszewski wrote: > On Fri, Feb 2, 2024 at 4:53 AM Bjorn Andersson wrote: [..] > > > + break; > > > + } > > > + > > > + return NOTIFY_DONE; > > > +} > > > + > > > +int pci_pwrctl_device_enable(struct pci_pwrctl *pwrctl) > > > > This function doesn't really "enable the device", looking at the example > > driver it's rather "device_enabled" than "device_enable"... > > > > I was also thinking about pci_pwrctl_device_ready() or > pci_pwrctl_device_prepared(). I like both of these. I guess the bigger question is how the flow would look like in the event that we need to power-cycle the attached PCIe device, e.g. because firmware has gotten into a really bad state. Will we need an operation that removes the device first, and then cut the power, or do we cut the power and then call unprepared()? Regards, Bjorn > > Bart > > [snip!]