From patchwork Sun Jun 9 10:37:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongsheng Wang X-Patchwork-Id: 250033 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 936E52C0A5E for ; Sun, 9 Jun 2013 21:27:14 +1000 (EST) Received: from db8outboundpool.messaging.microsoft.com (mail-db8lp0189.outbound.messaging.microsoft.com [213.199.154.189]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "MSIT Machine Auth CA 2" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 6873F2C04D7 for ; Sun, 9 Jun 2013 21:24:08 +1000 (EST) Received: from mail104-db8-R.bigfish.com (10.174.8.246) by DB8EHSOBE020.bigfish.com (10.174.4.83) with Microsoft SMTP Server id 14.1.225.23; Sun, 9 Jun 2013 11:24:02 +0000 Received: from mail104-db8 (localhost [127.0.0.1]) by mail104-db8-R.bigfish.com (Postfix) with ESMTP id 6689FE001DC; Sun, 9 Jun 2013 11:24:02 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e23h1155h) Received: from mail104-db8 (localhost.localdomain [127.0.0.1]) by mail104-db8 (MessageSwitch) id 1370777040957179_22417; Sun, 9 Jun 2013 11:24:00 +0000 (UTC) Received: from DB8EHSMHS028.bigfish.com (unknown [10.174.8.253]) by mail104-db8.bigfish.com (Postfix) with ESMTP id DDC6394005D; Sun, 9 Jun 2013 11:24:00 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB8EHSMHS028.bigfish.com (10.174.4.38) with Microsoft SMTP Server (TLS) id 14.1.225.23; Sun, 9 Jun 2013 11:24:00 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.328.11; Sun, 9 Jun 2013 11:25:22 +0000 Received: from rock.am.freescale.net (rock.ap.freescale.net [10.193.20.106]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id r59BNm8c013891; Sun, 9 Jun 2013 04:23:56 -0700 From: Wang Dongsheng To: Subject: [PATCH 2/2] powerpc/hibernate: add restore mmu context after resume Date: Sun, 9 Jun 2013 18:37:40 +0800 Message-ID: <1370774260-31072-2-git-send-email-dongsheng.wang@freescale.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1370774260-31072-1-git-send-email-dongsheng.wang@freescale.com> References: <1370774260-31072-1-git-send-email-dongsheng.wang@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: anton@enomsg.org, Wang Dongsheng , scottwood@freescale.com, johannes@sipsolutions.net, linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" add restore_mmu_context to replace switch_mmu_context in restore_processor_state, because the switch_mmu_context will do a whole pile of stuff that are probably completely unnecessary. There just need to restore the existing process context, and invalidate TLB for boot core. Signed-off-by: Wang Dongsheng --- arch/powerpc/include/asm/tlbflush.h | 2 ++ arch/powerpc/kernel/swsusp.c | 4 +--- arch/powerpc/mm/tlb_nohash.c | 12 ++++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/tlbflush.h b/arch/powerpc/include/asm/tlbflush.h index 61a5927..c401fe3 100644 --- a/arch/powerpc/include/asm/tlbflush.h +++ b/arch/powerpc/include/asm/tlbflush.h @@ -44,6 +44,8 @@ extern void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmadd extern void __local_flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr, int tsize, int ind); +extern void restore_mmu_context(void); + #ifdef CONFIG_SMP extern void flush_tlb_mm(struct mm_struct *mm); extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); diff --git a/arch/powerpc/kernel/swsusp.c b/arch/powerpc/kernel/swsusp.c index eae33e1..0b104d7 100644 --- a/arch/powerpc/kernel/swsusp.c +++ b/arch/powerpc/kernel/swsusp.c @@ -32,7 +32,5 @@ void save_processor_state(void) void restore_processor_state(void) { -#ifdef CONFIG_PPC32 - switch_mmu_context(current->active_mm, current->active_mm); -#endif + restore_mmu_context(); } diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c index df32a83..a5a0708 100644 --- a/arch/powerpc/mm/tlb_nohash.c +++ b/arch/powerpc/mm/tlb_nohash.c @@ -39,10 +39,12 @@ #include #include +#include #include #include #include #include +#include #include "mmu_decl.h" @@ -193,6 +195,16 @@ void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr) } EXPORT_SYMBOL(local_flush_tlb_page); +void restore_mmu_context(void) +{ + struct mm_struct *mm = current->active_mm; + + set_context(mm->context.id, mm->pgd); + + _tlbil_all(); +} +EXPORT_SYMBOL(restore_mmu_context); + /* * And here are the SMP non-local implementations */