On 19:49 Mon 05 Nov , Robert Jarzmik wrote: > Jean-Christophe PLAGNIOL-VILLARD <plagnioj@xxxxxxxxxxxx> writes: > > On 19:07 Mon 05 Nov , Robert Jarzmik wrote: > >> Jean-Christophe PLAGNIOL-VILLARD <plagnioj@xxxxxxxxxxxx> writes: > >> No timeout indeed, on purpose. > >> > >> The short explanation is that in a purge situation, all incoming data must be > >> flushed, regardless of the time it takes. > >> > >> The long explantion is : > >> - suppose the while(cdev->tstc(cdev)) takes a lot of time > >> - this implies that : > >> => the sender is sending data as fast as the reader can consume (not quite > >> probable, but why not ...) > >> => the sender has gone crazy, as in *-Modem protocol when this function is > >> called, no more than 1029 bytes can be sent by a *sane* sender > >> > >> So let's take as granted that the sender has gone crazy (or hardware is brain > >> dead). What will happen if I place a timeout here ? > >> - first, I'll obviously get out of xy_flush() > >> - then, as I receive garbage, xy_handle() will exit with either -EBADMSG or > >> -EILSEQ. So far so good. > >> - then the loady command will finish on error. Still good. > >> - then the input console will take over, and execute all the garbage sent to > >> it. > >> This is definitely something we don't want. Imagine in the garbage you have > >> something like "erase /dev/mtd0" ... Therefore, no timeout. > > my issue is how can I interrupt it from barebox > You can't, how could you ? Your console is overwhelmed by garbage input, what > could you possibly do to interrupt it apart from cutting down the sender ? this is an issue if we have more than one we need be able to do so and I may want to use it on an other console_device not necessarely the current one I have often hw that have more than one uart > > > can you put the v3 on a tree somewhere so I can pull it > I'll try. I have no external git I can push to. If you have a hint ... https://git.wiki.kernel.org/index.php/GitHosting Best Regards, J. > > -- > Robert _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox