From patchwork Tue Aug 1 00:05:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 9873441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7CDF460365 for ; Tue, 1 Aug 2017 00:05:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6869928470 for ; Tue, 1 Aug 2017 00:05:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C9BC285D3; Tue, 1 Aug 2017 00:05:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID,T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5E9128470 for ; Tue, 1 Aug 2017 00:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751157AbdHAAFZ (ORCPT ); Mon, 31 Jul 2017 20:05:25 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:35510 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751102AbdHAAFY (ORCPT ); Mon, 31 Jul 2017 20:05:24 -0400 Received: by mail-io0-f195.google.com with SMTP id f1so385636ioj.2; Mon, 31 Jul 2017 17:05:23 -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=FQrzPNjxMzo05EV8cbwwmdz5faGyRshACb6kOK0QBA4=; b=lX+u6SZNXYEsgiJ5i24b5u0jGa3tza2ldUprn19tnQHmmC0jpdMPClc7f+f4XzZH+M HTjZ5aMQN8UbnEJocKdMfNk0KWdV+SYHFovllkpsWQUk8IxH43XyRpVo3mEzi5JQ59TU 5E6vOXcdA7VxX6SX/ftGc0wwnE64oEEEdAKSRQ8qmAaCJopUUNlAKTnu4gAZIyyC2zmP WdX5cXVSPcjcLeU5Pn4NwAoFx4TlyFWLS8rGBMmUJunm0Rgv7L+JjsyIf9GffHL8uEfA pHCls/AhFmMCF6sH7qh6RODC6LmNe6F0cvKYlIGDR5uoG4OOkZsTp9mEPdOIbQq2m3+E QSJg== 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=FQrzPNjxMzo05EV8cbwwmdz5faGyRshACb6kOK0QBA4=; b=kUl1txbBr5Z73jeTajW76WAzf1tUqtlMPZ5m5+mnB53+fK3rrY7OKUca6LAQTjOjTk OXek29IvzcB3eI9Uthf9pKWS6/c/2Pyil949htdJPFxocjPQOYBhCSPWBV0HBGW+dLk4 W3gUQXl/hr+P+4g8Q8Ijm+BLRYUW42reuIQBWZOCGyUyYyHOgBKHuQPlSzT2b9WKklqj Fi6lPed6HTo4Se1Fvp4Twh7/gfZg9vqlwtYZhUmHBXhsR0uNmafopAmKkgcKvld2lkVm 7x+u/7ycJCQFha2fzox5/3hZIykSjA7hJVIbh7NhAT7EJnWMM1uOjYmi3hJP2LG0sg1T gTjg== X-Gm-Message-State: AIVw110iOOXuT9PKwKeeNTmQ9taAE1iKBVIA+OYlHPcAgbOJ9fNe3Aj+ 3XOzLqGobHrC9SohYSU688oAgaKeHg== X-Received: by 10.107.24.68 with SMTP id 65mr19450066ioy.184.1501545923373; Mon, 31 Jul 2017 17:05:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.196.11 with HTTP; Mon, 31 Jul 2017 17:05:22 -0700 (PDT) In-Reply-To: References: <20170730085908.GA2298@light.dominikbrodowski.net> <5B8DA87D05A7694D9FA63FD143655C1B749D3C1C@hasmsx108.ger.corp.intel.com> <20170731221645.GA5871@light.dominikbrodowski.net> From: "Rafael J. Wysocki" Date: Tue, 1 Aug 2017 02:05:22 +0200 X-Google-Sender-Auth: 8RkrP7foVUDippt5fO87TfQz-XI Message-ID: Subject: Re: Issue with commit de3ef1eb1cd - PM / core: Drop run_wake flag from struct dev_pm_info [Was: MEI-related WARN_ON() triggered during resume-from-sleep on v4.13-rc2+] To: "Rafael J. Wysocki" Cc: Dominik Brodowski , "Winkler, Tomas" , Rafael Wysocki , Mika Westerberg , Bjorn Helgaas , "Usyskin, Alexander" , "linux-kernel@vger.kernel.org" , Linux PM , ACPI Devel Maling List Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Aug 1, 2017 at 1:55 AM, Rafael J. Wysocki wrote: > Hi, > > On Tue, Aug 1, 2017 at 12:16 AM, Dominik Brodowski > wrote: >> Rafael, Mika, Bjorn and Tomas, >> >> can't explain exactly what causes breakage between MEI and PM first seen on >> v4.13-rc2 (ther was a typo in the orignal message), but I was able to bisect >> it down to commit >> >> [de3ef1eb1cd0cc3a75f7a3661e10ed827f370ab8] PM / core: Drop run_wake flag from struct dev_pm_info >> > > [cut] > >>> >>> > [ 192.940537] Restarting tasks ... >>> > [ 192.940610] PGI is not set >>> > [ 192.940619] ------------[ cut here ]------------ [ 192.940623] WARNING: CPU: 0 >>> > PID: 1661 at /home/brodo/local/kernel/git/linux/drivers/misc/mei/hw- >>> > me.c:653 mei_me_pg_exit_sync+0x351/0x360 [ 192.940624] Modules linked >>> > in: >>> > [ 192.940627] CPU: 0 PID: 1661 Comm: kworker/0:3 Not tainted 4.13.0-rc2+ >>> > #2 [ 192.940628] Hardware name: Dell Inc. XPS 13 9343/0TM99H, BIOS A11 >>> > 12/08/2016 [ 192.940630] Workqueue: pm pm_runtime_work [ >>> > 192.940642] Call Trace: >>> > [ 192.940646] ? pci_pme_active+0x1de/0x1f0 [ 192.940649] ? >>> > pci_restore_standard_config+0x50/0x50 >>> > [ 192.940651] ? kfree+0x172/0x190 >>> > [ 192.940653] ? kfree+0x172/0x190 >>> > [ 192.940655] ? pci_restore_standard_config+0x50/0x50 >>> > [ 192.940663] mei_me_pm_runtime_resume+0x3f/0xc0 >>> > [ 192.940665] pci_pm_runtime_resume+0x7a/0xa0 [ 192.940667] >>> > __rpm_callback+0xb9/0x1e0 [ 192.940668] ? >>> > preempt_count_add+0x6d/0xc0 [ 192.940670] rpm_callback+0x24/0x90 [ >>> > 192.940672] ? pci_restore_standard_config+0x50/0x50 >>> > [ 192.940674] rpm_resume+0x4e8/0x800 >>> > [ 192.940676] pm_runtime_work+0x55/0xb0 [ 192.940678] >>> > process_one_work+0x184/0x3e0 [ 192.940680] worker_thread+0x4d/0x3a0 [ >>> > 192.940681] ? preempt_count_sub+0x9b/0x100 [ 192.940683] >>> > kthread+0x122/0x140 [ 192.940684] ? process_one_work+0x3e0/0x3e0 [ >>> > 192.940685] ? __kthread_create_on_node+0x1a0/0x1a0 >>> > [ 192.940688] ret_from_fork+0x27/0x40 >>> > [ 192.940690] Code: 96 3a 9e ff 48 8b 7d 98 e8 cd 21 58 00 83 bb bc 01 00 00 >>> > 04 0f 85 40 fe ff ff e9 41 fe ff ff 48 c7 c7 5f 04 99 96 e8 93 6b 9f ff <0f> ff e9 5d >>> > fd ff ff e8 33 fe 99 ff 0f 1f 00 0f 1f 44 00 00 55 [ 192.940719] ---[ end trace >>> > a86955597774ead8 ]--- [ 192.942540] done. >>> > >>> > This doesn't / didn't happen on v4.12. >> >> >> By using the dynamic_debug infrastructure, I was able to obtain a few more >> data points: >> >> Running 0847684cfc5f, when suspending the system to ram and resuming again, >> I see the following messages: > > You have removed some relevant parts of the log, but I think I see > what's going on. > >> [ 614.936773] sd 3:0:0:0: [sda] Stopping disk >> [ 614.956004] mei_me 0000:00:16.0: rpm: me: runtime resume > > This is a runtime resume during system suspend. > >> [ 614.956165] ACPI : EC: event blocked >> [ 614.980164] mei_me 0000:00:16.0: interrupt source 0x00000002 >> [ 614.980191] mei_me 0000:00:16.0: function called after ISR to handle the interrupt processing. >> ... >> [ 615.266896] Suspended for 1.190 seconds >> ... >> [ 615.455775] sd 3:0:0:0: [sda] Starting disk >> [ 615.455855] mei_me 0000:00:16.0: interrupt source 0x00000002 >> [ 615.455870] mei_me 0000:00:16.0: function called after ISR to handle the interrupt processing. >> [ 615.455877] mei_me 0000:00:16.0: we need to start the dev. >> >> and everything works fine as expected (no WARN(), no stack trace, nothing >> dubious). >> >> Running de3ef1eb1cd0 instead, when suspending, I see *no* mei_me-related >> message. During resume, the stack trace already noted above for >> v4.13-rc2+ appears again: >> >> [ 80.333909] sd 3:0:0:0: [sda] Stopping disk >> [ 80.535777] psmouse serio1: Failed to disable mouse on isa0060/serio1 >> [ 80.983510] ACPI : EC: event blocked > > Which apparently doesn't happen here. > >> [ 81.065510] PM: suspend of devices complete after 734.074 msecs >> ... >> [ 82.137038] Restarting tasks ... >> [ 82.143986] mei_me 0000:00:16.0: rpm: me: runtime resume > > And which does happen here, after system resume, but then it confuses > the driver. > >> [ 82.143989] PGI is not set >> [ 82.144001] ------------[ cut here ]------------ >> [ 82.144008] WARNING: CPU: 3 PID: 1881 at /home/brodo/local/kernel/git/linux/drivers/misc/mei/hw-me.c:653 mei_me_pg_exit_sync+0x351/0x360 >> [ 82.144009] Modules linked in: >> [ 82.144012] CPU: 3 PID: 1881 Comm: kworker/3:5 Not tainted 4.12.0-rc5+ #3 >> [ 82.144013] Hardware name: Dell Inc. XPS 13 9343/0TM99H, BIOS A11 12/08/2016 >> ... >> [ 82.144017] Workqueue: pm pm_runtime_work >> [ 82.144019] task: ffff964a91b35700 task.stack: ffffa51b43508000 >> [ 82.144022] RIP: 0010:mei_me_pg_exit_sync+0x351/0x360 >> ... >> [ 82.144156] ---[ end trace 5827b2fcedec4bc9 ]--- >> [ 82.144272] done. >> ... >> [ 83.194425] mei_me 0000:00:16.0: rpm: me: runtime resume ret = -62 >> [ 83.194460] mei_me 0000:00:16.0: unexpected reset: dev_state = ENABLED fw status = 1E000245 6000A106 00000200 00004400 00000101 43C00ED9 >> ... >> >> Any ideas? > > Can you check if the attached patch makes any difference? Actually, I don't think it will make any difference. Please check the one attached this time. Thanks, Rafael --- drivers/misc/mei/pci-me.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-pm/drivers/misc/mei/pci-me.c =================================================================== --- linux-pm.orig/drivers/misc/mei/pci-me.c +++ linux-pm/drivers/misc/mei/pci-me.c @@ -223,6 +223,8 @@ static int mei_me_probe(struct pci_dev * if (!pci_dev_run_wake(pdev)) mei_me_set_pm_domain(dev); + pdev->dev_flags |= PCI_DEV_FLAGS_NEEDS_RESUME; + if (mei_pg_is_enabled(dev)) pm_runtime_put_noidle(&pdev->dev);