linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Oliver Neukum <oneukum@suse.com>
Cc: Simon Arlott <simon@octiron.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH] USB: cdc-acm: expose serial close_delay and closing_wait in sysfs
Date: Thu, 24 Aug 2023 21:53:28 -0400	[thread overview]
Message-ID: <d1658254-b65b-4e2e-8c22-45008374d6eb@rowland.harvard.edu> (raw)
In-Reply-To: <f1b001d8-4d6c-8c9d-a90c-7d97294b66b4@suse.com>

On Fri, Aug 25, 2023 at 01:46:15AM +0200, Oliver Neukum wrote:
> 
> 
> On 24.08.23 20:02, Simon Arlott wrote:
> > The ioctl can't be used without opening and closing the tty, which has
> > side effects. On open() it'll raise DTR/RTS and activate it. For cdc-acm
> > that will indicate to the device that the serial port has been opened
> > which will be visible to the software running on the USB device. On
> > close() it'll be delayed by the close_delay if any process is currently
> > doing a blocking open() and there's no carrier, then the closing_wait
> > time if there's been any incomplete transmitted data (by any process).
> 
> And that is an issue of the generic serial layer.

Is it feasible to add a sysfs attribute for ttys or the serial layer to 
control the side effect of opening (avoid raising DTR/RTS)?  If that 
could be done, a program could use the existing ioctl to set close_delay 
and closing_wait to 0 with no penalties.

This would be racy, but for the purposes of udev that shouldn't matter 
much.

Alan Stern

      reply	other threads:[~2023-08-25  1:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23 20:37 [PATCH] USB: cdc-acm: expose serial close_delay and closing_wait in sysfs Simon Arlott
2023-08-23 21:12 ` [PATCH (v2)] " Simon Arlott
2023-08-24  7:18   ` [PATCH] docs: ABI: sysfs-tty: close times are in hundredths of a second Simon Arlott
2023-08-25  5:33     ` Jiri Slaby
2023-08-27 18:23       ` [PATCH (v2)] docs: ABI: sysfs-tty: close times are in centiseconds Simon Arlott
2023-08-24  8:21 ` [PATCH] USB: cdc-acm: expose serial close_delay and closing_wait in sysfs Oliver Neukum
2023-08-24 14:48 ` Greg Kroah-Hartman
2023-08-24 18:02   ` Simon Arlott
2023-08-24 19:22     ` Greg Kroah-Hartman
2023-08-27 15:36       ` Simon Arlott
2023-08-24 23:46     ` Oliver Neukum
2023-08-25  1:53       ` Alan Stern [this message]

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=d1658254-b65b-4e2e-8c22-45008374d6eb@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=simon@octiron.net \
    /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).