From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933480AbcBBPws (ORCPT ); Tue, 2 Feb 2016 10:52:48 -0500 Received: from www.linutronix.de ([62.245.132.108]:50974 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933268AbcBBPwr (ORCPT ); Tue, 2 Feb 2016 10:52:47 -0500 Date: Tue, 2 Feb 2016 16:51:38 +0100 (CET) From: Thomas Gleixner To: Nix cc: Andres Salomon , arnd@arndb.de, linux-kernel@vger.kernel.org Subject: Re: 4.4.1 regression from 4.1.x: Soekris net5501 crash in IRQ after mfgpt timer initialization In-Reply-To: <8760y7cfxq.fsf@esperi.org.uk> Message-ID: References: <87a8njchvj.fsf@esperi.org.uk> <8760y7cfxq.fsf@esperi.org.uk> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) 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 On Tue, 2 Feb 2016, Nix wrote: > On 2 Feb 2016, Thomas Gleixner said: > > > On Tue, 2 Feb 2016, Nix wrote: > > > >> [Cc:ed Thomas on the vague hope that maybe this is osmething to do with > >> the IRQ subsystem in general, though I doubt it, since only the one > >> machine is crashing for me: it's probably the CS5531's interactions > >> with said subsystem at fault.] > > > > Kinda. That driver does the following: > > > > setup the irq in CS5531 > > > > request the interrupt to install the handler > > > > register the clockevents device > > It seems like it should do those in the opposite order, really, or at > the very least do the IRQ setup last! Yes. > > So the interrupt hits before the clockevent device is registered and the event > > handler is installed. So mfgpt_tick() will happily call a null pointer. > > > > The patch below should fix^Wwork around the issue. > > The fairly trivial code motion below also seems to work, and may be more > like an actual fix, though I'm a bit horrified that it's this simple. I > may well have moved too much and unknowingly violated some invariant. I was lazy and did not do this, because it wreckages the error pathes. So I went for the workaround in the hope that the authors of that stuff will take care :) Thanks, tglx