diff options
| author | Jeff Garzik <jeff@garzik.org> | 2007-01-24 02:14:25 -0500 |
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2007-01-24 02:14:25 -0500 |
| commit | e47b207a5bcb73bb097f94d9fe364f50737b0eb2 (patch) | |
| tree | 57389653c37d001de3a90655cb4172ba29199ce4 /kernel | |
| parent | d344bff9c36db17dc4765215495aaa7212c1eb6c (diff) | |
| parent | 419dd8378dfa32985672ab7927b4bc827f33b332 (diff) | |
Merge branch 'master' into upstream-fixes
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/irq/manage.c | 3 | ||||
| -rw-r--r-- | kernel/profile.c | 3 | ||||
| -rw-r--r-- | kernel/sys.c | 15 |
3 files changed, 16 insertions, 5 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index b385878c6e80..8b961adc3bd2 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -315,6 +315,9 @@ int setup_irq(unsigned int irq, struct irqaction *new) /* Undo nested disables: */ desc->depth = 1; } + /* Reset broken irq detection when installing new handler */ + desc->irq_count = 0; + desc->irqs_unhandled = 0; spin_unlock_irqrestore(&desc->lock, flags); new->irq = irq; diff --git a/kernel/profile.c b/kernel/profile.c index a6574a18514e..d6579d511069 100644 --- a/kernel/profile.c +++ b/kernel/profile.c @@ -331,7 +331,6 @@ out: local_irq_restore(flags); put_cpu(); } -EXPORT_SYMBOL_GPL(profile_hits); static int __devinit profile_cpu_callback(struct notifier_block *info, unsigned long action, void *__cpu) @@ -401,6 +400,8 @@ void profile_hits(int type, void *__pc, unsigned int nr_hits) } #endif /* !CONFIG_SMP */ +EXPORT_SYMBOL_GPL(profile_hits); + void profile_tick(int type) { struct pt_regs *regs = get_irq_regs(); diff --git a/kernel/sys.c b/kernel/sys.c index c7675c1bfdf2..6e2101dec0fc 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -323,11 +323,18 @@ EXPORT_SYMBOL_GPL(blocking_notifier_chain_unregister); int blocking_notifier_call_chain(struct blocking_notifier_head *nh, unsigned long val, void *v) { - int ret; + int ret = NOTIFY_DONE; - down_read(&nh->rwsem); - ret = notifier_call_chain(&nh->head, val, v); - up_read(&nh->rwsem); + /* + * We check the head outside the lock, but if this access is + * racy then it does not matter what the result of the test + * is, we re-check the list after having taken the lock anyway: + */ + if (rcu_dereference(nh->head)) { + down_read(&nh->rwsem); + ret = notifier_call_chain(&nh->head, val, v); + up_read(&nh->rwsem); + } return ret; } |
