summaryrefslogtreecommitdiffstats
path: root/mei-me-fix-hardware-reset-flow.patch
blob: b0c6c34b546496f1f19dc9d351ecb272cb7a52a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Delivered-To: jwboyer@gmail.com
Received: by 10.76.168.104 with SMTP id zv8csp116477oab;
        Sun, 25 Aug 2013 02:53:06 -0700 (PDT)
X-Received: by 10.66.146.42 with SMTP id sz10mr8515943pab.78.1377424384757;
        Sun, 25 Aug 2013 02:53:04 -0700 (PDT)
Return-Path: <stable-owner@vger.kernel.org>
Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67])
        by mx.google.com with ESMTP id zu9si6326866pbc.308.1969.12.31.16.00.00;
        Sun, 25 Aug 2013 02:53:04 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67;
Authentication-Results: mx.google.com;
       spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mail=stable-owner@vger.kernel.org
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
	id S1756391Ab3HYJwW (ORCPT <rfc822;outmanzhao@gmail.com>
	+ 58 others); Sun, 25 Aug 2013 05:52:22 -0400
Received: from mga03.intel.com ([143.182.124.21]:34236 "EHLO mga03.intel.com"
	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
	id S1756361Ab3HYJwT (ORCPT <rfc822;stable@vger.kernel.org>);
	Sun, 25 Aug 2013 05:52:19 -0400
Received: from azsmga001.ch.intel.com ([10.2.17.19])
  by azsmga101.ch.intel.com with ESMTP; 25 Aug 2013 02:52:18 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.89,951,1367996400"; 
   d="scan'208";a="351301674"
Received: from twinkler-dhg.jer.intel.com ([10.12.87.84])
  by azsmga001.ch.intel.com with ESMTP; 25 Aug 2013 02:52:16 -0700
From:	Tomas Winkler <tomas.winkler@intel.com>
To:	gregkh@linuxfoundation.org
Cc:	arnd@arndb.de, linux-kernel@vger.kernel.org,
	Tomas Winkler <tomas.winkler@intel.com>,
	stable@vger.kernel.org, Shuah Khan <shuah.kh@samsung.com>,
	Konstantin Khlebnikov <khlebnikov@openvz.org>
Subject: [3.10][PATCH 4/4] mei: me: fix hardware reset flow
Date:	Sun, 25 Aug 2013 12:49:49 +0300
Message-Id: <1377424189-5508-5-git-send-email-tomas.winkler@intel.com>
X-Mailer: git-send-email 1.8.1.2
In-Reply-To: <1377424189-5508-1-git-send-email-tomas.winkler@intel.com>
References: <1377424189-5508-1-git-send-email-tomas.winkler@intel.com>
Sender:	stable-owner@vger.kernel.org
Precedence: bulk
List-ID: <stable.vger.kernel.org>
X-Mailing-List:	stable@vger.kernel.org

stable: 3.10
commit ff96066e3171acdea356b331163495957cb833d0 char-misc


Both H_IS and H_IE needs to be set to receive H_RDY
interrupt

1. Assert H_IS to clear the interrupts during hw reset
and use mei_me_reg_write instead of mei_hcsr_set as the later
strips down the H_IS

2. fix interrupt disablement embarrassing typo
  hcsr |= ~H_IE -> hcsr &= ~H_IE;
this will remove the unwanted interrupt on power down

3. remove useless debug print outs

Cc: stable@vger.kernel.org
Cc: Shuah Khan <shuah.kh@samsung.com>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Conflicts:
	drivers/misc/mei/hw-me.c

---
 drivers/misc/mei/hw-me.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index 700fe55..1bf3f8b 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -176,16 +176,14 @@ static void mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
 	struct mei_me_hw *hw = to_me_hw(dev);
 	u32 hcsr = mei_hcsr_read(hw);
 
-	dev_dbg(&dev->pdev->dev, "before reset HCSR = 0x%08x.\n", hcsr);
-
-	hcsr |= (H_RST | H_IG);
+	hcsr |= H_RST | H_IG | H_IS;
 
 	if (intr_enable)
 		hcsr |= H_IE;
 	else
-		hcsr |= ~H_IE;
+		hcsr &= ~H_IE;
 
-	mei_hcsr_set(hw, hcsr);
+	mei_me_reg_write(hw, H_CSR, hcsr);
 
 	if (dev->dev_state == MEI_DEV_POWER_DOWN)
 		mei_me_hw_reset_release(dev);
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html