Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp430147pxb; Thu, 7 Apr 2022 09:12:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvFZHdduPS4p8k1l2TXY3MrMqBEe+yzuW1OeOyT/IEF0cHsyEZWRrRUz+7xnLaOS+KqMqc X-Received: by 2002:a05:6402:350c:b0:419:3cb8:b714 with SMTP id b12-20020a056402350c00b004193cb8b714mr14970579edd.297.1649347920555; Thu, 07 Apr 2022 09:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649347920; cv=none; d=google.com; s=arc-20160816; b=a2brhutgkO1qBZJiuZsMb5pVhRhQ88v9QnHhyYhpQWjOLlrHtgRy2Rs8EZ+Euqq3xY zaARtbDXq6sfmv1YSWsNnU/LZYTsz2yoanNzaSBEFqB2OEr+WlFzOSK7FaVqjW78KX2x omFTVnenUHelI/7+WATZf0N9kolD43LqOSOw4WFyoKnOyfIC/a/WKrD1SRWvhNLhn2yf bNpPHzHkpSp2L8SCv90GLOJ8lZjl2vWMpwzGeTNHqX3y4bGPv7iQQYqsnHphWfPUo64p 5xYjcjtb9i7ulqTwcM3qzg+0lN7eeo6eZkVlU8OThwHBvKWNjfRlv7C1FD3WTFFxWxSt Xqcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=do4pzSakFRe9NLk/BvRh/+mCXqbD0fn8MfZl5fchS24=; b=0jaNZ7BoFrjK1ywnZ+bp5va+XYpXOJL8SgqiSi7Cz5N2fSaEtNsGWF5yVJwnBnyVQY YAtiDOsg/m0cAbb2H8Q4i56tuMTbPnOe57fGbDHYylF+6SOaLip1Ftz2hk5qiV+VgP6b dnLbOstFkl4QYtRUVR9efHBZx3GyxSKqLUL2fg98J/elrZMjgsohi7TGQkJHP/1Ligy/ PS/7AeH4G31n7yOKfXSZdBx7y9sbQAX0YKsaC+QjnWoyd6qVubtLHuUj72qXAjhwomFg Vf5o7f4fJKt3GXH+WJYmYX3H6qQC+8oXpUK4EEqhKFr9NK2B642WAuku02jAp4tyH6HK 9WMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020a50ce50000000b0041cef8a4f33si4599245edj.630.2022.04.07.09.11.31; Thu, 07 Apr 2022 09:12:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234745AbiDFUou (ORCPT + 99 others); Wed, 6 Apr 2022 16:44:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232023AbiDFUoj (ORCPT ); Wed, 6 Apr 2022 16:44:39 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B07893B21B7; Wed, 6 Apr 2022 12:00:55 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.0.0) id da974e533c45d771; Wed, 6 Apr 2022 21:00:54 +0200 Received: from kreacher.localnet (unknown [213.134.186.238]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 0F19566BD10; Wed, 6 Apr 2022 21:00:53 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PCI Cc: LKML , Linux ACPI , Bjorn Helgaas , Mika Westerberg , Linux PM Subject: [PATCH v1] PCI: PM: Power up all devices during runtime resume Date: Wed, 06 Apr 2022 21:00:52 +0200 Message-ID: <4412361.LvFx2qVVIh@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.186.238 X-CLIENT-HOSTNAME: 213.134.186.238 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrudejiedgudefvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdevgfetueetheekudeuvdduteelvefftdfftdejjeeukeffteeikefgiefghedunecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepvddufedrudefgedrudekiedrvdefkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrddukeeirddvfeekpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeeipdhrtghpthhtoheplhhinhhugidqphgtihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehhvghlghgrrghs sehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmihhkrgdrfigvshhtvghrsggvrhhgsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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;