Skip to content

Commit

Permalink
[Blackfin] arch: fix bug - grab locks when not atomic
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robin Getz authored and Bryan Wu committed Mar 26, 2008
1 parent 9a62ca4 commit 904656c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/blackfin/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void decode_address(char *buf, unsigned long address)
struct task_struct *p;
struct mm_struct *mm;
unsigned long flags, offset;
unsigned int in_exception = bfin_read_IPEND() & 0x10;
unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic();

#ifdef CONFIG_KALLSYMS
unsigned long symsize;
Expand Down Expand Up @@ -117,7 +117,7 @@ static void decode_address(char *buf, unsigned long address)
*/
write_lock_irqsave(&tasklist_lock, flags);
for_each_process(p) {
mm = (in_exception ? p->mm : get_task_mm(p));
mm = (in_atomic ? p->mm : get_task_mm(p));
if (!mm)
continue;

Expand Down Expand Up @@ -146,14 +146,14 @@ static void decode_address(char *buf, unsigned long address)

sprintf(buf, "<0x%p> [ %s + 0x%lx ]",
(void *)address, name, offset);
if (!in_exception)
if (!in_atomic)
mmput(mm);
goto done;
}

vml = vml->next;
}
if (!in_exception)
if (!in_atomic)
mmput(mm);
}

Expand Down

0 comments on commit 904656c

Please sign in to comment.