All of lore.kernel.org
 help / color / mirror / Atom feed
* [char-misc 3.11 V2] mei: me: fix hardware reset flow
@ 2013-07-30 11:11 Tomas Winkler
  2013-07-30 14:22 ` Greg KH
  0 siblings, 1 reply; 11+ messages in thread
From: Tomas Winkler @ 2013-07-30 11:11 UTC (permalink / raw)
  To: gregkh; +Cc: arnd, linux-kernel, Tomas Winkler, Shuah Khan,
	Konstantin Khlebnikov

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: Shuah Khan <shuah.kh@samsung.com>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---

V2: Fixed typo in Shuah email

Hope this finally resolve the ME reset issue for all

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

diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index b22c7e2..3412adc 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -176,21 +176,18 @@ static int 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);
 
-	dev_dbg(&dev->pdev->dev, "current HCSR = 0x%08x.\n", mei_hcsr_read(hw));
 	return 0;
 }
 
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-08-05  5:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-30 11:11 [char-misc 3.11 V2] mei: me: fix hardware reset flow Tomas Winkler
2013-07-30 14:22 ` Greg KH
2013-07-30 14:27   ` Shuah Khan
2013-07-30 14:28   ` Winkler, Tomas
2013-07-30 19:04     ` Shuah Khan
2013-07-30 19:30       ` Winkler, Tomas
2013-07-31 15:51         ` Shuah Khan
2013-07-31 16:01           ` Winkler, Tomas
2013-07-31 17:15             ` Shuah Khan
2013-08-05  5:27     ` Greg KH
2013-08-05  5:55       ` Winkler, Tomas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.