diff options
| author | Srikanth Uyyala <suyyala@codeaurora.org> | 2018-10-05 16:51:20 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-11-13 22:13:37 -0800 |
| commit | abfb30732426f2c2d36cb2937218c184cb81bf86 (patch) | |
| tree | dc5be418c53cb8b0e3c1dd8c9fd4ec21d1af53ff | |
| parent | 23d37eecf80f7b08fde9a8f3d888855f9b08ca21 (diff) | |
msm: camera: initialize qos_request object
qos_request object is used between two drivers (msm, camera)
there can be a scenario qos_request being updated before
initialize.
fix: make sure initialize is called before update.
Change-Id: I5e7e1639577f30b671598663d3dd2f8e7f5c3f36
Signed-off-by: Srikanth Uyyala <suyyala@codeaurora.org>
| -rw-r--r-- | drivers/media/platform/msm/camera_v2/msm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/platform/msm/camera_v2/msm.c b/drivers/media/platform/msm/camera_v2/msm.c index 60532929a916..7689aa3dba77 100644 --- a/drivers/media/platform/msm/camera_v2/msm.c +++ b/drivers/media/platform/msm/camera_v2/msm.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -37,6 +37,7 @@ static struct list_head ordered_sd_list; static struct mutex ordered_sd_mtx; static struct mutex v4l2_event_mtx; +static atomic_t qos_add_request_done = ATOMIC_INIT(0); static struct pm_qos_request msm_v4l2_pm_qos_request; static struct msm_queue_head *msm_session_q; @@ -218,9 +219,11 @@ static inline int __msm_queue_find_command_ack_q(void *d1, void *d2) return (ack->stream_id == *(unsigned int *)d2) ? 1 : 0; } -static void msm_pm_qos_add_request(void) +static inline void msm_pm_qos_add_request(void) { pr_info("%s: add request", __func__); + if (atomic_cmpxchg(&qos_add_request_done, 0, 1)) + return; pm_qos_add_request(&msm_v4l2_pm_qos_request, PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE); } @@ -234,6 +237,7 @@ static void msm_pm_qos_remove_request(void) void msm_pm_qos_update_request(int val) { pr_info("%s: update request %d", __func__, val); + msm_pm_qos_add_request(); pm_qos_update_request(&msm_v4l2_pm_qos_request, val); } |
