Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp603551rdh; Wed, 14 Feb 2024 06:29:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV2xXhZ+iV5Zg7LP4Lg1PDDPyTRL/hPOUnQSheEKJytHPFWeI0zoatY1jeipBuBiVIHtx4184GkHm5UDoSnppPVEbhNuyB/iKbqIWZjWg== X-Google-Smtp-Source: AGHT+IH5Zr6hll2DtkJjilGIiONezZpV5o01Ut3VRXW94D1b5j6Uhky+uhKt/A34v3tA3sinkyyY X-Received: by 2002:ac8:7c7:0:b0:42d:bf79:52f with SMTP id m7-20020ac807c7000000b0042dbf79052fmr1344189qth.48.1707920965623; Wed, 14 Feb 2024 06:29:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707920965; cv=pass; d=google.com; s=arc-20160816; b=KP/NMJrWqEFHoI5cIAWt83cLnF997pcfWsNVfEQgUrAdbN0r333pcQta0YZjuDmame 5iz23plNU7sp7nVy+bFC39sJ6Gcyd1zQHmoV2Q9xxIpsNqGNExYGYZ91XV4dc4dlfWLR xIqwCA8fGBVpTeHWe6GxEQ7gaNnlZWgteTKA1kzHg8BWCjK4D4/uSo+43TPrxrPUKlJn W4yVjGLQNKD/00b1SE6b1RzhmncGo7T3IgF8cPL1uwdzOwkKdN+mbbpMVl0nX9O7TD1e UKYzLX3w6VSCEjVw/RTGohvmfSLAaIGVw9xTUSWQdgPLn0HEd2WKrYYCj+HCXvVQgnJk 70jQ== 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=fCvrusmoOu3h0UYnOR5F6LGjb8RcuqOaf0rb/Qznj/8=; fh=4+m1Aae/y+ysiRKTymi+fYlIHdbhtEmsZD+uKv3YdrY=; b=xGjpFcecHF6NVKT5CvIt+j/Y+OIZvAoIWuCoFwoGj64Gmc+AWwPTVb5TsfjkM/zStF htESj+9GcQ8LSpp0C4szmuqFk7oorj4/pGd6ufm5mtdnkZCb9SW0P9XkA6g781UJlFYx lCAZslWiB5kLrWrZQ2k7GZ4b/xzdi9+V/X7U0SYBfXKEwgQdJ5GbeOdb/Zcs7lxWVHHt ooXXKvOdC3p5wV3FPfiOfmf9zAI3NMEGGGtVuFTqRRAU8lIzHnOjj5dibwWHLxFVPqSp PqDKv6qXUGuEpu/a/6ye8/wID6eE8lFxi5AvtvwP7rzhYmbRjSzrdrCyqwCjKFcqjosH XrkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hVXjPJU0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-1854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1854-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; AJvYcCUD1pN4t5GHsfrhzrOjExjdLbsfiBZjsoGIyRPuCpI4EATV42AdIOR7TNcR9KznTr/0+guqYF1ni8/WDMaFqcLGNS/8nfIBT8HcHU+e1A== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j10-20020ac85c4a000000b0042c62a8cd8esi5898539qtj.374.2024.02.14.06.29.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 06:29:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hVXjPJU0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-1854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1854-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 63A751C20DC8 for ; Wed, 14 Feb 2024 14:29:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03DFD5810C; Wed, 14 Feb 2024 14:29:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hVXjPJU0" X-Original-To: linux-bluetooth@vger.kernel.org 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 4EE5454BC9; Wed, 14 Feb 2024 14:29:07 +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=1707920947; cv=none; b=YlaVR1nH4Qm95VwD6+FKyRHA1w+XgDOpdYgL7MpnDeSaHmdIHw+baT+Svfv/qlyBQFJB/rSLLawkGeOK9fA5XK98a91+Tvdr+RrCkT5IhJNfFd2Cqrkfx/tGkqKeh1Y1qjXutuLPpHuwKqY04Xro8XiTV6dnH/oR2R38HxmKkVM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707920947; c=relaxed/simple; bh=4PZnpdOC7nL7iSy6IqRjbXbXnr5kNh4hCRe0YlxfpbY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dU92+VZOvKtbCHFw0r5NGCotM3lDH86kNrB/hosjUQAE6DiRwMbQ6i2vsLoErlHEadD335JhCE7FECWA7+hVRzOyK/4xv0PvlwtoIDpNtqU+Wec5op+P8Nc6ZYyj0/6TW/E0gBXEwXdExjBKboK8iAmLt1dl0Ih9bw2Y91RVaUE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hVXjPJU0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7AA6C433F1; Wed, 14 Feb 2024 14:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707920946; bh=4PZnpdOC7nL7iSy6IqRjbXbXnr5kNh4hCRe0YlxfpbY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hVXjPJU0NBcOWMTf39vw8+II4IjZ6ZS1xuxWZCaEPpMRtVrcpjvdSZ5pbQbrzfyl5 5p+9MWOmLWaPsr7LOgqJVuXpNEGu9HP5o6oHpfYm48mw/cwuZA2rOiL0TSqwgjNwtz Te7GoztDlKGI1AjilnKM5j4xJ++Ihif+bCcL80YZs2PpixddZDzKfANZjpMNrMTAKA m1PIhUC8uWSafZPkoiTw++ALnHkJPvW96yiRupPJsd6ECJAQnxwBqtTMY8b5ucoUh3 icNpqgGguQ5ARz4ENnmS+uuUsuFTn88qiMgy7Lk72p/ca5ZczM4VSsbR95m3vy8ro5 PVL/t1eKkJnZQ== Date: Wed, 14 Feb 2024 19:58:56 +0530 From: Manivannan Sadhasivam To: Bjorn Andersson Cc: Manivannan Sadhasivam , 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 , 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: Re: [RFC 8/9] PCI/pwrctl: add PCI power control core code Message-ID: <20240214142856.GG4618@thinkpad> References: <20240201155532.49707-1-brgl@bgdev.pl> <20240201155532.49707-9-brgl@bgdev.pl> <7tbhdkqpl4iuaxmc73pje2nbbkarxxpgmabc7j4q26d2rhzrv5@ltu6niel5eb4> <2q5vwm7tgmpgbrm4dxfhypbs5pdggprxouvzfcherqeevpjhrj@6wtkv4za2gg5> <20240208113201.GA17587@thinkpad> Precedence: bulk X-Mailing-List: linux-bluetooth@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 09, 2024 at 05:43:56PM -0600, Bjorn Andersson wrote: > On Thu, Feb 08, 2024 at 05:02:01PM +0530, Manivannan Sadhasivam wrote: > > 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. > > > > I don't know what the appropriate design for this is, but we do have a > need for being able to recover from this state by the means of > power-cycling the device. > > If it's not possible to let the device do it (in any fashion), then > perhaps a user-space-assisted model is needed? > > Turning on power is an important first step, but please do consider the > full scope of the known problem space. > Agree. I'm not ignoring this issue, but this is a separate topic IMO (or an incremental change). Because, power cycling the device in the event of a firmware crash or even upon receiving AER Fatal errors is valid for platforms not making use of this driver and an existing issue. For sure we can accomodate that functionality in this series itself, but that's going to drag this series to many releases (you already know how long it took for us to get to the current state). Instead, I'd recommend to merge it in its current form and have Bartosz or someone work on incremental features such as: 1. Runtime/System PM 2. Resetting the device in the event of fw crash etc... Wdyt? - Mani -- மணிவண்ணன் சதாசிவம்