linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <jhovold@gmail.com>
To: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Cc: Johan Hovold <jhovold@gmail.com>, Oliver Neukum <oneukum@suse.de>,
	Jiri Slaby <jslaby@suse.cz>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	Peter Hurley <peter@hurleysoftware.com>,
	Xiao Jin <jin.xiao@intel.com>,
	david.a.cohen@linux.intel.com, yanmin.zhang@intel.com
Subject: Re: [RFC 1/2] n_tty: fix dropped output characters
Date: Mon, 14 Apr 2014 15:27:34 +0200	[thread overview]
Message-ID: <20140414132734.GA27724@localhost> (raw)
In-Reply-To: <20140414135333.1057aac8@alan.etchedpixels.co.uk>

On Mon, Apr 14, 2014 at 01:53:33PM +0100, One Thousand Gnomes wrote:
> On Fri, 11 Apr 2014 11:41:24 +0200
> Johan Hovold <jhovold@gmail.com> wrote:
> 
> > Fix characters being dropped by n_tty_write() due to a failure to
> > check the return value of tty_put_char() in do_output_char().
> > 
> > Characters are currently being dropped by write if a tty driver claims
> > to have write room available, but still fails to buffer any data
> 
> Your driver is buggy. If you advertise a buffer you must honour it and
> neither shrink nor revoke it. 

Very well, that settles the question.
 
> For an URB based device you almost certainly want internal buffering so
> you can do proper packetisation. USB serial these days gets it right - see
> drivers/usb/serial/generic.c for a fairly simple kfifo based approach.

I'm quite aware of the usb-serial approach as I implemented it. ;)

I have considered "porting" it to the ACM driver, and unless anyone is
against the extra copy the fifo would imply, I'll go ahead and do just
that (although, I know of at least one buggy ACM device that violates
the ACM specification and cannot handle merged writes...).

> Whether applying it to cdc_acm would make sense I don't know but it looks
> like it might be simpler over-all than the current arrangement.

With the current fifo-less implementation, the ACM driver could use the
approach taken by the usb-wwan and sierra usb-serial drivers, which
queue up all there write urbs while suspended. That way the available
buffer space never shrinks.

Thanks,
Johan

  parent reply	other threads:[~2014-04-14 13:28 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08  3:05 [PATCH] cdc-acm: some enhancement on acm delayed write Xiao Jin
2014-04-08  7:33 ` Johan Hovold
2014-04-08 10:22   ` Oliver Neukum
2014-04-11  9:45     ` Johan Hovold
2014-04-08 10:33   ` Oliver Neukum
2014-04-08 13:17     ` Johan Hovold
2014-04-08 13:38       ` Oliver Neukum
2014-04-08 13:52         ` Johan Hovold
2014-04-08 11:22 ` One Thousand Gnomes
2014-04-08 13:12   ` Johan Hovold
2014-04-09 14:57 ` Xiao Jin
2014-04-09 17:43   ` David Cohen
2014-04-10  8:02   ` Oliver Neukum
2014-04-10 22:51     ` Xiao Jin
2014-04-11  7:09       ` Oliver Neukum
2014-04-11  9:37     ` Johan Hovold
2014-04-11  9:41       ` [RFC 1/2] n_tty: fix dropped output characters Johan Hovold
2014-04-11  9:41         ` [RFC 2/2] USB: cdc-acm: fix broken runtime suspend Johan Hovold
2014-04-14 12:53         ` [RFC 1/2] n_tty: fix dropped output characters One Thousand Gnomes
2014-04-14 13:05           ` Oliver Neukum
2014-04-14 14:04             ` One Thousand Gnomes
2014-04-14 13:27           ` Johan Hovold [this message]
2014-04-14 19:58       ` [PATCH] USB: cdc-acm: fix broken runtime suspend Johan Hovold
2014-04-15  8:24         ` Xiao Jin
2014-04-15  8:54           ` Johan Hovold
2014-04-15  8:35         ` Oliver Neukum
2014-04-15  9:13           ` Johan Hovold
2014-04-15 12:19             ` Johan Hovold
2014-05-24 14:42         ` Johan Hovold
2014-05-24 19:59           ` Greg Kroah-Hartman
2014-05-24 20:42             ` Johan Hovold
2014-05-26 17:22               ` [PATCH 00/63] USB: (mostly runtime PM) patches for v3.16-rc Johan Hovold

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=20140414132734.GA27724@localhost \
    --to=jhovold@gmail.com \
    --cc=david.a.cohen@linux.intel.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=jin.xiao@intel.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.de \
    --cc=peter@hurleysoftware.com \
    --cc=yanmin.zhang@intel.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;
as well as URLs for NNTP newsgroup(s).