aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Getz <rgetz@blackfin.uclinux.org>2008-03-25 21:17:43 -0400
committerBryan Wu <cooloney@kernel.org>2008-03-25 21:17:43 -0400
commit904656cda10ce985e6bc8b16488b58236eaec8e2 (patch)
treef995993f5dddd985da0dec9207feef984fca3725
parent9a62ca40fd793742f92565104c6b44319af8c282 (diff)
[Blackfin] arch: fix bug - grab locks when not atomic
grab locks when not atomic - this fixes the issues sometimes seen when using magic sysrq. Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r--arch/blackfin/kernel/traps.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 7557d0dce216..de249d6fdd9c 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -75,7 +75,7 @@ static void decode_address(char *buf, unsigned long address)
75 struct task_struct *p; 75 struct task_struct *p;
76 struct mm_struct *mm; 76 struct mm_struct *mm;
77 unsigned long flags, offset; 77 unsigned long flags, offset;
78 unsigned int in_exception = bfin_read_IPEND() & 0x10; 78 unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic();
79 79
80#ifdef CONFIG_KALLSYMS 80#ifdef CONFIG_KALLSYMS
81 unsigned long symsize; 81 unsigned long symsize;
@@ -117,7 +117,7 @@ static void decode_address(char *buf, unsigned long address)
117 */ 117 */
118 write_lock_irqsave(&tasklist_lock, flags); 118 write_lock_irqsave(&tasklist_lock, flags);
119 for_each_process(p) { 119 for_each_process(p) {
120 mm = (in_exception ? p->mm : get_task_mm(p)); 120 mm = (in_atomic ? p->mm : get_task_mm(p));
121 if (!mm) 121 if (!mm)
122 continue; 122 continue;
123 123
@@ -146,14 +146,14 @@ static void decode_address(char *buf, unsigned long address)
146 146
147 sprintf(buf, "<0x%p> [ %s + 0x%lx ]", 147 sprintf(buf, "<0x%p> [ %s + 0x%lx ]",
148 (void *)address, name, offset); 148 (void *)address, name, offset);
149 if (!in_exception) 149 if (!in_atomic)
150 mmput(mm); 150 mmput(mm);
151 goto done; 151 goto done;
152 } 152 }
153 153
154 vml = vml->next; 154 vml = vml->next;
155 } 155 }
156 if (!in_exception) 156 if (!in_atomic)
157 mmput(mm); 157 mmput(mm);
158 } 158 }
159 159