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

173 lines
5.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Poluri, Sarat Chandra" <sarat.chandra.poluri@intel.com>
Date: Tue, 12 Mar 2019 19:04:43 -0700
Subject: [PATCH] media: intel-ipu4: [VIRT] Handle open pipeline ERROR when
there is FW version mismatch
After filp_open fails it returns an error value. We need to check for that.
Pipeline is a global variable and needs to be reset after failure.
Change-Id: Iaa5d31a4b9b735cc103fb7b40be67fea3dd86e1c
Tracked-On: OAM-76615
Tracked-On: PKT-1822
Signed-off-by: Poluri, Sarat Chandra <sarat.chandra.poluri@intel.com>
---
.../virtio/intel-ipu4-virtio-be-pipeline.c | 27 ++++++++++++-------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-pipeline.c b/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-pipeline.c
index 2297bf6..7c96f2d 100644
--- a/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-pipeline.c
+++ b/drivers/media/pci/intel/virtio/intel-ipu4-virtio-be-pipeline.c
@@ -31,9 +31,10 @@ int process_pipeline_open(struct ipu4_virtio_req_info *req_info)
pr_info("process_device_open: /dev/intel_pipeline");
if (!pipeline) {
pipeline = filp_open("/dev/intel_pipeline", O_RDWR | O_NONBLOCK, 0);
- if (!pipeline) {
+ if (IS_ERR(pipeline) || !pipeline) {
pr_err("%s: no pipeline device exists on host OS",
__func__);
+ pipeline = NULL;
return IPU4_REQ_ERROR;
}
}
@@ -62,7 +63,7 @@ int process_enum_nodes(struct ipu4_virtio_req_info *req_info)
struct ici_isys_pipeline_device *dev;
struct ici_node_desc *host_virt;
struct ipu4_virtio_req *req;
- int domid = req_info->domid;
+ int domid;
pr_debug("%s\n", __func__);
@@ -76,6 +77,7 @@ int process_enum_nodes(struct ipu4_virtio_req_info *req_info)
pr_err("%s: NULL req_info", __func__);
return IPU4_REQ_ERROR;
}
+ domid = req_info->domid;
req = req_info->request;
host_virt = map_guest_phys(domid, req->payload,
@@ -100,7 +102,7 @@ int process_enum_links(struct ipu4_virtio_req_info *req_info)
struct ici_isys_pipeline_device *dev;
struct ici_links_query *host_virt;
struct ipu4_virtio_req *req;
- int domid = req_info->domid;
+ int domid;
pr_debug("%s\n", __func__);
@@ -114,6 +116,7 @@ int process_enum_links(struct ipu4_virtio_req_info *req_info)
pr_err("%s: NULL req_info", __func__);
return IPU4_REQ_ERROR;
}
+ domid = req_info->domid;
req = req_info->request;
host_virt = map_guest_phys(domid, req->payload,
@@ -136,7 +139,7 @@ int process_get_supported_framefmt(struct ipu4_virtio_req_info *req_info)
struct ici_isys_pipeline_device *dev;
struct ici_pad_supported_format_desc *host_virt;
struct ipu4_virtio_req *req;
- int domid = req_info->domid;
+ int domid;
pr_debug("%s\n", __func__);
@@ -150,6 +153,7 @@ int process_get_supported_framefmt(struct ipu4_virtio_req_info *req_info)
pr_err("%s: NULL req_info", __func__);
return IPU4_REQ_ERROR;
}
+ domid = req_info->domid;
req = req_info->request;
host_virt = map_guest_phys(domid, req->payload,
@@ -173,7 +177,7 @@ int process_set_framefmt(struct ipu4_virtio_req_info *req_info)
struct ici_isys_pipeline_device *dev;
struct ici_pad_framefmt *host_virt;
struct ipu4_virtio_req *req;
- int domid = req_info->domid;
+ int domid;
pr_debug("%s\n", __func__);
@@ -187,6 +191,7 @@ int process_set_framefmt(struct ipu4_virtio_req_info *req_info)
pr_err("%s: NULL req_info", __func__);
return IPU4_REQ_ERROR;
}
+ domid = req_info->domid;
req = req_info->request;
host_virt = map_guest_phys(domid, req->payload,
@@ -210,7 +215,7 @@ int process_get_framefmt(struct ipu4_virtio_req_info *req_info)
struct ici_isys_pipeline_device *dev;
struct ici_pad_framefmt *host_virt;
struct ipu4_virtio_req *req;
- int domid = req_info->domid;
+ int domid;
pr_debug("%s\n", __func__);
@@ -224,6 +229,7 @@ int process_get_framefmt(struct ipu4_virtio_req_info *req_info)
pr_err("%s: NULL req_info", __func__);
return IPU4_REQ_ERROR;
}
+ domid = req_info->domid;
req = req_info->request;
host_virt = map_guest_phys(domid, req->payload,
@@ -247,7 +253,7 @@ int process_setup_pipe(struct ipu4_virtio_req_info *req_info)
struct ici_isys_pipeline_device *dev;
struct ici_link_desc *host_virt;
struct ipu4_virtio_req *req;
- int domid = req_info->domid;
+ int domid;
pr_debug("%s\n", __func__);
@@ -261,6 +267,7 @@ int process_setup_pipe(struct ipu4_virtio_req_info *req_info)
pr_err("%s: NULL req_info", __func__);
return IPU4_REQ_ERROR;
}
+ domid = req_info->domid;
req = req_info->request;
host_virt = map_guest_phys(domid, req->payload,
@@ -284,7 +291,7 @@ int process_pad_set_sel(struct ipu4_virtio_req_info *req_info)
struct ici_isys_pipeline_device *dev;
struct ici_pad_selection *host_virt;
struct ipu4_virtio_req *req;
- int domid = req_info->domid;
+ int domid;
pr_debug("%s\n", __func__);
@@ -298,6 +305,7 @@ int process_pad_set_sel(struct ipu4_virtio_req_info *req_info)
pr_err("%s: NULL req_info", __func__);
return IPU4_REQ_ERROR;
}
+ domid = req_info->domid;
req = req_info->request;
host_virt = map_guest_phys(domid, req->payload,
@@ -321,7 +329,7 @@ int process_pad_get_sel(struct ipu4_virtio_req_info *req_info)
struct ici_isys_pipeline_device *dev;
struct ici_pad_selection *host_virt;
struct ipu4_virtio_req *req;
- int domid = req_info->domid;
+ int domid;
pr_debug("%s\n", __func__);
@@ -335,6 +343,7 @@ int process_pad_get_sel(struct ipu4_virtio_req_info *req_info)
pr_err("%s: NULL req_info", __func__);
return IPU4_REQ_ERROR;
}
+ domid = req_info->domid;
req = req_info->request;
host_virt = map_guest_phys(domid, req->payload,
--
https://clearlinux.org