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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 D45FFC4742C for ; Mon, 16 Nov 2020 16:12:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CC3822240 for ; Mon, 16 Nov 2020 16:12:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730574AbgKPQMw (ORCPT ); Mon, 16 Nov 2020 11:12:52 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:54586 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729729AbgKPQMw (ORCPT ); Mon, 16 Nov 2020 11:12:52 -0500 Received: from 89-64-89-143.dynamic.chello.pl (89.64.89.143) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.520) id 06351fb59e3410d6; Mon, 16 Nov 2020 17:06:09 +0100 From: "Rafael J. Wysocki" To: Mika Westerberg Cc: Bjorn Helgaas , Lukas Wunner , David Airlie , Daniel Vetter , Utkarsh Patel , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , linux-pci@vger.kernel.org Subject: Re: [PATCH] PCI/PM: Do not generate wakeup event when runtime resuming bus Date: Mon, 16 Nov 2020 17:06:08 +0100 Message-ID: <2582211.lb15P8fMpq@kreacher> In-Reply-To: <20201113063745.GH2495@lahna.fi.intel.com> References: <20201029092453.69869-1-mika.westerberg@linux.intel.com> <20201113063745.GH2495@lahna.fi.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Friday, November 13, 2020 7:37:45 AM CET Mika Westerberg wrote: > Hi, > > On Thu, Oct 29, 2020 at 12:24:53PM +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 get aborted 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(). While there rename pci_wakeup_bus() to > > pci_resume_bus() to better reflect what it does. > > Any comments on this? I've missed it, sorry. Now replied with a R-by, thanks!