From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 783E7C4332F for ; Thu, 7 Apr 2022 15:49:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232193AbiDGPvP (ORCPT ); Thu, 7 Apr 2022 11:51:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345037AbiDGPvN (ORCPT ); Thu, 7 Apr 2022 11:51:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D0ACC55B4; Thu, 7 Apr 2022 08:49:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C18B3B827BE; Thu, 7 Apr 2022 15:49:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30075C385A4; Thu, 7 Apr 2022 15:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649346543; bh=e+alSzDzrc04Tz+Z+gKtvacXXhVH6XUBwWUSuj+9OLY=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Oc2N78jCjftJ6PIjmp5gY2ESvtysUuqCXzStvWEfEv1QqIpD74eYG+szMe/ayl6VV 3inQ7HV6gKfAUY1Ws0V6gLvhykpmbviBaD0WVWtraPF0YJjlOY0eHNz8BtGINDzR9j VtjyrKIVb60+/UjKsW+J30OjL/NA63yXrs+ZuU6+Av+RrfuNPWhtxXZ1sj5sd48eME yp7TulI29pk7Lyhiq6ZjDV3Hsu//sFhYvGYR2puv91WWSEm4+52vFydk3XjtOeqvPG 1YL7c4tQ7sHKzEISGYghvuuA7QC72CcCpor3BQWik6dics9aVNLxgkuzHCDQnUYfMk Nd+ecSrbzJM7w== Date: Thu, 7 Apr 2022 10:49:01 -0500 From: Bjorn Helgaas To: "Rafael J. Wysocki" Cc: Linux PCI , LKML , Linux ACPI , Mika Westerberg , Linux PM Subject: Re: [PATCH v1] PCI: PM: Power up all devices during runtime resume Message-ID: <20220407154901.GA239301@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4412361.LvFx2qVVIh@kreacher> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Wed, Apr 06, 2022 at 09:00:52PM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Currently, endpoint devices may not be powered up entirely during > runtime resume that follows a D3hot -> D0 transition of the parent > bridge. > > Namely, even if the power state of an endpoint device, as indicated > by its PCI_PM_CTRL register, is D0 after powering up its parent > bridge, it may be still necessary to bring its ACPI companion into > D0 and that should be done before accessing it. However, the current > code assumes that reading the PCI_PM_CTRL register is sufficient to > establish the endpoint device's power state, which may lead to > problems. > > Address that by forcing a power-up of all PCI devices, including the > platform firmware part of it, during runtime resume. > > Link: https://lore.kernel.org/linux-pm/11967527.O9o76ZdvQC@kreacher > Fixes: 5775b843a619 ("PCI: Restore config space on runtime resume despite being unbound") > Reported-by: Abhishek Sahu > Tested-by: Abhishek Sahu > Signed-off-by: Rafael J. Wysocki Applied with Mika's reviewed-by to pci/pm for v5.19, thanks! > --- > drivers/pci/pci-driver.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: linux-pm/drivers/pci/pci-driver.c > =================================================================== > --- linux-pm.orig/drivers/pci/pci-driver.c > +++ linux-pm/drivers/pci/pci-driver.c > @@ -1312,7 +1312,7 @@ static int pci_pm_runtime_resume(struct > * to a driver because although we left it in D0, it may have gone to > * D3cold when the bridge above it runtime suspended. > */ > - pci_restore_standard_config(pci_dev); > + pci_pm_default_resume_early(pci_dev); > > if (!pci_dev->driver) > return 0; > > >