On Thu, 17 Aug 2006, Lonnie Mendez wrote: > On Wed, 2006-08-16 at 23:17 -0500, Mike Isely wrote: >> From: Mike Isely <[EMAIL PROTECTED]> >> >> When receiving a fatal error from the USB core, e.g. EILSEQ (which can >> happen if the polling interval is too short), fail gracefully. >> Previously the driver would fill the log with useless error messages >> or (more alarmingly) silently spin forever trying to write updated >> control information to the device. This change implements a new flag >> which if cleared indicates that the driver has failed. The flag will >> be set on initialization, cleared on fatal errors, and anything else >> that touches the USB port in the driver will abort if the flag is >> clear. When the flag is cleared, a message will be logged indicating >> that the driver has failed. > > I'm not sure how it could spin infinitely grabbing or fetching the > internal serial information. Three tries are attempted in > cypress_serial_control() before exiting unless other conditions are met.
Here's how it can happen: 1. USB connection fails (for whatever reason). 2. Application closes the file handle. 3. Driver attempts to send a URB to clear CTS / DTR (or something to that effect). 4. URB send attempt fails, due to what happened in step 1. 5. Driver goes back to step 3. I witnessed this sort of scenario many times. The problem isn't in the control message itself in cypress_serial_control(), it's the interrupt-out URB which is also carrying line control information. It's not a spin in the sense that the CPU is "stuck", but it's definitely sucking down cycles and it is logically in a forever-loop within the driver. Unplugging the device clears the condition of course, but it would be better if this sort of loop didn't happen in the first place. This patch changes the driver such that it notes the permanent failure and then avoids any attempt to issue any more URB commands. It probably could be cleaned up further, but this should already be a big improvement. -Mike -- | Mike Isely | PGP fingerprint Spammers Die!! | | 03 54 43 4D 75 E5 CC 92 | isely @ pobox (dot) com | 71 16 01 E2 B5 F5 C1 E8 | | ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel