lkml.org 
[lkml]   [2003]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject2.4.22pre3 / pwc / emi disconnect == oops, workaround
From
Date
Hi Alan, all,

I added an extra check to the videodev.c's video_ioctl, to check vfl is
valid before dereferencing. (See attached patch).

The sequence to trigger the oops appears to be:

1. Open philips usb webcam device (any usb video device with ioctls ?).
2. Wait for (fairly rare) USB EMI issue to be flagged by hub.c.
3. usb.c appears to force a disconnect immediately after #2.
4. pwc module warns about a disconnect while open.
5. Next call to video_ioctl with handle from #1 causes oops.

I added a check to video_icotl to ensure video_device[] isn't NULL
before trying to call the ioctl method, and it returns EINVAL in that
case.

I'm not very familiar with the locking of usb/usb-uhci in this EMI case,
but both host drivers oops in the same way. It would seem the open file
handle needs to be disassociated too somehow - or at least 'defered'
until the video camera is re-enabled after the EMI event.

Best regards,

Mark

PS. I've recently changed the physical layout of the machine, and it
seems the new cabling layout causes these occasional EMI issues.

--
Mark Cooke <mpc@star.sr.bham.ac.uk>
--- linux-2.4.21/drivers/media/video/videodev.c.orig 2003-06-13 15:51:34.000000000 +0100
+++ linux-2.4.21/drivers/media/video/videodev.c 2003-07-10 23:00:49.000000000 +0100
@@ -209,7 +209,12 @@
unsigned int cmd, unsigned long arg)
{
struct video_device *vfl = video_devdata(file);
- int err=vfl->ioctl(vfl, cmd, (void *)arg);
+ int err;
+
+ if (!vfl)
+ return -EINVAL;
+
+ err = vfl->ioctl(vfl, cmd, (void *)arg);

if(err!=-ENOIOCTLCMD)
return err;
\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.115 / U:1.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site