kgdb: Avoid suspicious RCU usage warning
[sfrench/cifs-2.6.git] / kernel / debug / debug_core.c
index bc8d25f2ac8ad78aa62d49c2c78dedaf43ca99de..9e5934780f4141e600e0078dfba8195c1a4e0984 100644 (file)
@@ -587,6 +587,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs,
                arch_kgdb_ops.disable_hw_break(regs);
 
 acquirelock:
+       rcu_read_lock();
        /*
         * Interrupts will be restored by the 'trap return' code, except when
         * single stepping.
@@ -646,6 +647,7 @@ return_normal:
                        atomic_dec(&slaves_in_kgdb);
                        dbg_touch_watchdogs();
                        local_irq_restore(flags);
+                       rcu_read_unlock();
                        return 0;
                }
                cpu_relax();
@@ -664,6 +666,7 @@ return_normal:
                raw_spin_unlock(&dbg_master_lock);
                dbg_touch_watchdogs();
                local_irq_restore(flags);
+               rcu_read_unlock();
 
                goto acquirelock;
        }
@@ -787,6 +790,7 @@ kgdb_restore:
        raw_spin_unlock(&dbg_master_lock);
        dbg_touch_watchdogs();
        local_irq_restore(flags);
+       rcu_read_unlock();
 
        return kgdb_info[cpu].ret_state;
 }