public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Oliver Neukum <oliver@neukum.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	greg@kroah.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] usb_debug: EXPERIMENTAL - poll hcd device to force writes
Date: Wed, 06 May 2009 15:24:33 -0500	[thread overview]
Message-ID: <4A01F201.3020406@windriver.com> (raw)
In-Reply-To: <200905062201.42965.oliver@neukum.org>

Oliver Neukum wrote:
> Am Mittwoch, 6. Mai 2009 21:24:56 schrieb Alan Stern:
>   
>> Converting \n to \r\n will add some complication
>> but not too much.
>>     

This conversion is done in the tty layer "the high level".  By the time
the low level driver gets it character stream via the tty call backs
everything is already processed.

>> Allocating URBs on the fly adds a lot of complication.  There has to be
>> a minimum number of pre-allocated URBs; otherwise write_room could
>>     
>
> Why? You can always calculate with the number of URBs you'd
> allocate as a maximum.
>
>   

In the scheme originally posted with the cap of 42 "in flight" urbs, I
had not seen it run out while using the standard tty driver.   The tty
driver really is not really the key problem I was after with the forced
poll patch.

The console driver is where all the character loss is going on.  There
is no tty interface, and there are no "write room" checks.  The present
kernel interface to the uart console callbacks is synchronous.

Here is a back trace to illustrate the typical 8250 driver.

#0  serial8250_console_putchar at drivers/serial/8250.c:2690
#1  0xc03977d4 in uart_console_write at drivers/serial/serial_core.c:1810
#2  0xc039cbb8 in serial8250_console_write at drivers/serial/8250.c:2729
#3  0xc022802b in __call_console_drivers at kernel/printk.c:419
#4  0xc022808b in _call_console_drivers at kernel/printk.c:449
#5  0xc0228269 in call_console_drivers at kernel/printk.c:499
#6  release_console_sem at kernel/printk.c:1020
#7  0xc022872b in vprintk at kernel/printk.c:749
#8  0xc022889b in printk at kernel/printk.c:582

Doing enough printk's such as in register_console() will cause loss
because you run out of URBs unless you can force them to complete.

Is there a valid way we can force the urbs to complete short of "polling
the heck out of the host controller" or have a synchronous interface in
the case of the console write call back?

There are two different call paths into the USB serial drivers just like
the uart drivers.  One is for the tty callbacks and other is for the
console call backs.  I am most interested how to fix the console writes
(with respect to the original experimental patch).

Jason.

  parent reply	other threads:[~2009-05-06 20:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-06  2:00 [PATCH 0/5] usb_debug driver improvements Jason Wessel
2009-05-06  2:00 ` [PATCH 1/5] usb_debug: implement multi urb write Jason Wessel
2009-05-06  2:00   ` [PATCH 2/5] usb_debug,usb_generic_serial: implement sysrq and serial break Jason Wessel
2009-05-06  2:00     ` [PATCH 3/5] usb,early_printk: insert cr prior to nl as needed Jason Wessel
2009-05-06  2:00       ` [PATCH 4/5] usb,early_printk: unregister early usb before rest_init() Jason Wessel
2009-05-06  2:00         ` [PATCH 5/5] usb_debug: EXPERIMENTAL - poll hcd device to force writes Jason Wessel
2009-05-06 15:18           ` Alan Stern
2009-05-06 15:25             ` Greg KH
2009-05-06 15:42               ` Alan Cox
2009-05-06 15:59               ` Jason Wessel
2009-05-06 15:41             ` Alan Cox
2009-05-06 15:45               ` Greg KH
2009-05-06 17:17               ` Oliver Neukum
2009-05-06 19:24                 ` Alan Stern
2009-05-06 20:01                   ` Oliver Neukum
2009-05-06 20:24                     ` Alan Stern
2009-05-06 22:24                       ` Oliver Neukum
2009-05-07 14:35                         ` Alan Stern
2009-05-07 15:01                           ` Oliver Neukum
2009-05-07 16:32                             ` Alan Stern
2009-05-06 20:24                     ` Jason Wessel [this message]
2009-05-06 20:28                       ` Greg KH
2009-05-06 20:51                         ` [PATCH 5/5] usb_debug: EXPERIMENTAL - poll hcd device to forcewrites Jason Wessel
2009-05-06 21:32                           ` Greg KH
2009-05-07 14:00                             ` Alan Stern
2009-05-07  0:06                   ` [PATCH 5/5] usb_debug: EXPERIMENTAL - poll hcd device to force writes Alan Cox
2009-05-07 14:27                     ` Alan Stern
2009-05-07 14:49                       ` Oliver Neukum
2009-05-06  7:34         ` [PATCH 4/5] usb,early_printk: unregister early usb before rest_init() Ingo Molnar
2009-05-06 13:02           ` Jason Wessel
2009-05-07 15:09             ` Ingo Molnar
2009-05-06  7:30       ` [PATCH 3/5] usb,early_printk: insert cr prior to nl as needed Ingo Molnar
2009-05-06 15:25         ` Greg KH
2009-05-07 15:04           ` Ingo Molnar
2009-05-06  7:16   ` [PATCH 1/5] usb_debug: implement multi urb write Oliver Neukum
2009-05-06 11:57     ` Jason Wessel
2009-05-06 12:31       ` Oliver Neukum
2009-05-06 15:26   ` Greg KH

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=4A01F201.3020406@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oliver@neukum.org \
    --cc=stern@rowland.harvard.edu \
    /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