linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.de>
To: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] cdc-acm: acm_init: Set initial BAUD to B0
Date: Tue, 14 Jul 2020 09:02:09 +0200	[thread overview]
Message-ID: <1594710129.2541.15.camel@suse.de> (raw)
In-Reply-To: <0180a0cae3ff2772df0f6cea93739ae2deb52b24.camel@infinera.com>

Am Montag, den 13.07.2020, 20:26 +0000 schrieb Joakim Tjernlund:

Good morning,

> 
> OK, but it is strange that init_termios.c_cflag does not take/do
> anything unless I change order. Perhaps termios should move to probe
> instead?

Are you saying that the tty layer does not set termios when a new
tty is created? This looks strange to me and I do not want to paper
over a wider issue.

> Also, the handling of DTR came up. It seems to me that ACM
> deassert DTR until open time which is fine/good.

ACM does not really control DTR by itself. The earliest time
we can touch it would be probe. And again setting sane defaults
for DTR looks like a job for the tty layer.
acm_set_control() AFAICT does its job correctly.

> !DTR signals to the other end that ACM is not ready and don't
> want input but ACM still accepts input if received.
> 
> Would it make sense to actually enforce DTR locally too?
> If input is unwanted, don't accept any either.

This looks difficult. Basically we can call acm_set_control()
which will execute a control request. Yet there is inevitably
a race between setting such a control line and data getting in
and between clearing a control signal and data getting into the buffer.
We could stop reading once we are sure the control signal is
effective, but we have no operation for clearing the buffers
in the device. We cannot tell whether data in them is stale
in the sense of being accepted without DTR or newly arrived.

Could you make a concrete proposal of how to achieve this
short of a device reset? The mapping between CDC-ACM and
a physical RS-232 is only as good as the device makes it.
CDC-ACM is only secondarily a serial driver. The common
association between modems and serial devices is historical,
not technical.

	Regards
		Oliver


  reply	other threads:[~2020-07-14  7:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10  9:35 [PATCH] cdc-acm: acm_init: Set initial BAUD to B0 Joakim Tjernlund
2020-07-10  9:54 ` Johan Hovold
2020-07-10 10:16   ` Joakim Tjernlund
2020-07-10 10:36     ` Greg KH
2020-07-10 10:48       ` Joakim Tjernlund
2020-07-10 12:37     ` Johan Hovold
2020-07-10 10:34 ` Greg KH
2020-07-10 10:40   ` Joakim Tjernlund
2020-07-10 10:46   ` Joakim Tjernlund
2020-07-10 12:41     ` Johan Hovold
2020-07-10 16:05       ` Joakim Tjernlund
2020-07-10 16:08         ` Joakim Tjernlund
2020-07-13 12:29         ` Johan Hovold
2020-07-13 10:08 ` Oliver Neukum
2020-07-13 20:26   ` Joakim Tjernlund
2020-07-14  7:02     ` Oliver Neukum [this message]
2020-07-14  9:06       ` 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=1594710129.2541.15.camel@suse.de \
    --to=oneukum@suse.de \
    --cc=Joakim.Tjernlund@infinera.com \
    --cc=linux-usb@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).