public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Toby Gray <toby.gray@realvnc.com>
To: balbi@ti.com
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Stefan Bigler <stefan.bigler@keymile.com>,
	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: Thu, 24 Mar 2011 12:51:45 +0000	[thread overview]
Message-ID: <4D8B3E61.1090704@realvnc.com> (raw)
In-Reply-To: <20110324123708.GK14602@legolas.emea.dhcp.ti.com>

On 24/03/2011 12:37, Felipe Balbi wrote:
> Hi,
>
> On Thu, Mar 24, 2011 at 12:07:56PM +0000, Toby Gray wrote:
>> Is this patch missing the changes to tty_buffer.c that were in
>> http://permalink.gmane.org/gmane.linux.usb.general/28976
>>
>> Without the changes to tty_buffer.c to use the value returned from
>> the receive_buf call then doesn't this patch not work correctly?
>>
<snip>
> you are right, thanks for noticing that. Attached is an updated patch.
> I left removal of receive_room out of this patch to prevent too invasive
> change, that can be done on a separate patch.

I've just tried removing receive_room myself and noticed that it is 
still used in flush_to_ldisc to decide if it needs to schedule work to 
be done later:

    if (!tty->receive_room || seen_tail) {
       schedule_work(&tty->buf.work);
       break;
    }

If receive_room is no longer being updated then isn't this the wrong 
thing to do? Shouldn't it check if some data was copied after calling 
receive_buf, and if there wasn't any then it should schedule the work 
and break?

The other query I've got is about the return value from receive_buf. I 
noticed that you've modified some drivers (such as 
bluetooth/hci_ldisc.c) so that they can return error values, such as 
-ENODEV. Won't this cause things to go wrong when flush_to_ldisc and 
paste_selection use the return value without checking for it being negative?

Thank you for your quick reply to my first query, it's appreciated.

Regards,

Toby

  reply	other threads:[~2011-03-24 12:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 20:47 TTY loosing data with u_serial gadget 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 [this message]
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
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=4D8B3E61.1090704@realvnc.com \
    --to=toby.gray@realvnc.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=balbi@ti.com \
    --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