Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbcDUNu5 (ORCPT ); Thu, 21 Apr 2016 09:50:57 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:53507 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752215AbcDUNuz (ORCPT ); Thu, 21 Apr 2016 09:50:55 -0400 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: shreyas@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org From: "Shreyas B. Prabhu" To: mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, paulus@ozlabs.org, linux-kernel@vger.kernel.org, mikey@neuling.org, "Shreyas B. Prabhu" Subject: [PATCH 4/9] powerpc/powernv: Make power7_powersave_common more generic Date: Thu, 21 Apr 2016 19:19:54 +0530 Message-Id: <1461246599-6098-5-git-send-email-shreyas@linux.vnet.ibm.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1461246599-6098-1-git-send-email-shreyas@linux.vnet.ibm.com> References: <1461246599-6098-1-git-send-email-shreyas@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16042113-0021-0000-0000-00003EBE7BE6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2358 Lines: 79 power7_powersave_common does common steps needed before entering idle state and eventually changes MSR to MSR_IDLE and does rfid to power7_enter_nap_mode. Make it more generic by passing the rfid address as a function parameter. Also make function name more generic. Signed-off-by: Shreyas B. Prabhu --- arch/powerpc/kernel/idle_power7.S | 11 +++++++---- arch/powerpc/kernel/idle_power_common.S | 11 ++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/idle_power7.S b/arch/powerpc/kernel/idle_power7.S index 594e1c5..1ea71d4 100644 --- a/arch/powerpc/kernel/idle_power7.S +++ b/arch/powerpc/kernel/idle_power7.S @@ -169,19 +169,22 @@ _GLOBAL(power7_idle) _GLOBAL(power7_nap) mr r4,r3 li r3,PNV_THREAD_NAP - b power7_powersave_common + LOAD_REG_ADDR(r5, power7_enter_nap_mode) + b power_powersave_common /* No return */ _GLOBAL(power7_sleep) li r3,PNV_THREAD_SLEEP li r4,1 - b power7_powersave_common + LOAD_REG_ADDR(r5, power7_enter_nap_mode) + b power_powersave_common /* No return */ _GLOBAL(power7_winkle) - li r3,3 + li r3,PNV_THREAD_WINKLE li r4,1 - b power7_powersave_common + LOAD_REG_ADDR(r5, power7_enter_nap_mode) + b power_powersave_common /* No return */ _GLOBAL(power7_wakeup_tb_loss) diff --git a/arch/powerpc/kernel/idle_power_common.S b/arch/powerpc/kernel/idle_power_common.S index 05954ae..ff7a541 100644 --- a/arch/powerpc/kernel/idle_power_common.S +++ b/arch/powerpc/kernel/idle_power_common.S @@ -21,8 +21,10 @@ * To check IRQ_HAPPENED in r4 * 0 - don't check * 1 - check + * + * Address to 'rfid' to in r5 */ -_GLOBAL(power7_powersave_common) +_GLOBAL(power_powersave_common) /* Use r3 to pass state nap/sleep/winkle */ /* NAP is a state loss, we create a regs frame on the * stack, fill it up with the state we care about and @@ -79,13 +81,12 @@ _GLOBAL(power7_powersave_common) * because as soon as we do that, another thread can switch * the MMU context to the guest. */ - LOAD_REG_IMMEDIATE(r5, MSR_IDLE) + LOAD_REG_IMMEDIATE(r7, MSR_IDLE) li r6, MSR_RI andc r6, r9, r6 - LOAD_REG_ADDR(r7, power7_enter_nap_mode) mtmsrd r6, 1 /* clear RI before setting SRR0/1 */ - mtspr SPRN_SRR0, r7 - mtspr SPRN_SRR1, r5 + mtspr SPRN_SRR0, r5 + mtspr SPRN_SRR1, r7 rfid /* No return */ -- 2.1.4