All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2 1/2] commands: change Y-Modem implementation
Date: Mon, 05 Nov 2012 19:49:52 +0100	[thread overview]
Message-ID: <878vafvq9b.fsf@free.fr> (raw)
In-Reply-To: <20121105182544.GB25679@game.jcrosoft.org> (Jean-Christophe PLAGNIOL-VILLARD's message of "Mon, 5 Nov 2012 19:25:44 +0100")

Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> writes:
> On 19:07 Mon 05 Nov     , Robert Jarzmik wrote:
>> Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> 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 ?

> 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 ...

-- 
Robert

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-11-05 18:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01 17:37 [PATCH 0/2] Y-Modem implementation change Robert Jarzmik
2012-11-01 17:37 ` [PATCH 1/2] commands: change Y-Modem implementation Robert Jarzmik
2012-11-01 17:37 ` [PATCH 2/2] commands: remove old " Robert Jarzmik
2012-11-01 17:50 ` [PATCH 0/2] Y-Modem implementation change Jean-Christophe PLAGNIOL-VILLARD
2012-11-01 18:47   ` Antony Pavlov
2012-11-01 19:19 ` Antony Pavlov
2012-11-01 19:57   ` Robert Jarzmik
2012-11-01 19:33 ` Sascha Hauer
2012-11-04 17:55 ` [PATCH v2 1/2] commands: change Y-Modem implementation Robert Jarzmik
2012-11-04 17:55   ` [PATCH v2 2/2] commands: remove old " Robert Jarzmik
2012-11-04 18:36   ` [PATCH v2 1/2] commands: change " Jean-Christophe PLAGNIOL-VILLARD
2012-11-05 18:07     ` Robert Jarzmik
2012-11-05 18:25       ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-05 18:49         ` Robert Jarzmik [this message]
2012-11-05 19:49           ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-05 21:31             ` Robert Jarzmik
2012-11-06  7:34               ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-06 20:50                 ` Robert Jarzmik
2012-11-07  8:22                   ` Antony Pavlov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878vafvq9b.fsf@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.