From: Jason Wessel <jason.wessel@windriver.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: gregkh@suse.de, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, Alan Cox <alan@linux.intel.com>,
Oliver Neukum <oliver@neukum.org>
Subject: Re: [PATCH 5/6] usb-hcd,usb-console: poll hcd device to force usb console writes
Date: Wed, 10 Mar 2010 16:27:35 -0600 [thread overview]
Message-ID: <4B981CD7.3060908@windriver.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1003091005080.1693-100000@iolanthe.rowland.org>
Alan Stern wrote:
> On Tue, 9 Mar 2010, Jason Wessel wrote:
>
>> This patch tries to solve the problem that data is lost because there
>> are too many outstanding transmit urb's while trying to execute
>> printk's to a console. The same is true if you try something like
>> "echo t > /proc/sysrq-trigger".
>>
>> This patch takes the route of forcibly polling the hcd device to drain
>> the urb queue in order to initiate the bulk write call backs. This
>> only happens if the device is a usb serial console device that sets
>> the max_in_flight_urbs to a non zero value in the serial device
>> structure.
>>
>> A few millisecond penalty will get incurred to allow the hcd controller
>> to complete a write urb, else the console data is thrown away.
>>
>> The max_in_flight_urbs was reduced in the usb_debug driver because it
>> is highly desired to push things out to the console in a timely
>> fashion and there is no need to have a queue that large for the
>> interrupt driven mode of operation when used through the tty
>> interface.
>
>> --- a/drivers/usb/core/hcd.c
>> +++ b/drivers/usb/core/hcd.c
>> @@ -1973,6 +1973,7 @@ irqreturn_t usb_hcd_irq (int irq, void *__hcd)
>> local_irq_restore(flags);
>> return rc;
>> }
>> +EXPORT_SYMBOL_GPL(usb_hcd_irq);
>
> Is there any reason for EXPORTing this? It doesn't get used anywhere
> else.
>
Certainly not anymore. The previous iteration of this code used this
function. Thanks for catching that.
>> index a3cdb09..703f407 100644
>> --- a/drivers/usb/core/hcd.h
>> +++ b/drivers/usb/core/hcd.h
>> @@ -318,6 +318,7 @@ extern void usb_put_hcd(struct usb_hcd *hcd);
>> extern int usb_add_hcd(struct usb_hcd *hcd,
>> unsigned int irqnum, unsigned long irqflags);
>> extern void usb_remove_hcd(struct usb_hcd *hcd);
>> +extern void usb_hcd_poll_irq(struct usb_device *udev);
>>
>> struct platform_device;
>> extern void usb_hcd_platform_shutdown(struct platform_device *dev);
>
> It might be better to put this in a "public" header file; that is,
> something under include/linux/usb or include/linux/usb.h. You could
> even take the "_hcd" part out of the name, because the interface uses
> only a struct usb_device, not a struct usb_hcd.
If this is what you prefer, I have no problem with it. I'll post a v2
of the series after some testing.
Jason.
next prev parent reply other threads:[~2010-03-10 22:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-09 6:29 [PATCH 0/6] usb console improvements series Jason Wessel
2010-03-09 6:29 ` [PATCH 1/6] tty_port,usb-console: Fix usb serial console open/close regression Jason Wessel
2010-03-09 6:29 ` [PATCH 2/6] usb-serial: Use tty_port version of console instead of the usb_serial_port version Jason Wessel
2010-03-09 6:29 ` [PATCH 3/6] usb-console: pass baud from console to the initial tty open Jason Wessel
2010-03-09 6:29 ` [PATCH 4/6] usb-serial: optimize sysrq function calls Jason Wessel
2010-03-09 6:29 ` [PATCH 5/6] usb-hcd,usb-console: poll hcd device to force usb console writes Jason Wessel
2010-03-09 6:29 ` [PATCH 6/6] usb-serialy,sysrq: Run the sysrq handler in a tasklet Jason Wessel
2010-03-09 15:08 ` [PATCH 5/6] usb-hcd,usb-console: poll hcd device to force usb console writes Alan Stern
2010-03-10 22:27 ` Jason Wessel [this message]
2010-03-09 15:14 ` [PATCH 4/6] usb-serial: optimize sysrq function calls Alan Stern
2010-03-10 22:18 ` Jason Wessel
2010-03-16 20:30 ` [PATCH 0/6] usb console improvements series 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=4B981CD7.3060908@windriver.com \
--to=jason.wessel@windriver.com \
--cc=alan@linux.intel.com \
--cc=gregkh@suse.de \
--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;
as well as URLs for NNTP newsgroup(s).