From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753783AbdBNLbr (ORCPT ); Tue, 14 Feb 2017 06:31:47 -0500 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:63280 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753393AbdBNLa5 (ORCPT ); Tue, 14 Feb 2017 06:30:57 -0500 From: "Rafael J. Wysocki" To: Geert Uytterhoeven Cc: Lukas Wunner , Bjorn Helgaas , Yinghai Lu , "Rafael J. Wysocki" , Mika Westerberg , Laurent Pinchart , Simon Horman , linux-pci , Linux PM list , Linux-Renesas , "linux-kernel@vger.kernel.org" Subject: Re: PCI / PM: Crashes in PME scan during system suspend Date: Tue, 14 Feb 2017 12:26:01 +0100 Message-ID: <2661070.8D7d40DjM3@aspire.rjw.lan> User-Agent: KMail/4.14.10 (Linux/4.10.0-rc3+; KDE/4.14.9; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, February 14, 2017 10:31:38 AM Geert Uytterhoeven wrote: > Hi all, > > Laurent Pinchart reported that r8a7790/Lager crashes during suspend tests. > > I managed to reproduce the issue on r8a7791/koelsch: > - It only happens during suspend tests, after writing either "platform" > or "processors" to /sys/power/pm_test, > - It does not (or is less likely) to happen during full system suspend > ("core" or "none"). > > More investigation shows this happens when the PME scan runs, once per > second. During PME scan, the PCI host bridge (rcar-pci) registers are > accessed while the host bridge's module clock has already been disabled, > leading to a crash. OK, so clearly PME scans should be suspended before the host bridge registers become inaccessible. Another question, though, is whether or not PME scans are actually necessary on the affected platforms at all. > With "core" or "none", system suspend also disables timers, and thus the > workqueue handling PME scan no longer runs. I believe the issue can still > happen, as there's a small window between disabling module clocks and > disabling timers. > > Lukas' patch "[PATCH v2] PCI: pciehp: Don't enable PME on runtime suspend" > (http://lkml.iu.edu/hypermail/linux/kernel/1702.0/03245.html) is not > sufficient to fix the issue. > > Note that the issue was not introduced by commit 68db9bc81436 ("PCI: > pciehp: Add runtime PM support for PCIe hotplug ports"): I managed to > trigger it on 68db9bc81436^ too, albeit not at first try. > > Do you have a clue? Pretty much. :-) The PME scans cannot run on a suspended host bridge. > Shall I bisect it? I have no idea when the issue appeared first, or if it ever > worked. It's never worked IMO. Thanks, Rafael