From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754147AbbG2TWn (ORCPT ); Wed, 29 Jul 2015 15:22:43 -0400 Received: from casper.infradead.org ([85.118.1.10]:51194 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753454AbbG2TVQ (ORCPT ); Wed, 29 Jul 2015 15:21:16 -0400 Message-Id: <20150729191700.051531442@infradead.org> User-Agent: quilt/0.61-1 Date: Wed, 29 Jul 2015 21:08:53 +0200 From: Peter Zijlstra To: mingo@kernel.org, linux-kernel@vger.kernel.org Cc: will.deacon@arm.com, linux@arm.linux.org.uk, ralf@linux-mips.org, egtvedt@samfundet.no, michael@amarulasolutions.com, cmetcalf@ezchip.com, peterz@infradead.org Subject: [RFC][PATCH 5/7] sh: Fold finish_arch_switch() into switch_to() References: <20150729190848.678796654@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=peterz-sh-finish_arch_switch.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) --- 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 */