clear-pkgs-linux-iot-lts2018/0867-media-intel-ipu4-VIRT-...

95 lines
3.2 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ong Hock Yu <ong.hock.yu@intel.com>
Date: Wed, 9 Jan 2019 23:03:09 +0000
Subject: [PATCH] media: intel-ipu4: [VIRT] Increase the POLL_WAIT timeout &
REQ_TIMEOUT.
Few sensors like OV10635 require many I2C commands RW
for init & setup. This caused long stream ON time
under multiple camera use case.
Need to increase POLL_WAIT timeout from 500mS to
5 seconds for mediation BE and increase REQ_TIMEOUT
for FE's virtio req for 3s to 6s.
Change-Id: I08cbbd7b40ce95f9cb3e0a3da0402c81d0ac4d9c
Tracked-On: OAM-63913
Signed-off-by: Ong Hock Yu <ong.hock.yu@intel.com>
Signed-off-by: Bandi,Kushal <kushal.bandi@intel.com>
---
.../virtio/intel-ipu4-virtio-be-stream.c | 21 ++++++++++++-------
.../pci/intel/virtio/intel-ipu4-virtio-fe.c | 2 +-
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-stream.c b/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-stream.c
index 9025b95..7958fd8 100644
--- a/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-stream.c
+++ b/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-stream.c
@@ -20,7 +20,7 @@
#include "intel-ipu4-virtio-be.h"
#define MAX_SIZE 6 // max 2^6
-#define POLL_WAIT 500 //500ms
+#define POLL_WAIT 5000 //5s
#define dev_to_stream(dev) \
container_of(dev, struct ici_isys_stream, strm_dev)
@@ -186,12 +186,16 @@ int process_poll(struct ipu4_virtio_req_info *req_info)
} else {
time_remain = wait_event_interruptible_timeout(
as->buf_list.wait,
- !list_empty(&as->buf_list.putbuf_list),
+ !list_empty(&as->buf_list.putbuf_list) ||
+ !as->ip.streaming,
POLL_WAIT);
if((time_remain == -ERESTARTSYS) ||
- time_remain == 0) {
- pr_err("%s poll timeout or unexpected wake up! code:%d port:%d",
- __func__, time_remain, req->op[0]);
+ time_remain == 0 ||
+ !as->ip.streaming) {
+ pr_err("%s poll timeout or unexpected wake up! code:%d streaming: %d port:%d",
+ __func__, time_remain,
+ as->ip.streaming,
+ req->op[0]);
req->func_ret = 0;
return IPU4_REQ_ERROR;
}
@@ -400,6 +404,7 @@ int process_stream_off(struct ipu4_virtio_req_info *req_info)
{
struct stream_node *sn = NULL;
struct ici_stream_device *strm_dev;
+ struct ici_isys_stream *as;
int err, found;
struct ipu4_virtio_req *req = req_info->request;
@@ -433,9 +438,11 @@ int process_stream_off(struct ipu4_virtio_req_info *req_info)
if (err) {
pr_err("%s: stream off failed\n", __func__);
return IPU4_REQ_ERROR;
- }
- else
+ } else {
+ as = dev_to_stream(strm_dev);
+ wake_up_interruptible(&as->buf_list.wait);
return IPU4_REQ_PROCESSED;
+ }
}
int process_set_format_thread(void *data)
diff --git a/drivers/media/pci/intel/virtio/intel-ipu4-virtio-fe.c b/drivers/media/pci/intel/virtio/intel-ipu4-virtio-fe.c
index 39e2e55..5a02b82 100644
--- a/drivers/media/pci/intel/virtio/intel-ipu4-virtio-fe.c
+++ b/drivers/media/pci/intel/virtio/intel-ipu4-virtio-fe.c
@@ -15,7 +15,7 @@
static DEFINE_IDA(index_ida);
-#define REQ_TIMEOUT 3000 //3s
+#define REQ_TIMEOUT 6000 //6s
struct ipu4_virtio_uos {
struct virtqueue *vq[IPU_VIRTIO_QUEUE_MAX];
--
https://clearlinux.org