Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754395AbdFLQto (ORCPT ); Mon, 12 Jun 2017 12:49:44 -0400 Received: from cust-95-128-94-82.breedbanddelft.nl ([95.128.94.82]:40174 "EHLO cust-95-128-94-82.breedbanddelft.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754420AbdFLQt0 (ORCPT ); Mon, 12 Jun 2017 12:49:26 -0400 X-Greylist: delayed 599 seconds by postgrey-1.27 at vger.kernel.org; Mon, 12 Jun 2017 12:49:25 EDT Date: Mon, 12 Jun 2017 18:33:37 +0200 From: Rogier Wolff To: Marc Zyngier Cc: Phil Elwell , Thomas Gleixner , Jason Cooper , Rob Herring , Mark Rutland , Florian Fainelli , Stefan Wahren , Eric Anholt , Russell King , Michael Turquette , Stephen Boyd , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: Re: [PATCH v2 3/4] irqchip: Add BCM2835 AUX interrupt controller Message-ID: <20170612163337.GG18236@BitWizard.nl> References: <56e314db-49a9-48fa-d7d9-877bd68aadfc@arm.com> <9cbf68ce-6041-3e04-8f82-8d948ab4a716@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9cbf68ce-6041-3e04-8f82-8d948ab4a716@arm.com> Organization: BitWizard B.V. User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2274 Lines: 47 On Mon, Jun 12, 2017 at 05:19:03PM +0100, Marc Zyngier wrote: > > Does Linux not notice when one calls generic_handle_irq with the number of an > > interrupt without a handler? > > It is not so much that the interrupt doesn't have a handler, but that > the device (or one of the devices) is in some sort of interrupt frenzy, > and the driver is not able to handle this interrupt. > > In such a case, Linux tries to mask this interrupt, which in your case > does exactly nothing. At this point, the system is dead. In the old days, you had edge-triggered interrupts. That always led to race conditions: If you handled the interrupt, the hardware might fire an interrupt again AFTER you've checked: "nothing more to do?" and before you have told the hardware "I've seen that interrupt". So then you end up with hardware thinking the interrupt has been handled while it has in fact not been handled. You can be very careful in what order you do things, and get it almost right.... So nowadays interrupts are level triggered. That means that a device that wants attention, but for SOME reason, thinks that it was not properly handled will keep the interrupt line asserted, and interrupts will keep firing. When this happens (it's common when you're writing the device driver, but it sometimes happens in the field when something unexpected occurs), an interrupt storm starts. As soon as the generic handler returns from interrupt, the hardware reenters the interrupt handler. Without any countermeasures, the system would lock up without much debugging options. Nowadays (since two decades or so), the Linux kernel can disable the interrupt, print an error message and try to continue. It won't work if other important interrupts for the system were on the same IRQ line, but often enough, you just get a message that an interrupt was disabled and that one peripheral will stop working. Good opportunities for debugging the situation. Roger. -- ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 ** ** Delftechpark 26 2628 XH Delft, The Netherlands. KVK: 27239233 ** *-- BitWizard writes Linux device drivers for any device you may have! --* The plan was simple, like my brother-in-law Phil. But unlike Phil, this plan just might work.