diff options
| -rw-r--r-- | lib/dump_stack.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/dump_stack.c b/lib/dump_stack.c index 6745c6230db3..c30d07e99dba 100644 --- a/lib/dump_stack.c +++ b/lib/dump_stack.c | |||
| @@ -25,6 +25,7 @@ static atomic_t dump_lock = ATOMIC_INIT(-1); | |||
| 25 | 25 | ||
| 26 | asmlinkage __visible void dump_stack(void) | 26 | asmlinkage __visible void dump_stack(void) |
| 27 | { | 27 | { |
| 28 | unsigned long flags; | ||
| 28 | int was_locked; | 29 | int was_locked; |
| 29 | int old; | 30 | int old; |
| 30 | int cpu; | 31 | int cpu; |
| @@ -33,9 +34,8 @@ asmlinkage __visible void dump_stack(void) | |||
| 33 | * Permit this cpu to perform nested stack dumps while serialising | 34 | * Permit this cpu to perform nested stack dumps while serialising |
| 34 | * against other CPUs | 35 | * against other CPUs |
| 35 | */ | 36 | */ |
| 36 | preempt_disable(); | ||
| 37 | |||
| 38 | retry: | 37 | retry: |
| 38 | local_irq_save(flags); | ||
| 39 | cpu = smp_processor_id(); | 39 | cpu = smp_processor_id(); |
| 40 | old = atomic_cmpxchg(&dump_lock, -1, cpu); | 40 | old = atomic_cmpxchg(&dump_lock, -1, cpu); |
| 41 | if (old == -1) { | 41 | if (old == -1) { |
| @@ -43,6 +43,7 @@ retry: | |||
| 43 | } else if (old == cpu) { | 43 | } else if (old == cpu) { |
| 44 | was_locked = 1; | 44 | was_locked = 1; |
| 45 | } else { | 45 | } else { |
| 46 | local_irq_restore(flags); | ||
| 46 | cpu_relax(); | 47 | cpu_relax(); |
| 47 | goto retry; | 48 | goto retry; |
| 48 | } | 49 | } |
| @@ -52,7 +53,7 @@ retry: | |||
| 52 | if (!was_locked) | 53 | if (!was_locked) |
| 53 | atomic_set(&dump_lock, -1); | 54 | atomic_set(&dump_lock, -1); |
| 54 | 55 | ||
| 55 | preempt_enable(); | 56 | local_irq_restore(flags); |
| 56 | } | 57 | } |
| 57 | #else | 58 | #else |
| 58 | asmlinkage __visible void dump_stack(void) | 59 | asmlinkage __visible void dump_stack(void) |
