Skip to contentSkip to conversation

Vicam/3com homeconnect usb camera driver

DISCUSSION John Tyner 2 participants 2 messages Oct 6, 2002

lore
Share & tools
lore

John Tyner

author
#0 lore raw
Quoted 2 lines

And you should probably kill the tasklet before you unregister the video device.

The more I think about this, the more I think that killing the tasklet after unregistering the device is the correct way.

Quoted 1 line

From what I can tell, there are two ways that the disconnect function can be

called: a physical disconnect or a module removal.

In the case of a physical disconnect, the ordering probably doesn't matter because the tasklet won't be scheduled again because urb's would fail to complete successfully.

The case of module removal becomes a bit more complicated (for reasons concerning module unload races that are being discussed by people far smarter than I). But in any event, I think that it makes more sense to unregister the open/close/etc. interface so that there is less chance of trying to send another urb (thus causing another schedule of the tasklet) before actually killing the tasklet.

This also brings up the (somewhat) rhetorical question I posed in the driver's disconnect function. What happens when a disconnect occurs while the device is open?

Thanks,
John

#1 lore raw
Quoted 8 lines · John Tyner
Quoted 2 lines

And you should probably kill the tasklet before you unregister the video device.

The more I think about this, the more I think that killing the tasklet after unregistering the device is the correct way.

From what I can tell, there are two ways that the disconnect function can be called: a physical disconnect or a module removal.

And as a result of an ioctl() through usbfs.

Quoted 11 lines

In the case of a physical disconnect, the ordering probably doesn't matter because the tasklet won't be scheduled again because urb's would fail to complete successfully.

The case of module removal becomes a bit more complicated (for reasons concerning module unload races that are being discussed by people far smarter than I). But in any event, I think that it makes more sense to unregister the open/close/etc. interface so that there is less chance of trying to send another urb (thus causing another schedule of the tasklet) before actually killing the tasklet.

Quoted 3 lines

This also brings up the (somewhat) rhetorical question I posed in the driver's disconnect function. What happens when a disconnect occurs while the device is open?

I can't tell right now. I'll sync up after returning home and look into the matter.

Regards
Oliver