Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1195441

[RFC][PATCH 5/7] sh: Fold finish_arch_switch() into switch_to()

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject [RFC][PATCH 5/7] sh: Fold finish_arch_switch() into switch_to()
Date 2015-07-29 21:30 +0200
Message-ID <pRFd7-AH-1@gated-at.bofh.it> (permalink)
References <pRFd7-AH-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The code looks buggy; why would we be restoring the previous task's
DSP state after we've switched to the next task?

Fix that and put the restore in switch_to(), removing the need for
finish_arch_switch().

Cc: michael@amarulasolutions.com
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/sh/include/asm/switch_to_32.h |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--- a/arch/sh/include/asm/switch_to_32.h
+++ b/arch/sh/include/asm/switch_to_32.h
@@ -78,6 +78,8 @@ do {								\
 								\
 	if (is_dsp_enabled(prev))				\
 		__save_dsp(prev);				\
+	if (is_dsp_enabled(next))				\
+		__restore_dsp(next);				\
 								\
 	__ts1 = (u32 *)&prev->thread.sp;			\
 	__ts2 = (u32 *)&prev->thread.pc;			\
@@ -125,10 +127,4 @@ do {								\
 	last = __last;						\
 } while (0)
 
-#define finish_arch_switch(prev)				\
-do {								\
-	if (is_dsp_enabled(prev))				\
-		__restore_dsp(prev);				\
-} while (0)
-
 #endif /* __ASM_SH_SWITCH_TO_32_H */


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[RFC][PATCH 5/7] sh: Fold finish_arch_switch() into switch_to() Peter Zijlstra <peterz@infradead.org> - 2015-07-29 21:30 +0200

csiph-web