Re: v2.6.24-mm1 lockdep.c warning

2008-02-04 Thread Andrew Morton
On Mon, 04 Feb 2008 20:26:00 -0400
Kevin Winchester <[EMAIL PROTECTED]> wrote:

> Found this in my dmesg:
> 
> [   10.671500] [ cut here ]
> [   10.671500] WARNING: at kernel/lockdep.c:2037
> trace_hardirqs_on+0xba/0x113()
> [   10.671500] Pid: 0, comm: swapper Not tainted 2.6.24-mm1 #2
> [   10.671500]  [] warn_on_slowpath+0x3c/0x4c
> [   10.671500]  [] ? check_usage_forwards+0x19/0x3b
> [   10.671500]  [] ? mark_lock+0x1ab/0x3ae
> [   10.671500]  [] ? ata_hsm_qc_complete+0xbc/0xc2
> [   10.671500]  [] ? _spin_unlock_irq+0x22/0x42
> [   10.671500]  [] trace_hardirqs_on+0xba/0x113
> [   10.671500]  [] _spin_unlock_irq+0x22/0x42
> [   10.671500]  [] hpet_rtc_interrupt+0xe8/0x299
> [   10.671500]  [] handle_IRQ_event+0x1a/0x46
> [   10.671500]  [] handle_edge_irq+0xa6/0x102
> [   10.671500]  [] ? handle_edge_irq+0x0/0x102
> [   10.671500]  [] do_IRQ+0x87/0xb0
> [   10.671500]  [] common_interrupt+0x2e/0x34
> [   10.671500]  [] ? default_idle+0x45/0x72
> [   10.671500]  [] ? default_idle+0x0/0x72
> [   10.671500]  [] cpu_idle+0x73/0xa3
> [   10.671500]  [] rest_init+0x61/0x63
> [   10.671500]  ===
> [   10.671500] ---[ end trace e5cdd42f557be0f0 ]---
> 
yup, I hit that too.  It looks like Ingo has deided to merge the
below into mainline.  I'll put it in the hot-fixes directory.


From: Andrew Morton <[EMAIL PROTECTED]>

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 include/asm-generic/rtc.h |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff -puN include/linux/rtc.h~hpet-borkage-fix include/linux/rtc.h
diff -puN include/asm-generic/rtc.h~hpet-borkage-fix include/asm-generic/rtc.h
--- a/include/asm-generic/rtc.h~hpet-borkage-fix
+++ a/include/asm-generic/rtc.h
@@ -35,10 +35,11 @@
 static inline unsigned char rtc_is_updating(void)
 {
unsigned char uip;
+   unsigned long flags;
 
-   spin_lock_irq(&rtc_lock);
+   spin_lock_irqsave(&rtc_lock, flags);
uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
-   spin_unlock_irq(&rtc_lock);
+   spin_unlock_irqrestore(&rtc_lock, flags);
return uip;
 }
 
