Received: by 10.192.165.148 with SMTP id m20csp4682625imm; Tue, 1 May 2018 01:36:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoXr2vfHsE89AXfXSr+7oSqNDujnyrRDd18V5LejckiXr65IIgmxsbVsIZvmwgrMktLvf5+ X-Received: by 2002:a17:902:da4:: with SMTP id 33-v6mr15360424plv.52.1525163775022; Tue, 01 May 2018 01:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525163774; cv=none; d=google.com; s=arc-20160816; b=t0l7bhIO43rUdUGtO/f5Bdr14eDGGQyCLVCvI9j2ak6jFZmNg/4uXASuco/vyowWKm zCZ3Zz1kr5DI1135qlPLj37ecrm3+/0Q34/+S8pD37ABZ7GrzcUv0Ja+vmFjCnLtrQfW G3EziRc69ZervJkanDrWaaeO5Sg1cqsQ+r/QW776rHjVwaTpVodwmEIfyKQYUNG/0c6h ofCizCKeRFrkOyfx4JIoVYBmXg8kEfk4X+8yLTOoMlDkbeut5vAcZxXVXhz49D+rDXmj KOLJEOM/WOMAIxPzCY4nYyHnDY0Lf96PwJoBidM6OARujTyfix113uEHEeCB+xmmg5C6 bAvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=NMt2dkHHIseYphEq0krUSgfzB+C4qGBNnjQBvDKJqiI=; b=aystCD8owZX2yVWmdXPL8vtThAUhHO14jx3VjPxm5xqd9tFGYytttE4dnf8AtmyyFd 2A5VEYqfkNVVEqZdq+Riztj6pRAHkhstdtB6jqhBb98FoHo7P3+isYgya0nUVQOBwbsc c4rSOTecsxqMMcQ3nSVd5DsF7WlzqRezSUCr/FZZvjW15vYQxu/et+xcwpC1a+Zyv6bq 4hkvVaE8RxKr8bxhPcyH/yZ+1LOKcGh4K7kWJwdl7MhOMj3ByqEaSxORyB9HuLs2oXf0 7Fq3LyD63xQAqV46pufVGiDJofNFhj3YsnPwEvthFa16h2x3yEsyjU+W/g35Xx7qoRon BPrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DL3IPLve; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o30-v6si9232159pli.64.2018.05.01.01.36.00; Tue, 01 May 2018 01:36:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DL3IPLve; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753731AbeEAIeg (ORCPT + 99 others); Tue, 1 May 2018 04:34:36 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:45204 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750994AbeEAIea (ORCPT ); Tue, 1 May 2018 04:34:30 -0400 Received: by mail-oi0-f68.google.com with SMTP id b130-v6so9588004oif.12; Tue, 01 May 2018 01:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=NMt2dkHHIseYphEq0krUSgfzB+C4qGBNnjQBvDKJqiI=; b=DL3IPLve/3qD7UXLSLPhvNv/qskQxnqjPnmAYcWMgKxgZm54UEH/oE3f4YBP4Hw80b 9PqmhP/2euk/rMhRPtdQH7M3oSN0zv23RPJbVEtadDPC1euMUdvExzaTPhzk+zGcCKhe VaDcFRz3JzibRJm4d42Kx6RuhDU/U6bWlJqgAma26MvotGx/acq+zBSC+WNdDyRLq6Io cJsIKldx6p7dCDnkaLmK1Q9j27OZe7zDIGQJ4WqbAzyVwg9Bg2/P2AsWSzSOEoJOzRGL WBkCq9p2ZaaNw4BjMdR6ucbJSfkORLsiGZUUgRK1fMAgA7eUHUN2nYzDx0eraLcvCd/V ittA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=NMt2dkHHIseYphEq0krUSgfzB+C4qGBNnjQBvDKJqiI=; b=KXw1XJ7KL2jvdPNU2OgpHhwsEyJ6seC/8qCHO6TmOdEetn+Vndjd/77K3X2UmYidph pSnwtACTwvOsiVZ665X1m+SHW+YeStMzrRqs2/1fN1DLg/n28fyW1+Z9K83KSSaJuDFv LrUA0Ga55j0RuEfN+sTr21wZygJ836rLXVaSthd0MfTmRNilGR1O6ixRf6LkFOaDoJ2E a1dKAlOlVjrDSa5Ur7syWWfZ5E5eYd2lokwZhRxxIMLgTmQaJ6ZbA3F7ZP39le4fgQ/e h0rHv/V5fz3SPoKgTeV+ocA+aEzxjjwTWig9z8b3oiRWQ1EbjFdGl7rBdjcvZurYswCT gtHQ== X-Gm-Message-State: ALQs6tBHjFijocD9radHkNdBO4PgPGdO78pL8zyuqx/b8bpnsCnp0xbs Ho6J5Gwr6uosEt/tPfNuB1UF+JMEoVN2h55JAaM= X-Received: by 2002:aca:ac06:: with SMTP id v6-v6mr9519839oie.227.1525163669844; Tue, 01 May 2018 01:34:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1468:0:0:0:0:0 with HTTP; Tue, 1 May 2018 01:34:29 -0700 (PDT) In-Reply-To: <1f67f00a-8141-f9af-2120-c78f7cfecb1d@canonical.com> References: <56a8953c-d833-837c-57d5-fe758d4db02a@canonical.com> <1f67f00a-8141-f9af-2120-c78f7cfecb1d@canonical.com> From: "Rafael J. Wysocki" Date: Tue, 1 May 2018 10:34:29 +0200 X-Google-Sender-Auth: 77E10Pfx-CzG_RPfnjU4q-8KSr4 Message-ID: Subject: Re: [Regression] PCI / PM: Simplify device wakeup settings code To: Joseph Salisbury Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Len Brown , Bjorn Helgaas , ACPI Devel Maling List , Linux PCI , "linux-kernel@vger.kernel.org" , 1745646@bugs.launchpad.net, Mika Westerberg Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 30, 2018 at 4:22 PM, Joseph Salisbury wrote: > On 04/16/2018 11:58 AM, Rafael J. Wysocki wrote: >> On Mon, Apr 16, 2018 at 5:31 PM, Joseph Salisbury >> wrote: >>> On 04/13/2018 05:34 PM, Rafael J. Wysocki wrote: >>>> On Fri, Apr 13, 2018 at 7:56 PM, Joseph Salisbury >>>> wrote: >>>>> Hi Rafael, >>>>> >>>>> A kernel bug report was opened against Ubuntu [0]. After a kernel >>>>> bisect, it was found that reverting the following two commits resolved >>>>> this bug: >>>>> >>>>> 0ce3fcaff929 ("PCI / PM: Restore PME Enable after config space restoration") >>>>> 0847684cfc5f("PCI / PM: Simplify device wakeup settings code") >>>>> >>>>> This is a regression introduced in v4.13-rc1 and still exists in >>>>> mainline. The bug causes the battery to drain when the system is >>>>> powered down and unplugged, which does not happed prior to these two >>>>> commits. >>>> What system and what do you mean by "powered down"? How much time >>>> does it take for the battery to drain now? >>> By powered down, the bug reporter is saying physically powered off and >>> unplugged. The system is a HP laptop: >>> >>> dmi.chassis.vendor: HP >>> dmi.product.family: 103C_5335KV HP Notebook >>> dmi.product.name: HP Notebook >>> vendor_id : GenuineIntel >>> cpu family : 6 >>> >>> >>>>> The bisect actually pointed to commit de3ef1e, but reverting >>>>> these two commits fixes the issue. >>>>> >>>>> I was hoping to get your feedback, since you are the patch author. Do >>>>> you think gathering any additional data will help diagnose this issue, >>>>> or would it be best to submit a revert request? >>>> First, reverting these is not an option or you will break systems >>>> relying on them now. 4.13 is three releases back at this point. >>>> >>>> Second, your issue appears to be related to the suspend/shutdown path >>>> whereas commit 0ce3fcaff929 is mostly about resume, so presumably the >>>> change in pci_enable_wake() causes the problem to happen. Can you try >>>> to revert this one alone and see if that helps? >>> A test kernel with commits 0ce3fcaff929 and de3ef1eb1cd0 reverted was >>> tested. However, the test kernel still exhibited the bug. >> So essentially the bisection result cannot be trusted. > > We performed some more testing and confirmed just a revert of the > following commit resolves the bug: > > 0847684cfc5f0 ("PCI / PM: Simplify device wakeup settings code") Thanks for confirming this! > Can you think of any suggestions to help debug further? The root cause of the regression is likely the change in pci_enable_wake() removing the device_may_wakeup() check from it. Probably, one of the drivers in the platform calls pci_enable_wake() directly from its ->shutdown() callback and that causes the device to be set up for system wakeup which in turn causes the power draw while the system is off to increase. I would look at the PCI drivers used on that platform to find which of them call pci_enable_wake() directly from ->shutdown() and I would make these calls conditional on device_may_wakeup().