PATCH: gscpav2-0.0.29 some minor fixes
Hans de Goede <[email protected]> Mon, 28 Apr 2008 22:04:40 +0200
| Newsgroups | gmane.linux.drivers.spca50x.devel |
|---|---|
| Message-ID | <[email protected]> |
<this time with attachment, oops>
Hi Jef,
Here are 2 minor fixes from my previous patch set which didn't make it in 0.0.29.
1) vidioc_s_parm currently takes the usb_lock, but it doesn't do anything with
usb nor call any sd functions, so there is no need, really no need at all to
take the usb lock, if you disagree please explain why.
2) Replace wait_event_interruptible with wait_event_interruptible_timeout, if
for whatever reason the isoc flow stops, the applications should get an IO
error, not hang indefinitely.
Regards,
Hans
p.s.
I'll be working next on reworking the multiple opens code as discussed, I hope
to finish that tonight and if not tonight, tomorrow night.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Spca50x-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spca50x-devs
gspcav2-0.0.29-minor-fixes.patch
(text/plain, 1.1 KB)
diff -up gspcav2-0.0.29/gspca.c~ gspcav2-0.0.29/gspca.c
--- gspcav2-0.0.29/gspca.c~ 2008-04-28 21:59:37.000000000 +0200
+++ gspcav2-0.0.29/gspca.c 2008-04-28 21:59:37.000000000 +0200
@@ -1187,14 +1187,12 @@ static int vidioc_s_parm(struct file *fi
struct gspca_dev *gspca_dev = priv;
int n;
- if (mutex_lock_interruptible(&gspca_dev->usb_lock))
- return -ERESTARTSYS;
n = parm->parm.capture.readbuffers;
if (n == 0 || n > GSPCA_MAX_FRAMES)
parm->parm.capture.readbuffers = gspca_dev->nbufread;
else
gspca_dev->nbufread = n;
- mutex_unlock(&gspca_dev->usb_lock);
+
return 0;
}
@@ -1356,10 +1354,12 @@ static int gspca_frame_wait(struct gspca
/* wait till a frame is ready */
for (;;) {
- ret = wait_event_interruptible(gspca_dev->wq,
- atomic_read(&gspca_dev->nevent) > 0);
- if (ret != 0)
- return ret;
+ ret = wait_event_interruptible_timeout(gspca_dev->wq,
+ atomic_read(&gspca_dev->nevent) > 0,
+ msecs_to_jiffies(3000));
+ if (ret <= 0)
+ return (ret < 0)? ret : -EIO;
+
if (!gspca_dev->streaming || !gspca_dev->present)
return -EIO;
i = gspca_dev->fr_o;