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 X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 836EAC4361A for ; Fri, 4 Dec 2020 23:19:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 39C8622472 for ; Fri, 4 Dec 2020 23:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726134AbgLDXSq (ORCPT ); Fri, 4 Dec 2020 18:18:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:35526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725885AbgLDXSp (ORCPT ); Fri, 4 Dec 2020 18:18:45 -0500 Date: Fri, 4 Dec 2020 17:18:03 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607123885; bh=g7wuX88Zhhxoge1jkZR8ojn4kv8t8SuxTncSSpCyyLE=; h=From:To:Cc:Subject:In-Reply-To:From; b=qQ5eitA2y74ZA6Nbi9Lzhbwx33jqcDd/6GksB/4xh3xGbl14tn1jPndUdf1Pn2v7T iNwxyoE16emim1SbXxSD98HcoyyrdBxOIWDJ76jJ/QK7iQLInPfz9EVqlLSR7NhmZF K2si7bhKys3xYLR2Lf92sZVhOxlusVGpt5cAR4F0z9Nhs3FUCD55lnI3i4GwUm2xsE ICHPN/zszaiJHg1Ko6S/0LIDQ/16uYLrD6Hy0q6otmXluyfMGF8ZCqxAxswDi68fg9 q37BowT3qHXbjUHleqGq7rIUfeITv4IbRgRBkiIEcCN+TXyy5Ma7f9ChKXVoris96y wgZ2DQ1wQNVOA== From: Bjorn Helgaas To: Mika Westerberg Cc: Bjorn Helgaas , "Rafael J. Wysocki" , Lukas Wunner , David Airlie , Daniel Vetter , Utkarsh Patel , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , linux-pci@vger.kernel.org Subject: Re: [PATCH v2 1/2] PCI/PM: Do not generate wakeup event when runtime resuming bus Message-ID: <20201204231803.GA1980572@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201125090733.77782-1-mika.westerberg@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Wed, Nov 25, 2020 at 12:07:32PM +0300, Mika Westerberg wrote: > When a PCI bridge is runtime resumed from D3cold the underlying bus is > walked and the attached devices are runtime resumed as well. However, in > addition to that we also generate a wakeup event for these devices even > though this actually is not a real wakeup event coming from the > hardware. > > Normally this does not cause problems but when combined with > /sys/power/wakeup_count like using the steps below: > > # count=$(cat /sys/power/wakeup_count) > # echo $count > /sys/power/wakeup_count > # echo mem > /sys/power/state > > The system suspend cycle might fail at this point if a PCI bridge that > was runtime suspended (D3cold) was runtime resumed for any reason. The > runtime resume calls pci_wakeup_bus() and that generates wakeup event > increasing wakeup_count. > > Since this is not a real wakeup event we can prevent the above from > happening by removing the call to pci_wakeup_event() in > pci_wakeup_bus(). > > Reported-by: Utkarsh Patel > Signed-off-by: Mika Westerberg > Reviewed-by: Rafael J. Wysocki I reversed the order of these since I think it's more obvious that pci_wakeup_event() doesn't fit in pci_resume_one() and applied both to pci/pm for v5.11, thanks! > --- > Previous version can be found here: > > https://www.spinics.net/lists/linux-pci/msg101083.html > > Changes from the previous version: > > - Split the patch in two. The second patch only does the rename. > - Tried to improve the commit message a bit > - Added Rafael's reviewed-by tag > > drivers/pci/pci.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index e578d34095e9..6f7b33998fbe 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -1181,7 +1181,6 @@ EXPORT_SYMBOL_GPL(pci_platform_power_transition); > */ > static int pci_wakeup(struct pci_dev *pci_dev, void *ign) > { > - pci_wakeup_event(pci_dev); > pm_request_resume(&pci_dev->dev); > return 0; > } > -- > 2.29.2 >