Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp172980pxr; Sun, 10 Apr 2022 10:48:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRsCB+y2d8z3eSzWmzAUnvTaHt1kO7xALkrJa3Yc3CJ9KbwF1Ryz/dehehHGI4q2W1qLCH X-Received: by 2002:a50:ab51:0:b0:41d:7b42:e34 with SMTP id t17-20020a50ab51000000b0041d7b420e34mr1208769edc.313.1649612923569; Sun, 10 Apr 2022 10:48:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649612923; cv=none; d=google.com; s=arc-20160816; b=r8SSAYoaV3Db4XCTjVgKCFrqdzrJ8w04W9DBfuwaAiIHU1l+CbyRUZx3OhCc+iOz04 /Rh8N7qZfim7MOlYyPSg9b2x+ZoQw2EFRuTiKIDbffIdL48it08/RyRqCovCkNnSiP2n vk72mzq6LICI5UEaT/sK3oK/+bSd3OuhIyXDjFTiYYo25psP3ntbcZR5jeYJWVA06U+t oMQNNyChGpxSpGwtq2W90tvcP7EOfKFB55q0gjNkYLxYQCWABjpbnyuRW4SIPN7GIKO4 2182EJQOCV4HbhtXej/ISzpL2F9S7VI+GfYo4FeOeKx/Sqak/dOcJoBgUa4Lc4SVvirb /B8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=lCVpHEZAuFYpT8MoYL/wQ4fDYm6F2aWVl7tmD78GJ5A=; b=sO30pM28ddU+gqMUtjq4+kROvckiCWY7B/AzKaInb+z7Z+Wx8/yPN0mScYuJTBQP6j Ss4Ozs57VzBr+1Zoky4efOIAC98jYLTwpUI7fw5YaocK++8XzO+wi6cj3IghkEd4k/aC bk77u/HsaEut7CnY771VcEKVz6pbJjCbVi0K4WQp4hPU/KtNZhjlyMlhUX3JabLSHbzI bUl/w7jUv5gW4+qnjVuUlzsrYODmYbkJH+7c20aor6z8XwAxlUN2mRf2Wc9HfwZHUEUM Zc3S/oEB4nD4vZhfc/VqNsjcCUmH4dgajsi0tVOlcs6eGZmR21T6JFfvBD2B2snfpEca 5aPw== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b26-20020a170906d11a00b006df76385bdasi5090634ejz.122.2022.04.10.10.48.18; Sun, 10 Apr 2022 10:48:43 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238546AbiDHSXX (ORCPT + 99 others); Fri, 8 Apr 2022 14:23:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230348AbiDHSXV (ORCPT ); Fri, 8 Apr 2022 14:23:21 -0400 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DC82360437; Fri, 8 Apr 2022 11:21:17 -0700 (PDT) Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-2ebdf6ebd29so34699217b3.2; Fri, 08 Apr 2022 11:21:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lCVpHEZAuFYpT8MoYL/wQ4fDYm6F2aWVl7tmD78GJ5A=; b=yTdG7iM0rTMFQvDClGza8PQw9GrLpjlYWIfN5vMUi1SM8GpH225/CF+n5bSVpLBfNS FiGq7bveFnVFvAV+jVbFI2LUrXnVymDYRRaOKu7a9NEz96xbyGf8qmer/fuaTr/W5zDH m5KoVRvnVICOxRmElz2Wuti+6p++rnJSRaIempnXJ/sGNV/J92vuOgMjDFJPkn8aB4Kg mLu/7H67XqpDTXmEGnHxIQrdEfIRhdczD8/GOoNv9XyVPevbrZC6TltPxtFUHS8n5WhK yEz6ONbxAkG+aX5meV1dzQMVWEHFlLxmhkjyAaylqO1Oc4oBjK88Cnib/kUBS1B31KWh +Dvg== X-Gm-Message-State: AOAM530ApCRRZxBkUGFDNTnSpHs/oyA6snI5ytx4LmYLDVldpJpgKMKY YRt1cuGR1uzHZPgmGBvmoMi/nuORPQ103xi64bGMrMjv X-Received: by 2002:a81:7c45:0:b0:2eb:4759:cc32 with SMTP id x66-20020a817c45000000b002eb4759cc32mr17293086ywc.515.1649442076610; Fri, 08 Apr 2022 11:21:16 -0700 (PDT) MIME-Version: 1.0 References: <4412361.LvFx2qVVIh@kreacher> <20220407154901.GA239301@bhelgaas> In-Reply-To: <20220407154901.GA239301@bhelgaas> From: "Rafael J. Wysocki" Date: Fri, 8 Apr 2022 20:21:05 +0200 Message-ID: Subject: Re: [PATCH v1] PCI: PM: Power up all devices during runtime resume To: Bjorn Helgaas Cc: "Rafael J. Wysocki" , Linux PCI , LKML , Linux ACPI , Mika Westerberg , Linux PM Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 On Thu, Apr 7, 2022 at 5:49 PM Bjorn Helgaas wrote: > > 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! This doesn't compile when CONFIG_PM_SLEEP in uset, sorry about this. I'll send a v2, but if you prefer an incremental fix, please let me know. > > > --- > > 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; > > > > > >