Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754114AbdLNWg2 (ORCPT ); Thu, 14 Dec 2017 17:36:28 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:38515 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753916AbdLNWgZ (ORCPT ); Thu, 14 Dec 2017 17:36:25 -0500 Date: Thu, 14 Dec 2017 23:36:18 +0100 (CET) From: Thomas Gleixner To: Linus Torvalds cc: Bjorn Helgaas , Maarten Lankhorst , Michal Hocko , "Rafael J. Wysocki" , Andy Lutomirski , Linux Kernel Mailing List , the arch/x86 maintainers , Daniel Vetter , Bjorn Helgaas , "Rafael J. Wysocki" , linux-pci@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: Linux 4.15-rc2: Regression in resume from ACPI S3 In-Reply-To: Message-ID: References: <168050887.sZlTFXWCmO@aspire.rjw.lan> <20171206121452.GA6320@dhcp22.suse.cz> <0f1d3d63-fa10-5cef-8014-81753dc60243@mblankhorst.nl> <57c8679e-1b88-c9ad-2299-2bea7560b28f@mblankhorst.nl> <20171213162336.GG53955@bhelgaas-glaptop.roam.corp.google.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1633 Lines: 39 On Thu, 14 Dec 2017, Linus Torvalds wrote: > On Thu, Dec 14, 2017 at 3:54 AM, Thomas Gleixner wrote: > I just wanted to pipe up about that "irq7", because judging from your > email it seems like you think it's a real irq: > > > Now there is a race > > whether the kernel resume path manages to mask the PIC again early enough > > before something triggers IRQ7 or not. > > ..and that's not how the PIC works. > > In fact, "legacy irq 7" is the _normal_ and very traditional spurious > interrupt, and it's documented. If the PIC gets an interrupt from > _any_ source, but the interrupt goes away before the PIC gets an > acknowledge from the CPU (and by "acknowledge", I'm not talking about > the explicit software IRQ ACK, I'm talking about the hardware > protocol, between the PIC and the CPU), the PIC will then report irq 7 > as the interrupt - regardless of what the original was. > > The reason is almost always something like > > - CPU interrupts are disabled or masked > > - driver does a write to the external hardware that causes an > interrupt to be raised Which should be a non issue because _ALL_ PIC irq lines are masked at the PIC itself. All interrupts are routed through IOAPIC. So unless the IOAPIC sports similar behaviour the PIC should not ever observe that scenario. But, because the silly firmware comes out of suspend with all PIC lines unmasked for whatever reason, the PIC can observe that IRQ being raised and the CPU not handling it. So yes, I forgot about 7 being magic, but I still think it's the firmware which causes it by unmasking the PIC irqs. Thanks, tglx