Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp199563rdb; Thu, 8 Feb 2024 03:33:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6D/Rd8ndJ+krBsaXWbGgaKtwau4OZy2PT0PTyKZp47fzFa1l2nLNzjQIYQPZPYGOKhUga X-Received: by 2002:a50:ed12:0:b0:560:e621:5f2f with SMTP id j18-20020a50ed12000000b00560e6215f2fmr2997427eds.31.1707392010207; Thu, 08 Feb 2024 03:33:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707392010; cv=pass; d=google.com; s=arc-20160816; b=mhMSYLydVkNQG3ArF0aaeWBEupAgbU4PAeyz5mHu1jyESEu5+t9XjvERwK/XkUh8ep cN7T4GKFblkXJUrKLmPI8y8g5JKPLghY37wMq1+V4lcx0giTvNAcBb0Z6N+rpMDTrtBV yMbICOQv9lOwwFkewby7D81k3CRJRQPMOplPQGxZpdPEO3qJLDiq9G20cWm2kVuPsUBh AaUz+fWEb0pe2x3fKalAIGap2xCkkZaDaPlmzDzSY6cCXzRTJeZbMUdG19HE9mU9G7pG ZUoDU/7gbig4jm5/h2v6Bs1vjfzSQMnwccXsTjR4LXIC3Uw98HlHdqgq3ovF9f9Voc8P ISNw== 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=QrqnWJBCStSighyWOa0xUBH8klKPMNqoWtIBHxqzEbc=; fh=MWd+uqUmb4W3I+p4xir47IaqXuggJLlGZ1chRp4mj6s=; b=OzEVBDsiM/Dqaaucr7zGjD0C8sPNoksHnW4Lb8JueraVdLVzuWIXWPBHkNUmLoFpE6 Cc1uZQKbabdCDYTz2nRwV3mYqvJF/65Pz25/zNBGmXBJmY+rH5Qoj+wDWwP0+ESK5/Tj 9ECYEnzEikalNbumRpQY2x4EXv7jGnI/UypVNGz/2MZn72wvJT2sE93V0fcjEaQsyDpT GN4g2M0ZZPVn/5g6p0gzsoPb3zOXCeMsqGNgsUuXZXXDJwr0XWnKF8uvVvBNGZ0qdt/D nOnR8knzXE7+5fY96WQSRQ8VnfmvuczBBKOHgYTiLzpdlQIeIInlhjyyHnD3DJruXLGz Qu7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lcDdQ1ts; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-57964-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57964-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXh9R4BIVLz0tH8gTLw0FjQ79h7kR30XTLnlm4EjgYW6Q8ad2bC0B2fx96K5UNz2j0QgEIUSDnUd9i8cBBKOd5PEkgHBYKYA02pzN4Cig== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h13-20020aa7de0d000000b0055fd0df0b50si786244edv.214.2024.02.08.03.33.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 03:33:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57964-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=@kernel.org header.s=k20201202 header.b=lcDdQ1ts; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-57964-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57964-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 am.mirrors.kernel.org (Postfix) with ESMTPS id EB52F1F283C2 for ; Thu, 8 Feb 2024 11:33:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A707D7602F; Thu, 8 Feb 2024 11:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lcDdQ1ts" 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 AABF974E01; Thu, 8 Feb 2024 11:32:12 +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=1707391932; cv=none; b=sr6+85z/A9Q1kCbg6V53wAH906/nCVSEhw5joRBH4DA9QmJiVVrx+AbEU9JuM26N4exY3saw6i/Q53HLF9X8nZ911NYBhEOIGO126AV0E7altK0WUVOijaKk7orL13/WT/d6krfkUIdCf6ny/8xjPm+6xqF7myKZ8Wr4BFhBhdE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391932; c=relaxed/simple; bh=c9feIDL+wPu/P9Bna8cXPwQm7UA/Zrt/xWP3vAOeFJA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MKJfjefEXgmJnBX4Tau8VhRNIPMoSw1U6jduvvYUbkshDNbEZ3Vhz6mmjJ5OC1Wi/Xj1GvXh05B5FZbke1SjRFHVjoePuSexj3/L2Hts8p2lY2pSQEAZ2QfipTvsM88klrYTGIO6pNtVMvQsdrJtq+IAEuOuniMI785n04H/kKM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lcDdQ1ts; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 200A5C433A6; Thu, 8 Feb 2024 11:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707391932; bh=c9feIDL+wPu/P9Bna8cXPwQm7UA/Zrt/xWP3vAOeFJA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lcDdQ1tssINDor/7etReaO6E+9DfS2U0syvI4DfMpqc3+QOLm5aprQYxRD/6AK67M +bEsLNXQAMBw4VCZTq9Zu5niqscpAGJCnGO4WBdTewPVexU6muSYVo8Ej/FFQsHn4C fl6XQCdSrir1oEEE99jplnpAj32ST8aBicm0HTb/W1Ttbb+AcEvynDNvcqhfgJGFRU Ah4wbmaRVjvxFrISW7ADjV2pvNrQYeP8iBbObZ9ohLM3Ty4qQhVdKcYCf+5jE/IUFu 0bbyptByWK1UMrkv9KBxSmXcKkkV96jpUkrAMw+/yHOj55NJS7EUx120sUZbZRkw8p KjkOCp3oPkzjg== Date: Thu, 8 Feb 2024 17:02:01 +0530 From: Manivannan Sadhasivam To: Bjorn Andersson Cc: Bartosz Golaszewski , 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: <20240208113201.GA17587@thinkpad> References: <20240201155532.49707-1-brgl@bgdev.pl> <20240201155532.49707-9-brgl@bgdev.pl> <7tbhdkqpl4iuaxmc73pje2nbbkarxxpgmabc7j4q26d2rhzrv5@ltu6niel5eb4> <2q5vwm7tgmpgbrm4dxfhypbs5pdggprxouvzfcherqeevpjhrj@6wtkv4za2gg5> 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: <2q5vwm7tgmpgbrm4dxfhypbs5pdggprxouvzfcherqeevpjhrj@6wtkv4za2gg5> On Fri, Feb 02, 2024 at 10:52:11AM -0600, Bjorn Andersson wrote: > 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()? > Currently, we don't power cycle while resetting the devices. Most of the drivers just do a software reset using some register writes. Part of the reason for that is, the drivers themselves don't control the power to the devices and there would be no way to let the parent know about the firmware crash. - Mani -- மணிவண்ணன் சதாசிவம்