aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/init.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2013-07-25 13:15:53 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-26 20:54:30 -0400
commitb950ac1dabfcbf97b99f26fa75f86087e1960aef (patch)
treed9ef0e00c79acedc8eebdd3d61a460d7bbff962f /drivers/misc/mei/init.c
parent20138d6cb838aa01bb1b382dcb5f3d3a119ff2cb (diff)
mei: don't get stuck in select during reset
Clear pending connection after hw reset but before hw start and wake up the waiting task in poll. Signal POLLERR in select when device went through reset. Add wrapper mei_cl_is_connected for checking if the device and client are connected. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/init.c')
-rw-r--r--drivers/misc/mei/init.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c
index 7929e14627ba..557eed2a1595 100644
--- a/drivers/misc/mei/init.c
+++ b/drivers/misc/mei/init.c
@@ -149,12 +149,20 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
149 dev->hbm_state = MEI_HBM_IDLE; 149 dev->hbm_state = MEI_HBM_IDLE;
150 150
151 if (dev->dev_state != MEI_DEV_INITIALIZING) { 151 if (dev->dev_state != MEI_DEV_INITIALIZING) {
152
152 if (dev->dev_state != MEI_DEV_DISABLED && 153 if (dev->dev_state != MEI_DEV_DISABLED &&
153 dev->dev_state != MEI_DEV_POWER_DOWN) 154 dev->dev_state != MEI_DEV_POWER_DOWN)
154 dev->dev_state = MEI_DEV_RESETTING; 155 dev->dev_state = MEI_DEV_RESETTING;
155 156
157
158 /* remove all waiting requests */
159 mei_cl_all_write_clear(dev);
160
156 mei_cl_all_disconnect(dev); 161 mei_cl_all_disconnect(dev);
157 162
163 /* wake up all readings so they can be interrupted */
164 mei_cl_all_wakeup(dev);
165
158 /* remove entry if already in list */ 166 /* remove entry if already in list */
159 dev_dbg(&dev->pdev->dev, "remove iamthif and wd from the file list.\n"); 167 dev_dbg(&dev->pdev->dev, "remove iamthif and wd from the file list.\n");
160 mei_cl_unlink(&dev->wd_cl); 168 mei_cl_unlink(&dev->wd_cl);
@@ -195,11 +203,6 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
195 203
196 mei_hbm_start_req(dev); 204 mei_hbm_start_req(dev);
197 205
198 /* wake up all readings so they can be interrupted */
199 mei_cl_all_wakeup(dev);
200
201 /* remove all waiting requests */
202 mei_cl_all_write_clear(dev);
203} 206}
204EXPORT_SYMBOL_GPL(mei_reset); 207EXPORT_SYMBOL_GPL(mei_reset);
205 208