mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: stefan.bigler@keymile.com
Cc: Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: TTY loosing data with u_serial gadget
Date: Fri, 18 Mar 2011 18:07:18 +0000	[thread overview]
Message-ID: <20110318180718.6d019c71@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <4D8389EC.5030704@keymile.com>

> I had also a look at the relevant fixes, a lot is done but I could not find
> the required protection of the attribute receive_room.

receive_room isn't protected because it may only be shrunk by the amount
of data sent to the ldisc or less. The ldisc is at liberty to grow the
value as it sees fit.

In essence if you get a value from receive_room it's a guarantee you may
send that many bytes, it is not a precise instantaneous perfect answer to
the question "exactly what number of bytes could fit at this precise
moment".

Which does of course mean you should never see the case where
receive_room is bigger than the actual space available in tty raw mode.



  parent reply	other threads:[~2011-03-18 18:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 20:47 Stefan Bigler
2011-03-17  0:04 ` Greg KH
2011-03-18 16:35   ` Stefan Bigler
2011-03-18 17:08     ` Felipe Balbi
2011-03-18 18:06       ` Alan Cox
2011-03-21  9:32         ` Felipe Balbi
2011-03-22  8:53           ` Felipe Balbi
2011-03-22 11:04             ` Alan Cox
2011-03-22 17:01               ` Greg KH
2011-03-24 12:07             ` Toby Gray
2011-03-24 12:37               ` Felipe Balbi
2011-03-24 12:51                 ` Toby Gray
2011-03-24 13:00                   ` Felipe Balbi
2011-03-24 15:40                     ` Stefan Bigler
2011-03-24 16:15                       ` Toby Gray
2011-03-25 11:02                         ` Felipe Balbi
2011-03-18 21:46       ` Stefan Bigler
2011-03-18 18:07     ` Alan Cox [this message]
2011-03-18 21:15       ` Stefan Bigler

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=20110318180718.6d019c71@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stefan.bigler@keymile.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

all inboxes | Powered by JetHome®