@@ -46,6 +47,8 @@ static inline unsigned int get_rtc_time(
 {
unsigned long uip_watchdog = jiffies;
unsigned char ctrl;
+   unsigned long flags;
+
 #ifdef CONFIG_MACH_DECSTATION
unsigned int real_year;
 #endif
@@ -72,7 +75,7 @@ static inline unsigned int get_rtc_time(
 * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated
 * by the RTC when initially set to a non-zero value.
 */
-   spin_lock_irq(&rtc_lock);
+   spin_lock_irqsave(&rtc_lock, flags);
time->tm_sec = CMOS_READ(RTC_SECONDS);
time->tm_min = CMOS_READ(RTC_MINUTES);
time->tm_hour = CMOS_READ(RTC_HOURS);
@@ -83,7 +86,7 @@ static inline unsigned int get_rtc_time(
real_year = CMOS_READ(RTC_DEC_YEAR);
 #endif
ctrl = CMOS_READ(RTC_CONTROL);
-   spin_unlock_irq(&rtc_lock);
+   spin_unlock_irqrestore(&rtc_lock, flags);
 
if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
{
_

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


v2.6.24-mm1 lockdep.c warning

2008-02-04 Thread Kevin Winchester

Found this in my dmesg:

[   10.671500] [ cut here ]
[   10.671500] WARNING: at kernel/lockdep.c:2037
trace_hardirqs_on+0xba/0x113()
[   10.671500] Pid: 0, comm: swapper Not tainted 2.6.24-mm1 #2
[   10.671500]  [] warn_on_slowpath+0x3c/0x4c
[   10.671500]  [] ? check_usage_forwards+0x19/0x3b
[   10.671500]  [] ? mark_lock+0x1ab/0x3ae
[   10.671500]  [] ? ata_hsm_qc_complete+0xbc/0xc2
[   10.671500]  [] ? _spin_unlock_irq+0x22/0x42
[   10.671500]  [] trace_hardirqs_on+0xba/0x113
[   10.671500]  [] _spin_unlock_irq+0x22/0x42
[   10.671500]  [] hpet_rtc_interrupt+0xe8/0x299
[   10.671500]  [] handle_IRQ_event+0x1a/0x46
[   10.671500]  [] handle_edge_irq+0xa6/0x102
[   10.671500]  [] ? handle_edge_irq+0x0/0x102
[   10.671500]  [] do_IRQ+0x87/0xb0
[   10.671500]  [] common_interrupt+0x2e/0x34
[   10.671500]  [] ? default_idle+0x45/0x72
[   10.671500]  [] ? default_idle+0x0/0x72
[   10.671500]  [] cpu_idle+0x73/0xa3
[   10.671500]  [] rest_init+0x61/0x63
[   10.671500]  ===
[   10.671500] ---[ end trace e5cdd42f557be0f0 ]---


I have no idea what went on here - I'll start tracing through the call
stack to see if I can figure anything out...

config below

-- 
Kevin Winchester

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.24-mm1
# Mon Feb  4 20:18:12 2008
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_X86_64 is not set
CONFIG_X86=y
# CONFIG_GENERIC_LOCKBREAK is not set
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_SEMAPHORE_SLEEPERS=y
CONFIG_FAST_CMPXCHG_LOCAL=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_QUICKLIST=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_HWEIGHT=y
# CONFIG_GENERIC_GPIO is not set
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_DMI=y
# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
CONFIG_GENERIC_CALIBRATE_DELAY=y
# CONFIG_GENERIC_TIME_VSYSCALL is not set
# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
# CONFIG_ZONE_DMA32 is not set
CONFIG_ARCH_POPULATES_NODE_MAP=y
# CONFIG_AUDIT_ARCH is not set
CONFIG_ARCH_SUPPORTS_AOUT=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_X86_BIOS_REBOOT=y
CONFIG_KTIME_SCALAR=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_SWAP=y
# CONFIG_SYSVIPC is not set
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
# CONFIG_AUDIT is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=17
# CONFIG_CGROUPS is not set
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_FAIR_USER_SCHED=y
# CONFIG_FAIR_CGROUP_SCHED is not set
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
# CONFIG_USER_NS is not set
# CONFIG_PID_NS is not set
# CONFIG_BLK_DEV_INITRD is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
# CONFIG_EMBEDDED is not set
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLUB_DEBUG=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
# CONFIG_MARKERS is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_KPROBES=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
# CONFIG_MODULES is not set
CONFIG_BLOCK=y
# CONFIG_LBD is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_LSF is not set
CONFIG_BLK_DEV_BSG=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
# CONFIG_IOSCHED_DEADLINE is not set
CONFIG_IOSCHED_CFQ=y
# CONFIG_DEFAULT_AS is not set
# CONFIG_DEFAULT_DEADLINE is not set
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"
# CONFIG_CLASSIC_RCU is not set
CONFIG_PREEMPT_RCU=y

#
# Processor type and features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
# CONFIG_SMP is not set
CONFIG_X86_PC=y
# CONFIG_X86_ELAN is not set
# CONFIG_X86_VOYAGER is not set
# CONFIG_X86_NUMAQ is not set
# CONFIG_X86_SUMMIT is not set
# CONFIG_X86_BIGSMP is not set
# CONFIG_X86_VISWS is not set
# CONFIG_X86_GENERICARCH is not set
# CONFIG_X86_ES7000 is not set
# CONFIG_X86_RDC321X is not set
# CONFIG_X86_V