Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757650AbXEWEGc (ORCPT ); Wed, 23 May 2007 00:06:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756017AbXEWEGX (ORCPT ); Wed, 23 May 2007 00:06:23 -0400 Received: from www.osadl.org ([213.239.205.134]:48880 "EHLO mail.tglx.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755961AbXEWEGX (ORCPT ); Wed, 23 May 2007 00:06:23 -0400 Subject: Re: LOCKDEP: possible irq lock inversion dependency detected From: Thomas Gleixner To: Sven-Thorsten Dietrich Cc: Ingo Molnar , LKML In-Reply-To: <1179879569.25500.74.camel@sx.thebigcorporation.com> References: <1179879569.25500.74.camel@sx.thebigcorporation.com> Content-Type: text/plain Date: Wed, 23 May 2007 06:06:20 +0200 Message-Id: <1179893180.12708.145.camel@chaos> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3187 Lines: 48 On Tue, 2007-05-22 at 17:19 -0700, Sven-Thorsten Dietrich wrote: > swapper/1 just changed the state of lock: > (rtc_lock#2){-...}, at: [] sbf_init+0x25/0xe0 > but this lock was taken by another, hard-irq-safe lock in the past: > (xtime_lock){+...} > > and interrupts could create inverse lock ordering between them. > > > other info that might help us debug this: > no locks held by swapper/1. > > the first lock's dependencies: > -> (rtc_lock#2){-...} ops: 2 { > initial-use at: > [] mark_lock+0xf3/0x5b0 > [] __lock_acquire+0x664/0xf80 > [] lock_acquire+0x88/0xc0 > [] rt_spin_lock+0x35/0x40 > [] read_persistent_clock+0x22/0x1b0 > [] timekeeping_init+0x86/0x100 > [] start_kernel+0x1bf/0x350 > [] _sinittext+0x179/0x180 > [] 0xffffffffffffffff Hmm. That's the code in question: void __init timekeeping_init(void) { unsigned long flags; unsigned long sec = read_persistent_clock(); write_seqlock_irqsave(&xtime_lock, flags); The rtc_lock is never taken inside the xtime_lock. Looks like code reordering due to gcc extra magic. Which compiler ? Thanks, tglx - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/