From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754346AbeEWILn (ORCPT ); Wed, 23 May 2018 04:11:43 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:37385 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754175AbeEWILj (ORCPT ); Wed, 23 May 2018 04:11:39 -0400 X-Google-Smtp-Source: AB8JxZpE4smopSN3MypRBFtsPP2qAj6W/MWwTxDDSHb3hsjxA/lQY73Z1Q4G0qb5/TI6r789BHp/SrtOkLCdOGmZwwQ= MIME-Version: 1.0 In-Reply-To: <20180522220149.GB22385@bhelgaas-glaptop.roam.corp.google.com> References: <11415287.ki0m5Bqgns@aspire.rjw.lan> <20180522220149.GB22385@bhelgaas-glaptop.roam.corp.google.com> From: "Rafael J. Wysocki" Date: Wed, 23 May 2018 10:11:38 +0200 X-Google-Sender-Auth: AmRBjdwBk5Ko_LBT3MWYfR1hftA Message-ID: Subject: Re: [PATCH] PCI / PM: Do not clear state_saved for devices that remain suspended To: Bjorn Helgaas Cc: "Rafael J. Wysocki" , Linux PCI , Linux PM , LKML , Bjorn Helgaas , Mika Westerberg Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 23, 2018 at 12:01 AM, Bjorn Helgaas wrote: > On Fri, May 18, 2018 at 10:17:42AM +0200, Rafael J. Wysocki wrote: >> From: Rafael J. Wysocki >> >> The state_saved flag should not be cleared in pci_pm_suspend() if the >> given device is going to remain suspended, or the device's config >> space will not be restored properly during the subsequent resume. >> >> Namely, if the device is going to stay in suspend, both the late >> and noirq callbacks return early for it, so if its state_saved flag >> is cleared in pci_pm_suspend(), it will remain unset throughout the >> remaining part of suspend and resume and pci_restore_state() called >> for the device going forward will return without doing anything. >> >> For this reason, change pci_pm_suspend() to only clear state_saved >> if the given device is not going to remain suspended. [This is >> analogous to what commit ae860a19f37c (PCI / PM: Do not clear >> state_saved in pci_pm_freeze() when smart suspend is set) did for >> hibernation.] >> >> Fixes: c4b65157aeef (PCI / PM: Take SMART_SUSPEND driver flag into account) >> Signed-off-by: Rafael J. Wysocki > > Acked-by: Bjorn Helgaas > > I assume you'll take this one, too. Yes, I will, thank you!