Commit a503ff81 authored by Jonathan Sims's avatar Jonathan Sims Committed by Mauro Carvalho Chehab

[media] 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/linux-media@vger.kernel.org/msg75163.html

were made and tested.

I have implemented the suggested changes and have been testing for the
last 2 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: default avatarJonathan Sims <jonathan.625266@earthlink.net>
Reported-by: default avatarRyley Angus <ryleyjangus@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 708f48e7
...@@ -449,6 +449,7 @@ static ssize_t hdpvr_read(struct file *file, char __user *buffer, size_t count, ...@@ -449,6 +449,7 @@ static ssize_t hdpvr_read(struct file *file, char __user *buffer, size_t count,
if (buf->status != BUFSTAT_READY && if (buf->status != BUFSTAT_READY &&
dev->status != STATUS_DISCONNECTED) { dev->status != STATUS_DISCONNECTED) {
int err;
/* return nonblocking */ /* return nonblocking */
if (file->f_flags & O_NONBLOCK) { if (file->f_flags & O_NONBLOCK) {
if (!ret) if (!ret)
...@@ -456,9 +457,24 @@ static ssize_t hdpvr_read(struct file *file, char __user *buffer, size_t count, ...@@ -456,9 +457,24 @@ static ssize_t hdpvr_read(struct file *file, char __user *buffer, size_t count,
goto err; goto err;
} }
if (wait_event_interruptible(dev->wait_data, err = wait_event_interruptible_timeout(dev->wait_data,
buf->status == BUFSTAT_READY)) buf->status == BUFSTAT_READY,
return -ERESTARTSYS; msecs_to_jiffies(1000));
if (err < 0) {
ret = err;
goto err;
}
if (!err) {
v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev,
"timeout: restart streaming\n");
hdpvr_stop_streaming(dev);
msecs_to_jiffies(4000);
err = hdpvr_start_streaming(dev);
if (err) {
ret = err;
goto err;
}
}
} }
if (buf->status != BUFSTAT_READY) if (buf->status != BUFSTAT_READY)
......
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