diff options
author | PixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com> | 2022-11-20 18:49:01 -0800 |
---|---|---|
committer | SecurityBot <android-nexus-securitybot@system.gserviceaccount.com> | 2022-11-20 18:49:01 -0800 |
commit | cf436a0d9d10094ddf38ad0b4cbea3aa25d59f85 (patch) | |
tree | a385cecc6c15a83918e1ced6c568c0b98c1b52ee | |
parent | de375e06e5d38e5a1d3c1eac8ebfd89773a7a0d7 (diff) | |
parent | b9f9d5cdef1e524c9eb45efac077fc1fb4308040 (diff) | |
download | aoc-cf436a0d9d10094ddf38ad0b4cbea3aa25d59f85.tar.gz |
Merge android13-gs-pixel-5.10-tm-qpr2 into android13-gs-pixel-5.10-tm-qpr3
SBMerger: 478053055
Change-Id: I4a2f5ce64e16556431a8377719f4775d7f10befd
Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rwxr-xr-x | alsa/aoc_alsa_hw.c | 2 | ||||
-rw-r--r-- | aoc_channel_dev.c | 37 |
2 files changed, 7 insertions, 32 deletions
diff --git a/alsa/aoc_alsa_hw.c b/alsa/aoc_alsa_hw.c index 712bd5c..ad06bea 100755 --- a/alsa/aoc_alsa_hw.c +++ b/alsa/aoc_alsa_hw.c @@ -271,7 +271,7 @@ static int aoc_audio_control(const char *cmd_channel, const uint8_t *cmd, uint16_t cmd_id = ((struct CMD_HDR *)cmd)->id; char reset_reason[40]; - scnprintf(reset_reason, sizeof(reset_reason), "No response to ALSA command %#06x", + scnprintf(reset_reason, sizeof(reset_reason), "ALSA command timeout %#06x", cmd_id); pr_err(ALSA_AOC_CMD " ERR:timeout - cmd [%s] id %#06x\n", CMD_CHANNEL(dev), cmd_id); diff --git a/aoc_channel_dev.c b/aoc_channel_dev.c index d06bcb7..8233e31 100644 --- a/aoc_channel_dev.c +++ b/aoc_channel_dev.c @@ -36,7 +36,6 @@ module_param(received_msg_count, long, S_IRUGO); module_param(sent_msg_count, long, S_IRUGO); struct chan_prvdata { - struct wakeup_source *queue_wakelock; struct wakeup_source *user_wakelock; struct task_struct *demux_task; }; @@ -65,12 +64,6 @@ static atomic_t channel_index_counter = ATOMIC_INIT(1); static int aocc_probe(struct aoc_service_dev *dev); static int aocc_remove(struct aoc_service_dev *dev); -static const char * const wakelock_names[] = { - "usf_queue", - "usf_queue_non_wake_up", - NULL, -}; - static const char * const channel_service_names[] = { "com.google.usf", "com.google.usf.non_wake_up", @@ -211,7 +204,9 @@ static int aocc_demux_kthread(void *data) list_for_each_entry(entry, &s_open_files, open_files_list) { if (channel == entry->channel_index) { handler_found = 1; - if (!node->msg.non_wake_up) { + if (!node->msg.non_wake_up && + strcmp(dev_name(&service->dev), + "com.google.usf") == 0) { take_wake_lock = true; } @@ -247,15 +242,11 @@ static int aocc_demux_kthread(void *data) mutex_unlock(&s_open_files_lock); /* - * If the message is "waking", take a longer wakelock to allow userspace to - * dequeue the message. If non-waking, take a short wakelock until the queue - * has been drained to make sure non-waking messages are not preventing us from - * reading a waking message at the end. + * If the message is "waking", take wakelock to allow userspace to dequeue + * the message. */ if (take_wake_lock) { pm_wakeup_ws_event(service_prvdata->user_wakelock, 200, true); - } else if (aoc_service_can_read(service)) { - pm_wakeup_ws_event(service_prvdata->queue_wakelock, 10, true); } if (!handler_found) { @@ -769,8 +760,7 @@ static void aocc_sh_mem_doorbell_probe(struct aoc_service_dev *dev) static int aocc_probe(struct aoc_service_dev *dev) { struct chan_prvdata *prvdata; - int ret = 0, i = 0; - bool service_found = false; + int ret = 0; struct sched_param param = { .sched_priority = 10, }; @@ -786,16 +776,6 @@ static int aocc_probe(struct aoc_service_dev *dev) if (ret) return ret; prvdata->user_wakelock = wakeup_source_register(&dev->dev, dev_name(&dev->dev)); - for (i = 0; i < ARRAY_SIZE(wakelock_names); i++) { - if (strcmp(dev_name(&dev->dev), channel_service_names[i]) == 0) { - prvdata->queue_wakelock = wakeup_source_register(&dev->dev, - wakelock_names[i]); - service_found = true; - break; - } - } - if (!service_found) - return -EINVAL; dev->prvdata = prvdata; prvdata->demux_task = kthread_run(&aocc_demux_kthread, dev, dev_name(&dev->dev)); sched_setscheduler(prvdata->demux_task, SCHED_FIFO, ¶m); @@ -821,11 +801,6 @@ static int aocc_remove(struct aoc_service_dev *dev) } else { prvdata = dev->prvdata; kthread_stop(prvdata->demux_task); - 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; |