Date: Mon, 10 Nov 2014 16:56:34 +0100 From: Gilles Chanteperdrix Message-ID: <20141110155634.GM17476@sisyphus.hd.free.fr> References: <04e5e7e2fab241a5916e4e48f9d9b325@EX132MBOX1B.de2.local> <20141109155351.GH17476@sisyphus.hd.free.fr> <28083d9b9cc34fce9a6d308e8d12fbc6@EX132MBOX1B.de2.local> <20141110124308.GK17476@sisyphus.hd.free.fr> <5460D139.7090709@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5460D139.7090709@siemens.com> Subject: Re: [Xenomai] "inconsistent lock state" on boot-up List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: "xenomai@xenomai.org" On Mon, Nov 10, 2014 at 03:52:41PM +0100, Jan Kiszka wrote: > On 2014-11-10 13:43, Gilles Chanteperdrix wrote: > > On Mon, Nov 10, 2014 at 09:08:47AM +0000, Stoidner, Christoph wrote: > >> > >> Hi Gilles, > >> > >>> Do you have the same message with exactly the same kernel > >>> configuration, only with CONFIG_XENOMAI and CONFIG_IPIPE disabled? > >> > >> When CONFIG_XENOMAI and CONFIG_IPIPE are disabled the message does not > >> appear on boot-up. > >> > >>> Do you have FCSE enabled? If yes, did you try disabling it? same > >>> with unlocked context switch. > >> > >> FCSE is already disabled at all. > >> > >> Do you have an idea how to overcome the problem? > > > > I am not sure the lockdep message really is a problem. lockdep could > > be confused by the fact that the hardware interrupts are not off > > when running the I-pipe, or because we are missing some bit in the > > I-pipe arm specific code to get it looking at the virtual mask > > instead of the hardware mask. > > > > As for the scheduling while atomic and random segmentation fault, > > you should use the I-pipe tracer, configure it with enough back > > trace points, something like 1000 or 10000, and trigger a trace > > freeze in the kernell code when the problem happens. > > > > Also, for the "scheduling while atomic", it may happen if you call > > some Linux service which reschedules from primary mode, you can try > > enabling I-pipe debugging, and in fact all Xenomai debugging, to try > > and catch such mistakes. This is especially important if you are > > running a custom skin. > > "Scheduling while atomic" may have the same reason why lockdep stumbles: > some changes of I-pipe messe up with IRQ state tracing of Linux. I just > started to look into this issue again. We tried earlier but got distracted. I doubt that very much. Though I never run with lockdep, I sometimes run with CONFIG_PREEMPT, and never saw this message. From what I can see, the "scheduling while atomic" message is based on the preempt_count only and does not use irqs_disabled() (which by the way is known to work with I-pipe on ARM as well, so, if something is broken, that should be something more obscure). -- Gilles.