Linux Serial subsystem development
 help / color / mirror / Atom feed
From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
Cc: "linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"oneukum@suse.com" <oneukum@suse.com>
Subject: Re: Default ECHO on TTYs causes unwanted garbage chars
Date: Wed, 10 Jun 2020 09:24:38 +0200	[thread overview]
Message-ID: <20200610072438.GG1923109@kroah.com> (raw)
In-Reply-To: <d2428c7b828d24fe1eb9b05e2d0d1af52edef846.camel@infinera.com>

On Tue, Jun 09, 2020 at 03:01:14PM +0000, Joakim Tjernlund wrote:
> On Tue, 2020-06-09 at 16:22 +0200, gregkh@linuxfoundation.org wrote:
> > 
> > On Tue, Jun 09, 2020 at 01:13:06PM +0000, Joakim Tjernlund wrote:
> > > On Tue, 2020-06-09 at 13:57 +0200, Greg KH wrote:
> > > > On Tue, Jun 09, 2020 at 11:38:49AM +0000, Joakim Tjernlund wrote:
> > > > > Hi List
> > > > > 
> > > > > I was advised to come here with this problem(started on the USB list).
> > > > > 
> > > > > We have a USB to RS232 bridge which presents itself as an ttyACM and the first connect after power on,
> > > > > we see some garbage chars transmitted back from USB host(PC) to out device which becomes input to
> > > > > the device.
> > > > > 
> > > > > After much debugging I found that this are chars sent early in the boot process which then
> > > > > are buffered and the TTYs default to ECHO chars is the cause.
> > > > 
> > > > So some program in the boot sequence is trying to send data out the
> > > > device?  Why not just not do that?
> > > 
> > > This is the boot console. Both u-boot and Linux prints a lot there, then init prints while starting services
> > 
> > So the same device is used for boot console as well as a ttyACM device
> > later on?
> 
> Not quite, the USB to RS232 chip is integrated on the device and is connected the CPUs RS232,
> there is no other port.
> I think you could compare with an external USB to RS232 puck. Senario:
> - Connect the puck to both computer and your device with an RS232 port.
> - Power on the device with the RS232 port.
> - Device "boots" and prints stuff on its RS232 port,
> 
> some time passes
> 
> - Open ttyACM in PC using minicom/cu
> Now early history of the boot prints are echoed back from PC to device with RS232

Ah, ok, so, are you sure that data isn't just "stuck" in the USB-serial
chip's buffers?  That's often the case with many devices as they are
tiny and dumb and try to do the right thing most of the time (like not
drop data that was sent to it.)

thanks,

greg k-h

  parent reply	other threads:[~2020-06-10  7:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 11:38 Default ECHO on TTYs causes unwanted garbage chars Joakim Tjernlund
2020-06-09 11:57 ` Greg KH
2020-06-09 13:13   ` Joakim Tjernlund
2020-06-09 14:22     ` gregkh
2020-06-09 15:01       ` Joakim Tjernlund
2020-06-09 21:26         ` Maarten Brock
2020-06-10  7:34           ` Joakim Tjernlund
2020-06-10  7:24         ` gregkh [this message]
2020-06-10  7:42           ` Joakim Tjernlund
2020-06-15 10:55             ` Joakim Tjernlund

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=20200610072438.GG1923109@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Joakim.Tjernlund@infinera.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=oneukum@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox