aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-fileops.c
diff options
context:
space:
mode:
authorIan Armstrong <ian@iarmst.demon.co.uk>2010-06-12 12:41:57 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 13:48:13 -0400
commit215659d14f9dbc849ccda1655c94d710f8cc6384 (patch)
tree7f1c65043106c2b14492616e48b17d76243a20f4 /drivers/media/video/ivtv/ivtv-fileops.c
parent914610e8c508224a6fb9fb501ed4bda25b340ba6 (diff)
V4L/DVB: ivtv: Automatic firmware reload
If the firmware has failed, this patch will automatically reload & restart the card. The previous card state will be restored on a successful restart. Firmware reload will only happen if neither the encoder or decoder is active. If the card is busy then behaviour is as before, returning -EIO on device access until the reload can occur. On cards that support video output, coloured bars will be displayed during the reload. Andy Walls (ivtv maintainer and patch committer) made minor tweaks to comments and the logged messages, but nothing substantial otherwise. Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-fileops.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c
index 3fb21e1406a1..a6a2cdb81566 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.c
+++ b/drivers/media/video/ivtv/ivtv-fileops.c
@@ -536,8 +536,12 @@ int ivtv_start_decoding(struct ivtv_open_id *id, int speed)
536 return -EBUSY; 536 return -EBUSY;
537 } 537 }
538 rc = ivtv_start_v4l2_decode_stream(s, 0); 538 rc = ivtv_start_v4l2_decode_stream(s, 0);
539 if (rc < 0) 539 if (rc < 0) {
540 return rc; 540 if (rc == -EAGAIN)
541 rc = ivtv_start_v4l2_decode_stream(s, 0);
542 if (rc < 0)
543 return rc;
544 }
541 } 545 }
542 if (s->type == IVTV_DEC_STREAM_TYPE_MPG) 546 if (s->type == IVTV_DEC_STREAM_TYPE_MPG)
543 return ivtv_set_speed(itv, speed); 547 return ivtv_set_speed(itv, speed);
@@ -926,19 +930,21 @@ static int ivtv_serialized_open(struct ivtv_stream *s, struct file *filp)
926 IVTV_DEBUG_FILE("open %s\n", s->name); 930 IVTV_DEBUG_FILE("open %s\n", s->name);
927 931
928#ifdef CONFIG_VIDEO_ADV_DEBUG 932#ifdef CONFIG_VIDEO_ADV_DEBUG
933 /* Unless ivtv_fw_debug is set, error out if firmware dead. */
929 if (ivtv_fw_debug) { 934 if (ivtv_fw_debug) {
930 IVTV_WARN("Opening %s with dead firmware lockout disabled\n", 935 IVTV_WARN("Opening %s with dead firmware lockout disabled\n",
931 video_device_node_name(vdev)); 936 video_device_node_name(vdev));
932 IVTV_WARN("Selected firmware errors will be ignored\n"); 937 IVTV_WARN("Selected firmware errors will be ignored\n");
933 } 938 } else {
934
935 /* Unless ivtv_fw_debug is set, error out if firmware dead. */
936 if (ivtv_firmware_check(itv, "ivtv_serialized_open") && !ivtv_fw_debug)
937 return -EIO;
938#else 939#else
939 if (ivtv_firmware_check(itv, "ivtv_serialized_open")) 940 if (1) {
940 return -EIO;
941#endif 941#endif
942 res = ivtv_firmware_check(itv, "ivtv_serialized_open");
943 if (res == -EAGAIN)
944 res = ivtv_firmware_check(itv, "ivtv_serialized_open");
945 if (res < 0)
946 return -EIO;
947 }
942 948
943 if (s->type == IVTV_DEC_STREAM_TYPE_MPG && 949 if (s->type == IVTV_DEC_STREAM_TYPE_MPG &&
944 test_bit(IVTV_F_S_CLAIMED, &itv->streams[IVTV_DEC_STREAM_TYPE_YUV].s_flags)) 950 test_bit(IVTV_F_S_CLAIMED, &itv->streams[IVTV_DEC_STREAM_TYPE_YUV].s_flags))