summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Dooley <dooleyc@google.com>2022-06-09 19:39:06 +0000
committerBryan Lavrich <lavrich@google.com>2022-06-11 15:53:58 +0000
commitaad9fe5009d49f7ab6e52f62d9b1fa38b0acea09 (patch)
tree42656d58f42fa6a86a59b194f15a2544456af932
parentf54aace77a30bb8b6564ac12b2743be3457a1f8b (diff)
downloadaoc-aad9fe5009d49f7ab6e52f62d9b1fa38b0acea09.tar.gz
Bug: 234897999 Signed-off-by: Craig Dooley <dooleyc@google.com> Change-Id: I15c96c6da6fe1a5a2e0f4ecada1e4416bbe63c2a
-rw-r--r--aoc_channel_dev.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/aoc_channel_dev.c b/aoc_channel_dev.c
index 5911e1f..d09d6f6 100644
--- a/aoc_channel_dev.c
+++ b/aoc_channel_dev.c
@@ -36,7 +36,8 @@ module_param(received_msg_count, long, S_IRUGO);
module_param(sent_msg_count, long, S_IRUGO);
struct chan_prvdata {
- struct wakeup_source *wakelock;
+ struct wakeup_source *queue_wakelock;
+ struct wakeup_source *user_wakelock;
};
struct aocc_device_entry {
@@ -245,9 +246,9 @@ static int aocc_demux_kthread(void *data)
* reading a waking message at the end.
*/
if (take_wake_lock) {
- pm_wakeup_ws_event(service_prvdata->wakelock, 200, true);
+ pm_wakeup_ws_event(service_prvdata->user_wakelock, 200, true);
} else if (aoc_service_can_read(service)) {
- pm_wakeup_ws_event(service_prvdata->wakelock, 10, true);
+ pm_wakeup_ws_event(service_prvdata->queue_wakelock, 10, true);
}
if (!handler_found) {
@@ -773,7 +774,8 @@ static int aocc_probe(struct aoc_service_dev *dev)
return -ENOMEM;
if (strcmp(dev_name(&dev->dev), "usf_sh_mem_doorbell") != 0) {
- prvdata->wakelock = wakeup_source_register(&dev->dev, dev_name(&dev->dev));
+ prvdata->user_wakelock = wakeup_source_register(&dev->dev, dev_name(&dev->dev));
+ prvdata->queue_wakelock = wakeup_source_register(&dev->dev, "usf_queue");
dev->prvdata = prvdata;
ret = create_character_device(dev);
@@ -808,9 +810,14 @@ static int aocc_remove(struct aoc_service_dev *dev)
sh_mem_doorbell_service_dev = NULL;
} else {
prvdata = dev->prvdata;
- if (prvdata->wakelock) {
- wakeup_source_unregister(prvdata->wakelock);
- prvdata->wakelock = NULL;
+ if (prvdata->queue_wakelock) {
+ wakeup_source_unregister(prvdata->queue_wakelock);
+ prvdata->queue_wakelock = NULL;
+ }
+
+ if (prvdata->user_wakelock) {
+ wakeup_source_unregister(prvdata->user_wakelock);
+ prvdata->user_wakelock = NULL;
}
}