Alan Stern wrote: > On Wed, 2 May 2007, Mark Lord wrote: > >> Alan Stern wrote: >>> A better approach would be to find out why your system gets into that loop >>> and fix the underlying cause. >> Not better, just parallel. >> >> That loop should not be unbounded, as this example proves. >> But it also shouldn't get stuck there regardless. >> >> Two fixes needed. > > If the code never gets stuck in a loop, then there's no need to check > whether the loop is unbounded! :-)
Yes, except here we know it does actually get stuck in a loop, and having unbounded loops in device-driver code is a known baddy. One cannot predict perfectly exactly how devices will fail, but one can program defensively against them with simple precautions like limiting list traversals and the like. :) Sure, Marcel may eventually look at the bluetooth code and fix it to not get confused, but some other USB device may then show up in the future with similar issues. The messages are still there so we'll know about any future failure, but it won't just silently crash the machine on resume this way. Remember, resume is a very tough operation to debug at the best of times, so adding some harmless robustness to the more troublesome drives is a very Good Thing(tm) here. Cheers ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel