Commit 5290801c authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

mei: wake also writers on reset

wake writers otherwise might have processes waiting
endlessly on wait_tx during reset
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cc33c537
...@@ -892,18 +892,22 @@ void mei_cl_all_disconnect(struct mei_device *dev) ...@@ -892,18 +892,22 @@ void mei_cl_all_disconnect(struct mei_device *dev)
/** /**
* mei_cl_all_read_wakeup - wake up all readings so they can be interrupted * mei_cl_all_wakeup - wake up all readers and writers they can be interrupted
* *
* @dev - mei device * @dev - mei device
*/ */
void mei_cl_all_read_wakeup(struct mei_device *dev) void mei_cl_all_wakeup(struct mei_device *dev)
{ {
struct mei_cl *cl, *next; struct mei_cl *cl, *next;
list_for_each_entry_safe(cl, next, &dev->file_list, link) { list_for_each_entry_safe(cl, next, &dev->file_list, link) {
if (waitqueue_active(&cl->rx_wait)) { if (waitqueue_active(&cl->rx_wait)) {
dev_dbg(&dev->pdev->dev, "Waking up client!\n"); dev_dbg(&dev->pdev->dev, "Waking up reading client!\n");
wake_up_interruptible(&cl->rx_wait); wake_up_interruptible(&cl->rx_wait);
} }
if (waitqueue_active(&cl->tx_wait)) {
dev_dbg(&dev->pdev->dev, "Waking up writing client!\n");
wake_up_interruptible(&cl->tx_wait);
}
} }
} }
......
...@@ -99,7 +99,7 @@ void mei_host_client_init(struct work_struct *work); ...@@ -99,7 +99,7 @@ void mei_host_client_init(struct work_struct *work);
void mei_cl_all_disconnect(struct mei_device *dev); void mei_cl_all_disconnect(struct mei_device *dev);
void mei_cl_all_read_wakeup(struct mei_device *dev); void mei_cl_all_wakeup(struct mei_device *dev);
void mei_cl_all_write_clear(struct mei_device *dev); void mei_cl_all_write_clear(struct mei_device *dev);
#endif /* _MEI_CLIENT_H_ */ #endif /* _MEI_CLIENT_H_ */
...@@ -196,7 +196,7 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) ...@@ -196,7 +196,7 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
mei_hbm_start_req(dev); mei_hbm_start_req(dev);
/* wake up all readings so they can be interrupted */ /* wake up all readings so they can be interrupted */
mei_cl_all_read_wakeup(dev); mei_cl_all_wakeup(dev);
/* remove all waiting requests */ /* remove all waiting requests */
mei_cl_all_write_clear(dev); mei_cl_all_write_clear(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment