]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: Fix watchpoint restoration
authorJames Hogan <james.hogan@imgtec.com>
Tue, 1 Mar 2016 22:19:36 +0000 (22:19 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 9 May 2016 10:00:02 +0000 (12:00 +0200)
commiteb6b95933cad87f23cc2ca0d515d3fc45717b4ff
tree09b9d1962f4a5b24659f765c9abc5a181b3c37ea
parent6f7236403144d20b1fb4e62564502a6c09b20306
MIPS: Fix watchpoint restoration

Commit 64cc4f8f7cd3 ("MIPS: Get rid of finish_arch_switch().") moved the
__restore_watch() call from finish_arch_switch() (i.e. after resume()
returns) to before the resume() call in switch_to(). This results in
watchpoints only being restored when a task is descheduled, preventing
the watchpoints from being effective most of the time, except due to
chance before the watchpoints are lazily removed.

Fix the call sequence from switch_to() through to
mips_install_watch_registers() to pass the task_struct pointer of the
next task, instead of using current. This allows the watchpoints for the
next (non-current) task to be restored without reintroducing
finish_arch_switch().

Fixes: 64cc4f8f7cd3 ("MIPS: Get rid of finish_arch_switch().")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 4.3.x-
Patchwork: https://patchwork.linux-mips.org/patch/12726/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/switch_to.h
arch/mips/include/asm/watch.h
arch/mips/kernel/pm.c
arch/mips/kernel/watch.c