diff options
author | Craig Dooley <dooleyc@google.com> | 2022-06-09 19:39:06 +0000 |
---|---|---|
committer | Bryan Lavrich <lavrich@google.com> | 2022-06-11 15:53:58 +0000 |
commit | aad9fe5009d49f7ab6e52f62d9b1fa38b0acea09 (patch) | |
tree | 42656d58f42fa6a86a59b194f15a2544456af932 | |
parent | f54aace77a30bb8b6564ac12b2743be3457a1f8b (diff) | |
download | aoc-aad9fe5009d49f7ab6e52f62d9b1fa38b0acea09.tar.gz |
Use separate wake sources for dequeuing vs wake eventsandroid-t-beta-4_r0.6android-t-beta-4_r0.5android-t-beta-4_r0.4android-t-beta-3.3_r0.4android-13.0.0_r0.5android-13.0.0_r0.44android-13.0.0_r0.43android-13.0.0_r0.4android-13.0.0_r0.20android-13.0.0_r0.19android-13.0.0_r0.15android-13.0.0_r0.14android-gs-raviole-5.10-t-beta-4android-gs-raviole-5.10-t-beta-3android-gs-raviole-5.10-android13android-gs-bluejay-5.10-t-beta-4android-gs-bluejay-5.10-android13
Bug: 234897999
Signed-off-by: Craig Dooley <dooleyc@google.com>
Change-Id: I15c96c6da6fe1a5a2e0f4ecada1e4416bbe63c2a
-rw-r--r-- | aoc_channel_dev.c | 21 |
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; } } |