Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 904656cd authored by Robin Getz's avatar Robin Getz Committed by Bryan Wu
Browse files

[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: default avatarRobin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent 9a62ca40
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -75,7 +75,7 @@ static void decode_address(char *buf, unsigned long address)
	struct task_struct *p;
	struct task_struct *p;
	struct mm_struct *mm;
	struct mm_struct *mm;
	unsigned long flags, offset;
	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
#ifdef CONFIG_KALLSYMS
	unsigned long symsize;
	unsigned long symsize;
@@ -117,7 +117,7 @@ static void decode_address(char *buf, unsigned long address)
	 */
	 */
	write_lock_irqsave(&tasklist_lock, flags);
	write_lock_irqsave(&tasklist_lock, flags);
	for_each_process(p) {
	for_each_process(p) {
		mm = (in_exception ? p->mm : get_task_mm(p));
		mm = (in_atomic ? p->mm : get_task_mm(p));
		if (!mm)
		if (!mm)
			continue;
			continue;


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


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


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