Commit 6a4f0623 authored by Muralidharan Karicheri's avatar Muralidharan Karicheri Committed by Mauro Carvalho Chehab

V4L/DVB: V4L - vpfe capture - fix for kernel crash

As part of upstream merge, set_params() function was removed from isif.c.
This requires removal of BUG_ON() and check for set_params ptr in
vpfe_capture.c. Without this kernel crash dump is seen while bootup on DM365

Also made following changes:-

 1) converted error messages to debug messages since it is not right to flood
    the console with error messages for user mistakes.
 2) returns -EINVAL if ioctl is not supported
Signed-off-by: default avatarMuralidharan Karicheri <m-karicheri2@ti.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f8f73d01
...@@ -223,7 +223,6 @@ int vpfe_register_ccdc_device(struct ccdc_hw_device *dev) ...@@ -223,7 +223,6 @@ int vpfe_register_ccdc_device(struct ccdc_hw_device *dev)
BUG_ON(!dev->hw_ops.get_frame_format); BUG_ON(!dev->hw_ops.get_frame_format);
BUG_ON(!dev->hw_ops.get_pixel_format); BUG_ON(!dev->hw_ops.get_pixel_format);
BUG_ON(!dev->hw_ops.set_pixel_format); BUG_ON(!dev->hw_ops.set_pixel_format);
BUG_ON(!dev->hw_ops.set_params);
BUG_ON(!dev->hw_ops.set_image_window); BUG_ON(!dev->hw_ops.set_image_window);
BUG_ON(!dev->hw_ops.get_image_window); BUG_ON(!dev->hw_ops.get_image_window);
BUG_ON(!dev->hw_ops.get_line_length); BUG_ON(!dev->hw_ops.get_line_length);
...@@ -1689,11 +1688,12 @@ static long vpfe_param_handler(struct file *file, void *priv, ...@@ -1689,11 +1688,12 @@ static long vpfe_param_handler(struct file *file, void *priv,
struct vpfe_device *vpfe_dev = video_drvdata(file); struct vpfe_device *vpfe_dev = video_drvdata(file);
int ret = 0; int ret = 0;
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_param_handler\n"); v4l2_dbg(2, debug, &vpfe_dev->v4l2_dev, "vpfe_param_handler\n");
if (vpfe_dev->started) { if (vpfe_dev->started) {
/* only allowed if streaming is not started */ /* only allowed if streaming is not started */
v4l2_err(&vpfe_dev->v4l2_dev, "device already started\n"); v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev,
"device already started\n");
return -EBUSY; return -EBUSY;
} }
...@@ -1705,17 +1705,24 @@ static long vpfe_param_handler(struct file *file, void *priv, ...@@ -1705,17 +1705,24 @@ static long vpfe_param_handler(struct file *file, void *priv,
case VPFE_CMD_S_CCDC_RAW_PARAMS: case VPFE_CMD_S_CCDC_RAW_PARAMS:
v4l2_warn(&vpfe_dev->v4l2_dev, v4l2_warn(&vpfe_dev->v4l2_dev,
"VPFE_CMD_S_CCDC_RAW_PARAMS: experimental ioctl\n"); "VPFE_CMD_S_CCDC_RAW_PARAMS: experimental ioctl\n");
if (ccdc_dev->hw_ops.set_params) {
ret = ccdc_dev->hw_ops.set_params(param); ret = ccdc_dev->hw_ops.set_params(param);
if (ret) { if (ret) {
v4l2_err(&vpfe_dev->v4l2_dev, v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev,
"Error in setting parameters in CCDC\n"); "Error setting parameters in CCDC\n");
goto unlock_out; goto unlock_out;
} }
if (vpfe_get_ccdc_image_format(vpfe_dev, &vpfe_dev->fmt) < 0) { if (vpfe_get_ccdc_image_format(vpfe_dev,
v4l2_err(&vpfe_dev->v4l2_dev, &vpfe_dev->fmt) < 0) {
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev,
"Invalid image format at CCDC\n"); "Invalid image format at CCDC\n");
goto unlock_out; goto unlock_out;
} }
} else {
ret = -EINVAL;
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev,
"VPFE_CMD_S_CCDC_RAW_PARAMS not supported\n");
}
break; break;
default: default:
ret = -EINVAL; ret = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment