qseecom: Fix failure to go into suspend
When the device tries to go into suspend the freezer process
fails to put the blocked threads into sleep.
Hence device is failing to go into suspend as the blocked threads
are woken up by suspend signal (and any signal in general).
Replacing wait_event_interruptable() with wait_event_freezable()
allows the freezer process to freeze the blocked threads,
thereby, allowing the device to proceed with going into suspend.
Change-Id: I3830f056050828cee05c1ff404baaed0318e87c9
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
diff --git a/drivers/misc/qseecom.c b/drivers/misc/qseecom.c
index 60e1e55..937490d 100644
--- a/drivers/misc/qseecom.c
+++ b/drivers/misc/qseecom.c
@@ -1,4 +1,5 @@
+
/* Qualcomm Secure Execution Environment Communicator (QSEECOM) driver
*
* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
@@ -31,6 +32,7 @@
#include <linux/types.h>
#include <linux/clk.h>
#include <linux/qseecom.h>
+#include <linux/freezer.h>
#include <mach/msm_bus.h>
#include <mach/msm_bus_board.h>
#include <mach/scm.h>
@@ -438,7 +440,7 @@
spin_unlock_irqrestore(&qseecom.registered_listener_list_lock, flags);
while (atomic_read(&data->ioctl_count) > 1) {
- if (wait_event_interruptible(data->abort_wq,
+ if (wait_event_freezable(data->abort_wq,
atomic_read(&data->ioctl_count) <= 1)) {
pr_err("Interrupted from abort\n");
ret = -ERESTARTSYS;
@@ -546,7 +548,7 @@
}
pr_debug("waking up rcv_req_wq and "
"waiting for send_resp_wq\n");
- if (wait_event_interruptible(qseecom.send_resp_wq,
+ if (wait_event_freezable(qseecom.send_resp_wq,
__qseecom_listener_has_sent_rsp(data))) {
pr_warning("Interrupted: exiting send_cmd loop\n");
return -ERESTARTSYS;
@@ -707,7 +709,7 @@
{
wake_up_all(&qseecom.send_resp_wq);
while (atomic_read(&data->ioctl_count) > 1) {
- if (wait_event_interruptible(data->abort_wq,
+ if (wait_event_freezable(data->abort_wq,
atomic_read(&data->ioctl_count) <= 1)) {
pr_err("Interrupted from abort\n");
return -ERESTARTSYS;
@@ -784,7 +786,7 @@
data->abort = 1;
wake_up_all(&qseecom.send_resp_wq);
while (atomic_read(&data->ioctl_count) > 0) {
- if (wait_event_interruptible(data->abort_wq,
+ if (wait_event_freezable(data->abort_wq,
atomic_read(&data->ioctl_count) <= 0)) {
pr_err("Interrupted from abort\n");
ret = -ERESTARTSYS;
@@ -872,7 +874,7 @@
pr_debug("waking up rcv_req_wq and "
"waiting for send_resp_wq\n");
- if (wait_event_interruptible(qseecom.send_resp_wq,
+ if (wait_event_freezable(qseecom.send_resp_wq,
__qseecom_listener_has_sent_rsp(data))) {
pr_warning("qseecom Interrupted: exiting send_cmd loop\n");
return -ERESTARTSYS;
@@ -1080,7 +1082,7 @@
this_lstnr = __qseecom_find_svc(data->listener.id);
while (1) {
- if (wait_event_interruptible(this_lstnr->rcv_req_wq,
+ if (wait_event_freezable(this_lstnr->rcv_req_wq,
__qseecom_listener_has_rcvd_req(data,
this_lstnr))) {
pr_warning("Interrupted: exiting wait_rcv_req loop\n");