diff options
| author | Krishnankutty Kolathappilly <kkolatha@codeaurora.org> | 2017-02-02 11:26:40 -0800 |
|---|---|---|
| committer | Krishnankutty Kolathappilly <kkolatha@codeaurora.org> | 2017-02-08 14:00:05 -0800 |
| commit | e6feb6732a05b78d6cc1c7dbd351e325b2df50bd (patch) | |
| tree | 7be3a85d7656a56a05239f716bba0fc5180de758 | |
| parent | 2aa89ab3ff59a788321bc6af782d639cfc8dab1f (diff) | |
msm: cpp: Check for validity of processed frame in cpp timeout
Device crash seen from cpp timeout when process frame is invalid.
Check for validity of processed frame in timeout when queue length
is valid. Clear and release the buffers once the scenario is
detected.
CRs-Fixed: 2001828
Change-Id: If4fdfc993576e44e866aa30afd83d6236b3de276
Signed-off-by: Krishnankutty Kolathappilly <kkolatha@codeaurora.org>
| -rw-r--r-- | drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c b/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c index 1cf2c54aa8b8..7885149440f9 100644 --- a/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c +++ b/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2017, 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 @@ -1770,6 +1770,17 @@ static void msm_cpp_do_timeout_work(struct work_struct *work) goto end; } + for (i = 0; i < queue_len; i++) { + processed_frame[i] = cpp_timer.data.processed_frame[i]; + if (!processed_frame[i]) { + pr_warn("process frame null , queue len %d", queue_len); + msm_cpp_flush_queue_and_release_buffer(cpp_dev, + queue_len); + msm_cpp_set_micro_irq_mask(cpp_dev, 1, 0x8); + goto end; + } + } + atomic_set(&cpp_timer.used, 1); pr_warn("Starting timer to fire in %d ms. (jiffies=%lu)\n", CPP_CMD_TIMEOUT_MS, jiffies); @@ -1778,9 +1789,6 @@ static void msm_cpp_do_timeout_work(struct work_struct *work) msm_cpp_set_micro_irq_mask(cpp_dev, 1, 0x8); - for (i = 0; i < MAX_CPP_PROCESSING_FRAME; i++) - processed_frame[i] = cpp_timer.data.processed_frame[i]; - for (i = 0; i < queue_len; i++) { pr_warn("Rescheduling for identity=0x%x, frame_id=%03d\n", processed_frame[i]->identity, |
