Certainly the device itself, since that's what currently drives the submit logic ... so that's what would need to know that it's GONE, to let the submit logic reject new urb submissions.Yes, usb_submit_urb() can just check the device state. But what's to keep the device from being removed _right_ after that check happens. Ah, doesn't work :)
Ah but it does, since those preceding urbs will get I/O errors. Different I/O errors on each kind of hardware (HC or TT), so drivers _do_ handle the recovery procedures wrong, but this part is unavoidable: on average 1/8 second of I/O errors and driver retries, before khubd says "hey, that device is gone!". The point I was raising is that once khubd starts its cleanup, only one activity makes sense: unlinking urbs. But today, it's _also_ possible to continue submitting urbs. That can create some exotic failure modes, worth IMO getting rid of -- I've seen drivers cause them, they're a waste of time to debug rather than just prevent. Think of it as a proof-by-induction that shutdown will work. When there's a point past which no more activities can be started (like when device state becomes GONE), and existing activities all get canceled, shutdown will clearly work. With no such point, the exotic failure modes can prevent shutdown from working.
Except that "GONE" can/should really mean "GONE" ... at least for USB,Yes, struct device will get a "device state" type of field, as it is a common thing that all structures need. We just have to use it as a "hint" unfortunately.
as you noted, that one is no hint. (And presumably for all hotpluggable
busses.) I'll wait for the driver model stuff to get a bit more stable,
of necessity!, but it would be nice to know those failure modes can't
be showing their faces any more.
- Dave
-------------------------------------------------------
This sf.net email is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now. http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel