From 66ae460b13c31a176b41550259683c841a62af3e Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Wed, 8 Jan 2014 20:19:22 +0200 Subject: mei: use hbm idle state to prevent spurious resets When reset is caused by hbm protocol mismatch or timeout we might end up in an endless reset loop and hbm protocol will never sync Cc: Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/init.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'drivers/misc/mei/init.c') diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c index 87c077bae5d8..c47fa273879e 100644 --- a/drivers/misc/mei/init.c +++ b/drivers/misc/mei/init.c @@ -129,14 +129,19 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) dev_warn(&dev->pdev->dev, "unexpected reset: dev_state = %s\n", mei_dev_state_str(dev->dev_state)); + /* we're already in reset, cancel the init timer + * if the reset was called due the hbm protocol error + * we need to call it before hw start + * so the hbm watchdog won't kick in + */ + mei_hbm_idle(dev); + ret = mei_hw_reset(dev, interrupts_enabled); if (ret) { dev_err(&dev->pdev->dev, "hw reset failed disabling the device\n"); interrupts_enabled = false; - dev->dev_state = MEI_DEV_DISABLED; } - dev->hbm_state = MEI_HBM_IDLE; if (dev->dev_state != MEI_DEV_INITIALIZING && dev->dev_state != MEI_DEV_POWER_UP) { @@ -160,8 +165,6 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) memset(&dev->wr_ext_msg, 0, sizeof(dev->wr_ext_msg)); } - /* we're already in reset, cancel the init timer */ - dev->init_clients_timer = 0; dev->me_clients_num = 0; dev->rd_msg_hdr = 0; @@ -169,6 +172,7 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) if (!interrupts_enabled) { dev_dbg(&dev->pdev->dev, "intr not enabled end of reset\n"); + dev->dev_state = MEI_DEV_DISABLED; return; } -- cgit v1.2.1