hdpvr: fix interrupted recording
Subsystems (2)
RFC PATCH v4 1/1 hdpvr: fix interrupted recording
This is a reworking of a patch originally submitted by Ryley Angus, modified by Hans Verkuil and then seemingly forgotten before changes suggested by Keith Pyle here:
http://www.mail-archive.com/[email protected]/msg75163.html
were made and tested.
I have implemented the suggested changes and have been testing for several months. I am no longer experiencing lockups while recording (with blue light on, requiring power cycling) which had been a long standing problem with the HD-PVR. I have not noticed any other problems since applying the patch.
---
Changes in v4:
- Code cleanups.
drivers/media/usb/hdpvr/hdpvr-video.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/media/usb/hdpvr/hdpvr-video.c +14 -3
@@ -458,9 +458,20 @@ static ssize_t hdpvr_read(struct file *file, char __user *buffer, size_t count, goto err; } -if (wait_event_interruptible (dev->wait_data, - buf->status ==BUFSTAT_READY )) -return -ERESTARTSYS ; + ret =wait_event_interruptible_timeout (dev->wait_data, + buf->status ==BUFSTAT_READY , +msecs_to_jiffies (1000 )); +if (ret <0 ) + goto err; +if (!ret) { +v4l2_dbg (MSG_INFO , hdpvr_debug, &dev->v4l2_dev, +"timeout: restart streaming\n" ); +hdpvr_stop_streaming (dev); +msleep (4000 ); + ret =hdpvr_start_streaming (dev); +if (ret) + goto err; + } }if (buf->status !=BUFSTAT_READY )
Signature · 1 line
2.11.1
Hi Jonathan,
It appears the v3 was merged and not this v4.
It would be nice if you can make a new diff on top of the latest media_tree master code that does this code cleanup, because this v4 is much nicer with regard to error handling.
Regards,
Hans
Quoted 46 lines · Jonathan Sims
This is a reworking of a patch originally submitted by Ryley Angus, modified by Hans Verkuil and then seemingly forgotten before changes suggested by Keith Pyle here:
http://www.mail-archive.com/[email protected]/msg75163.html
were made and tested.
I have implemented the suggested changes and have been testing for several months. I am no longer experiencing lockups while recording (with blue light on, requiring power cycling) which had been a long standing problem with the HD-PVR. I have not noticed any other problems since applying the patch.
Signed-off-by Jonathan Sims <[email protected]>---
Changes in v4:
- Code cleanups.drivers/media/usb/hdpvr/hdpvr-video.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)drivers/media/usb/hdpvr/hdpvr-video.c +14
-3@@ -458,9 +458,20 @@ static ssize_t hdpvr_read(struct file *file, char __user *buffer, size_t count, goto err; } -if (wait_event_interruptible (dev->wait_data, - buf->status ==BUFSTAT_READY )) -return -ERESTARTSYS ; + ret =wait_event_interruptible_timeout (dev->wait_data, + buf->status ==BUFSTAT_READY , +msecs_to_jiffies (1000 )); +if (ret <0 ) + goto err; +if (!ret) { +v4l2_dbg (MSG_INFO , hdpvr_debug, &dev->v4l2_dev, +"timeout: restart streaming\n" ); +hdpvr_stop_streaming (dev); +msleep (4000 ); + ret =hdpvr_start_streaming (dev); +if (ret) + goto err; + } }if (buf->status !=BUFSTAT_READY )