On 08/10/2010 03:45, Chris Frey wrote:
> On Tue, Oct 05, 2010 at 11:29:47AM +0100, Toby Gray wrote:
>> When performing testing with some additional devices, I've discovered
>> that it is possible to receive zero sized reads from some BlackBerry
>> devices. When using a Curve 8520 it seems to cause zero sized reads
>> occasionally when it blanks or unblanks the screen.
>>
>> I think the only solution is to go back to the old behaviour of ignoring
>> unroutable reads and just depend on the timeout on sending/receiving to
>> pick up when the port has been reset. I've made this change in
>> 44980b19653972369fdd, so that now there is just some debug logging when
>> an unroutable read occurs.
>>
>> I'll carry on working through testing with the 20 or so BlackBerry
>> devices we've got here and will let you know if I see any other issues.
> Thanks for finding this.
>
> I've been pondering over this, and I think this result means that the entire
> UnroutableRead idea is invalid.  Basically it is not safe to assume
> that 0 byte USB packets are an error... not even on the BlackBerry,
> which I had hoped was true.
>
> So I think the best fix is to remove the UnroutableReadError exception
> entirely, and go back to the simple return.
>
> I've reverted commit c7685942140b123bf110e755ce11a97c3c6372f7.
Sounds sensible to me. Thanks for reverting that change and I apologise 
for not doing the logging change in a separate commit so that you had to 
reapply it.

The zero read == error fix is not really an important fix now anyway, as 
the most common cause of the port resets has been removed. It will now 
only be an issue if something else triggers a port reset, but hopefully 
that will only be user intervention now.
> Please let me know if there are any outstanding issues.
> Do we still need that m_seen_usb_error check in DoRead() if 0 byte
> reads are not an error anymore?
The reason for having the m_seen_usb_error check in DoRead() is for when 
the BlackBerry is physically unplugged. Without it the read thread 
constantly tries to do a bulk read, receives a Usb::Error as it's 
unplugged, notifies all the handlers and then immediately tries a 
DoRead() again. This caused 100% CPU usage for a short while and, more 
annoyingly, puts lots of output on stderr about and handler receiving 
USB errors.

Regards,

Toby

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Barry-devel mailing list
Barry-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/barry-devel

Reply via email to