diff options
author | Ian Armstrong <ian@iarmst.demon.co.uk> | 2010-06-12 12:33:21 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 13:47:55 -0400 |
commit | 914610e8c508224a6fb9fb501ed4bda25b340ba6 (patch) | |
tree | 461d7bf99143ddda1847be4e9095a65268530ec3 /drivers/media/video/ivtv/ivtv-streams.c | |
parent | a5ba334cda924eb0ae4754321ad7fc292c5a5288 (diff) |
V4L/DVB: ivtv: Add firmare monitoring and debug mode to ignore firmware problems
>From Ian's e-mail:
When a device is opened the firmware state will be checked. If it isn't
responding then the open will fail with -EIO. Due to the nature of the
hardware, a single failed check will block everything since we don't know
exactly what has failed. A side effect of this is the blocking of debug
access, so an additional debug level has been created which allows the block
to be bypassed.
Andy Walls' modifications:
I modified Ian's patch to add a separate fw_debug module parameter to change
the driver's behavior, as opposed to using the normal debug module parameter.
The fw_debug module parameter is only available when CONFIG_VIDEO_ADV_DEBUG
is set.
I also made some minor whitespace adjustments and changed some warning
messages to be a bit more specific. s/happy/glad/g
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-streams.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-streams.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index a937e2ff9b6e..f0dd011a2ccc 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include "ivtv-yuv.h" | 42 | #include "ivtv-yuv.h" |
43 | #include "ivtv-cards.h" | 43 | #include "ivtv-cards.h" |
44 | #include "ivtv-streams.h" | 44 | #include "ivtv-streams.h" |
45 | #include "ivtv-firmware.h" | ||
45 | #include <media/v4l2-event.h> | 46 | #include <media/v4l2-event.h> |
46 | 47 | ||
47 | static const struct v4l2_file_operations ivtv_v4l2_enc_fops = { | 48 | static const struct v4l2_file_operations ivtv_v4l2_enc_fops = { |
@@ -674,12 +675,17 @@ static int ivtv_setup_v4l2_decode_stream(struct ivtv_stream *s) | |||
674 | /* Decoder sometimes dies here, so wait a moment */ | 675 | /* Decoder sometimes dies here, so wait a moment */ |
675 | ivtv_msleep_timeout(10, 0); | 676 | ivtv_msleep_timeout(10, 0); |
676 | 677 | ||
678 | /* Known failure point for firmware, so check */ | ||
679 | if (ivtv_firmware_check(itv, "ivtv_setup_v4l2_decode_stream") < 0) | ||
680 | return -EIO; | ||
681 | |||
677 | return 0; | 682 | return 0; |
678 | } | 683 | } |
679 | 684 | ||
680 | int ivtv_start_v4l2_decode_stream(struct ivtv_stream *s, int gop_offset) | 685 | int ivtv_start_v4l2_decode_stream(struct ivtv_stream *s, int gop_offset) |
681 | { | 686 | { |
682 | struct ivtv *itv = s->itv; | 687 | struct ivtv *itv = s->itv; |
688 | int rc; | ||
683 | 689 | ||
684 | if (s->vdev == NULL) | 690 | if (s->vdev == NULL) |
685 | return -EINVAL; | 691 | return -EINVAL; |
@@ -689,7 +695,11 @@ int ivtv_start_v4l2_decode_stream(struct ivtv_stream *s, int gop_offset) | |||
689 | 695 | ||
690 | IVTV_DEBUG_INFO("Starting decode stream %s (gop_offset %d)\n", s->name, gop_offset); | 696 | IVTV_DEBUG_INFO("Starting decode stream %s (gop_offset %d)\n", s->name, gop_offset); |
691 | 697 | ||
692 | ivtv_setup_v4l2_decode_stream(s); | 698 | rc = ivtv_setup_v4l2_decode_stream(s); |
699 | if (rc < 0) { | ||
700 | clear_bit(IVTV_F_S_STREAMING, &s->s_flags); | ||
701 | return rc; | ||
702 | } | ||
693 | 703 | ||
694 | /* set dma size to 65536 bytes */ | 704 | /* set dma size to 65536 bytes */ |
695 | ivtv_vapi(itv, CX2341X_DEC_SET_DMA_BLOCK_SIZE, 1, 65536); | 705 | ivtv_vapi(itv, CX2341X_DEC_SET_DMA_BLOCK_SIZE, 1, 65536); |