2003-07-12 15:27:43

by Mark Cooke

[permalink] [raw]
Subject: 2.4.22pre3 / pwc / emi disconnect == oops, workaround

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 <[email protected]>


Attachments:
patch-2.4.22-pre3-ac1-videodev (462.00 B)

2003-07-13 04:14:37

by Greg KH

[permalink] [raw]
Subject: Re: 2.4.22pre3 / pwc / emi disconnect == oops, workaround

On Sat, Jul 12, 2003 at 04:42:23PM +0100, Mark Cooke wrote:
>
> PS. I've recently changed the physical layout of the machine, and it
> seems the new cabling layout causes these occasional EMI issues.

Then change it back!
EMI issues are electrical issues. The kernel can't really do anything
about them.

But it can not oops, that's not very nice...

thanks,

greg k-h

2003-07-13 08:22:28

by Alan

[permalink] [raw]
Subject: Re: 2.4.22pre3 / pwc / emi disconnect == oops, workaround

On Sad, 2003-07-12 at 16:42, Mark Cooke wrote:
> 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.

pwc driver bug. It must defer its unregister until it closes

2003-07-13 10:19:11

by Mark Cooke

[permalink] [raw]
Subject: Re: 2.4.22pre3 / pwc / emi disconnect == oops, workaround

How about something like the attached patch ? (based on the se401
driver)

Caution: I'm not in front of the test machine currently, so it's only
had a compile test so far (and the EMI error only happens about once a
day)

Also, while I was grepping around, it seems ov511 suffers from the same
unregister in the disconnect callback. Someone with an ov511 camera
might want to check into that.

Cheers,

Mark

On Sun, 2003-07-13 at 09:34, Alan Cox wrote:
> On Sad, 2003-07-12 at 16:42, Mark Cooke wrote:
> > 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.
>
> pwc driver bug. It must defer its unregister until it closes
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Mark Cooke <[email protected]>


Attachments:
patch-2.4.22-pre3-ac1-videodev (3.94 kB)