]> git.notmuchmail.org Git - notmuch/blob - test/corpora/lkml/cur/1382298805.004526:2,
Import notmuch_0.27.orig.tar.gz
[notmuch] / test / corpora / lkml / cur / 1382298805.004526:2,
1 From: Colin Cross <ccross@android.com>
2 Subject: [PATCH] ARM: vfp: Always save VFP state in vfp_pm_suspend
3 Date: Sun, 13 Feb 2011 15:13:33 -0800
4 Lines: 45
5 Message-ID: <1297638813-1315-1-git-send-email-ccross@android.com>
6 Cc: Colin Cross <ccross@android.com>,
7         Catalin Marinas <catalin.marinas@arm.com>,
8         Russell King <linux@arm.linux.org.uk>,
9         linux-kernel@vger.kernel.org
10 To: linux-arm-kernel@lists.infradead.org
11 X-From: linux-kernel-owner@vger.kernel.org Mon Feb 14 00:14:16 2011
12 Return-path: <linux-kernel-owner@vger.kernel.org>
13 Envelope-to: glk-linux-kernel-3@lo.gmane.org
14 Received: from vger.kernel.org ([209.132.180.67])
15         by lo.gmane.org with esmtp (Exim 4.69)
16         (envelope-from <linux-kernel-owner@vger.kernel.org>)
17         id 1Pol8x-0007RZ-Hw
18         for glk-linux-kernel-3@lo.gmane.org; Mon, 14 Feb 2011 00:14:15 +0100
19 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
20         id S1755242Ab1BMXOA (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>);
21         Sun, 13 Feb 2011 18:14:00 -0500
22 Received: from smtp-out.google.com ([74.125.121.67]:10204 "EHLO
23         smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
24         with ESMTP id S1753669Ab1BMXN5 (ORCPT
25         <rfc822;linux-kernel@vger.kernel.org>);
26         Sun, 13 Feb 2011 18:13:57 -0500
27 Received: from hpaq1.eem.corp.google.com (hpaq1.eem.corp.google.com [172.25.149.1])
28         by smtp-out.google.com with ESMTP id p1DNDjFc030645;
29         Sun, 13 Feb 2011 15:13:45 -0800
30 Received: from walnut.mtv.corp.google.com (walnut.mtv.corp.google.com [172.18.102.62])
31         by hpaq1.eem.corp.google.com with ESMTP id p1DNDdKg016468;
32         Sun, 13 Feb 2011 15:13:39 -0800
33 Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897)
34         id 1F65025772D; Sun, 13 Feb 2011 15:13:39 -0800 (PST)
35 X-Mailer: git-send-email 1.7.3.1
36 X-System-Of-Record: true
37 Sender: linux-kernel-owner@vger.kernel.org
38 Precedence: bulk
39 List-ID: <linux-kernel.vger.kernel.org>
40 X-Mailing-List: linux-kernel@vger.kernel.org
41 Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1099558>
42
43 vfp_pm_suspend should save the VFP state any time there is
44 a last_VFP_context.  If it only saves when the VFP is enabled,
45 the state can get lost when, on a UP system:
46    Thread 1 uses the VFP
47    Context switch occurs to thread 2, VFP is disabled but the
48       VFP context is not saved to allow lazy save and restore
49    Thread 2 initiates suspend
50    vfp_pm_suspend is called with the VFP disabled, but the
51       context has not been saved.
52
53 Modify vfp_pm_suspend to save the VFP context whenever
54 last_VFP_context is set.
55
56 Cc: Catalin Marinas <catalin.marinas@arm.com>
57 Signed-off-by: Colin Cross <ccross@android.com>
58 ---
59  arch/arm/vfp/vfpmodule.c |   11 +++++------
60  1 files changed, 5 insertions(+), 6 deletions(-)
61
62 diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
63 index 66bf8d1..7aea616 100644
64 --- a/arch/arm/vfp/vfpmodule.c
65 +++ b/arch/arm/vfp/vfpmodule.c
66 @@ -415,13 +415,12 @@ static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state)
67         struct thread_info *ti = current_thread_info();
68         u32 fpexc = fmrx(FPEXC);
69  
70 -       /* if vfp is on, then save state for resumption */
71 -       if (fpexc & FPEXC_EN) {
72 +       /* save state for resume */
73 +       if (last_VFP_context[ti->cpu]) {
74                 printk(KERN_DEBUG "%s: saving vfp state\n", __func__);
75 -               vfp_save_state(&ti->vfpstate, fpexc);
76 -
77 -               /* disable, just in case */
78 -               fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
79 +               fmxr(FPEXC, fpexc | FPEXC_EN);
80 +               vfp_save_state(last_VFP_context[ti->cpu], fpexc);
81 +               fmxr(FPEXC, fpexc & ~FPEXC_EN);
82         }
83  
84         /* clear any information we had about last context state */
85 -- 
86 1.7.3.1
87
88
89