Re: [PATCH 2/2] USB: set hub's default autosuspend delay as 0

2012-09-21 Thread Ming Lei
into the hub under discussion, IMO. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] USB: fix missed resume for auto-suspend failed interface

2012-09-20 Thread Ming Lei
On Thu, Sep 20, 2012 at 3:29 PM, Oliver Neukum oneu...@suse.de wrote: On Thursday 20 September 2012 13:28:51 Ming Lei wrote: If one usb interface driver returns failure from its suspend(auto) callback inside usb_suspend_both, its resume() callback should be called to recover its working state

[PATCH 1/2] USB: check port changes before hub runtime suspend

2012-09-20 Thread Ming Lei
events are found. The disadvantage is that some delay may be introduced in hub auto-suspend path. Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/core/hub.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core

[PATCH 2/2] USB: set hub's default autosuspend delay as 0

2012-09-20 Thread Ming Lei
This patch sets hub device's default autosuspend delay as 0 to speedup bus suspend, see comments in code for details. Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/core/hub.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/drivers/usb

Re: [PATCH 2/2] USB: set hub's default autosuspend delay as 0

2012-09-20 Thread Ming Lei
On Thu, Sep 20, 2012 at 10:48 PM, Alan Stern st...@rowland.harvard.edu wrote: On Thu, 20 Sep 2012, Ming Lei wrote: This patch sets hub device's default autosuspend delay as 0 to speedup bus suspend, see comments in code for details. The explanation in the comments assumes that the only

Re: [PATCH 1/2] USB: check port changes before hub runtime suspend

2012-09-20 Thread Ming Lei
On Thu, Sep 20, 2012 at 10:43 PM, Alan Stern st...@rowland.harvard.edu wrote: On Thu, 20 Sep 2012, Ming Lei wrote: It is very common that hub status endpoint has a long 'bInterval', for example, it may be 11(128ms for HS device) or 12(256ms for HS device), so the device connection change may

Re: [PATCH 2/2] USB: set hub's default autosuspend delay as 0

2012-09-20 Thread Ming Lei
On Thu, Sep 20, 2012 at 11:23 PM, Ming Lei ming@canonical.com wrote: I will try to study 'lsusb' to see if there is one problem and try to solve it. If what you concern is about accessing device via libusb, it should be OK since the device will be resumed in its open() and suspended

Re: [PATCH 2/2] USB: set hub's default autosuspend delay as 0

2012-09-20 Thread Ming Lei
On Fri, Sep 21, 2012 at 12:49 AM, Alan Stern st...@rowland.harvard.edu wrote: On Thu, 20 Sep 2012, Ming Lei wrote: On Thu, Sep 20, 2012 at 10:48 PM, Alan Stern st...@rowland.harvard.edu wrote: On Thu, 20 Sep 2012, Ming Lei wrote: This patch sets hub device's default autosuspend delay

Re: [PATCH 2/2] USB: set hub's default autosuspend delay as 0

2012-09-20 Thread Ming Lei
On Fri, Sep 21, 2012 at 12:43 AM, Rajaram R rajaram.officem...@gmail.com wrote: On Thu, Sep 20, 2012 at 9:38 PM, Ming Lei ming@canonical.com wrote: On Thu, Sep 20, 2012 at 11:23 PM, Ming Lei ming@canonical.com wrote: I will try to study 'lsusb' to see if there is one problem and try

Re: [PATCH 1/2] USB: check port changes before hub runtime suspend

2012-09-20 Thread Ming Lei
no objection, I will figure out a new patch to fix the bug device. Thanks -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/2] USB: check port changes before hub runtime suspend

2012-09-20 Thread Ming Lei
On Fri, Sep 21, 2012 at 10:06 AM, Ming Lei ming@canonical.com wrote: On Fri, Sep 21, 2012 at 1:04 AM, Alan Stern st...@rowland.harvard.edu wrote: What happens if you put the msleep(1) after the new check_ports_change() call? If a new device is connected into the '05e3:0608 Genesys

[RFC PATCH v1 0/3] usbnet: runtime suspend when link becomes down

2012-09-18 Thread Ming Lei
+++- 8 files changed, 306 insertions(+), 35 deletions(-) Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[RFC PATCH v1 1/3] usbnet: introduce usbnet_link_change API

2012-09-18 Thread Ming Lei
This patch introduces the API of usbnet_link_change, so that usbnet can trace the link change, which may help to implement the later runtime PM triggered by usb ethernet link change. Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/usbnet.c | 13 - include/linux

[RFC PATCH v1 2/3] usbnet: apply usbnet_link_change

2012-09-18 Thread Ming Lei
This patch applies the introduce usbnet_link_change API. Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/asix_devices.c |6 +- drivers/net/usb/cdc_ether.c|5 + drivers/net/usb/cdc_ncm.c |9 +++-- drivers/net/usb/dm9601.c |7

[RFC PATCH v1 3/3] usbnet: support runtime PM triggered by link change

2012-09-18 Thread Ming Lei
triggered runtime PM working on these devices. Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/sierra_net.c |3 +- drivers/net/usb/usbnet.c | 269 +- include/linux/usb/usbnet.h | 20 3 files changed, 286 insertions(+), 6

Re: [RFC PATCH v1 0/3] usbnet: runtime suspend when link becomes down

2012-09-18 Thread Ming Lei
On Tue, Sep 18, 2012 at 10:28 PM, Oliver Neukum oneu...@suse.de wrote: On Tuesday 18 September 2012 22:23:18 Ming Lei wrote: Hi, Currently only very few usbnet devices support the traffic based runtime PM, eg. wake up devices if there are packets to be transmitted. Hi, independent

Re: [RFC PATCH 0/3] usbnet: support runtime PM triggered by link change

2012-09-17 Thread Ming Lei
On Mon, Sep 17, 2012 at 4:04 PM, Oliver Neukum oneu...@suse.de wrote: On Sunday 16 September 2012 01:48:16 Ming Lei wrote: Hi, Currently only very few usbnet devices support the traffic based runtime PM, eg. wake up devices if there are packets to be transmitted. For the below situation

Re: [RFC PATCH 3/3] usbnet: support runtime PM triggered by link change

2012-09-17 Thread Ming Lei
On Mon, Sep 17, 2012 at 4:50 PM, Oliver Neukum oneu...@suse.de wrote: On Sunday 16 September 2012 01:48:19 Ming Lei wrote: +void usbnet_link_updated(struct usbnet *dev) +{ + complete(dev-link_update_completion); +} +EXPORT_SYMBOL_GPL(usbnet_link_updated); Isn't that a bit too trivial

[RFC PATCH 0/3] usbnet: support runtime PM triggered by link change

2012-09-15 Thread Ming Lei
|7 +- drivers/net/usb/mcs7830.c |6 +- drivers/net/usb/sierra_net.c |6 +- drivers/net/usb/usbnet.c | 224 +++- include/linux/usb/usbnet.h | 21 +++- 8 files changed, 250 insertions(+), 34 deletions(-) Thanks -- Ming Lei

[RFC PATCH 1/3] usbnet: introduce usbnet_link_change API

2012-09-15 Thread Ming Lei
This patch introduces the API of usbnet_link_change, so that usbnet can trace the link change, which may help to implement the later runtime PM triggered by usb ethernet link change. Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/usbnet.c | 11 +++ include/linux

[RFC PATCH 2/3] usbnet: apply usbnet_link_change

2012-09-15 Thread Ming Lei
This patch applies the introduce usbnet_link_change API. Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/asix_devices.c |6 +- drivers/net/usb/cdc_ether.c|5 + drivers/net/usb/cdc_ncm.c |9 +++-- drivers/net/usb/dm9601.c |7

Re: changing usbnet's API to better deal with cdc-ncm

2012-09-06 Thread Ming Lei
On Thu, Sep 6, 2012 at 4:30 PM, Bjørn Mork bj...@mork.no wrote: Ming Lei tom.leim...@gmail.com writes: On Thu, Sep 6, 2012 at 4:12 AM, Oliver Neukum oneu...@suse.de wrote: Hi, looking at cdc-ncm it seeems to me that cdc-ncm is forced to play very dirty games because usbnet doesn't have

Re: changing usbnet's API to better deal with cdc-ncm

2012-09-06 Thread Ming Lei
On Fri, Sep 7, 2012 at 1:56 AM, Oliver Neukum oneu...@suse.de wrote: On Friday 07 September 2012 00:09:13 Ming Lei wrote: On Thu, Sep 6, 2012 at 4:30 PM, Bjørn Mork bj...@mork.no wrote: Ming Lei tom.leim...@gmail.com writes: Looks the introduced .tx_bundle is not necessary since .tx_fixup

Re: [PATCH net] net: usbnet: fix softirq storm on suspend

2012-09-04 Thread Ming Lei
); tasklet_schedule (dev-bh); tasklet_schedule (dev-bh); Could you add some debug info inside the caller to see which one cause the tasklet to be scheduled? Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message

Re: [PATCH net] net: usbnet: fix softirq storm on suspend

2012-09-03 Thread Ming Lei
error EHOSTUNREACH into ENOLINK, so this is an expected and persistent error for a suspended device. The old code tested for this condition and avoided rescheduling. Putting this test back. Cc: sta...@vger.kernel.org # v3.5 Cc: Ming Lei ming@canonical.com Cc: Oliver Neukum oneu

Re: BUG: unable to handle kernel paging request in usb_match_id()

2012-08-17 Thread Ming Lei
driver probe further after kernel init is completed? Or even devices should be allowed to add into system? Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: BUG: unable to handle kernel paging request in usb_match_id()

2012-08-17 Thread Ming Lei
On Fri, Aug 17, 2012 at 10:42 PM, Greg Kroah-Hartman gre...@linuxfoundation.org wrote: On Fri, Aug 17, 2012 at 10:38:16AM -0400, Alan Stern wrote: On Fri, 17 Aug 2012, Ming Lei wrote: But, if HOTPLUG is not enabled, should device_add() trigger driver probe further after kernel init

Re: Do we need asynchronous pm_runtime_get()? (was: Re: bisected regression ...)

2012-08-09 Thread Ming Lei
On Thu, Aug 9, 2012 at 6:46 PM, Rafael J. Wysocki r...@sisk.pl wrote: On Thursday, August 09, 2012, Ming Lei wrote: driver-runtime_resume should be allowed to do I/O things after the device has been woken up inside driver callback, shouldn't it? If it isn't allowed, something wrong should

Re: Remote wakeup functionality using gadgetfs.

2012-08-09 Thread Ming Lei
wakeup. Maybe you can figure out a way to add support. Looks all function drivers of usb gadget don't remote wakeup. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: Remote wakeup functionality using gadgetfs.

2012-08-09 Thread Ming Lei
state. I remember that I added some test code to test the remote wakeup of g_ether before on musb_gadget, looks it can work. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: Do we need asynchronous pm_runtime_get()? (was: Re: bisected regression ...)

2012-08-09 Thread Ming Lei
, :-) Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Do we need asynchronous pm_runtime_get()? (was: Re: bisected regression ...)

2012-08-08 Thread Ming Lei
convert to use device_type to define release handler for its 'device class', instead of device object. So suggest to improve it. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info

Re: Do we need asynchronous pm_runtime_get()? (was: Re: bisected regression ...)

2012-08-07 Thread Ming Lei
by the runtime PM core. All the subsystems would have to be changed. Suppose .runtime_post_resume is introduced, the priority of dev_pm_info for .runtime_post_resume callback can be changed to adapt to the situation. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe

Re: Do we need asynchronous pm_runtime_get()? (was: Re: bisected regression ...)

2012-08-07 Thread Ming Lei
On Wed, Aug 8, 2012 at 4:45 AM, Rafael J. Wysocki r...@sisk.pl wrote: On Tuesday, August 07, 2012, Ming Lei wrote: On Tue, Aug 7, 2012 at 7:23 PM, Rafael J. Wysocki r...@sisk.pl wrote: Yes, I agree, but I don't think it may make .runtime_post_resume not doable, do I? No more device PM

Re: Do we need asynchronous pm_runtime_get()? (was: Re: bisected regression ...)

2012-08-06 Thread Ming Lei
in 'struct devices, since most of devices don't need the 'func' - well documents on 'runtime_pre_resume' - caller of pm_runtime_get_and_call may be happier, maybe just pm_runtime_get or *_aync is enough. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line

Re: Do we need asynchronous pm_runtime_get()? (was: Re: bisected regression ...)

2012-08-06 Thread Ming Lei
document benefit, even may simplify implementation of the mechanism. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Do we need asynchronous pm_runtime_get()? (was: Re: bisected regression ...)

2012-08-02 Thread Ming Lei
. (Although a device handling I/O requests isn't likely to have a child with its own independent I/O handling.) IMO, the .runtime_resume callback can handle the IO things easily via scheduling worker function if the driver don't want to delay its children's resume. Thanks, -- Ming Lei

Re: [RFC PATCH 00/13] firmware loader: introduce cache/uncache firmware

2012-07-25 Thread Ming Lei
); } while_each_thread(g, p); read_unlock(tasklist_lock); usermodehelper_enable(); + /* let kthread see usermodehelper enabled flag */ + thaw_kernel_threads(); + schedule(); printk(done.\n); } Thanks, -- Ming Lei -- To unsubscribe from this list: send the line

Re: [RFC PATCH 00/13] firmware loader: introduce cache/uncache firmware

2012-07-25 Thread Ming Lei
; pm_nosig_freezing = false; + /* +* User mode helper are available again (or will be, +* modulo scheduling) +*/ + usermodehelper_enable(); This may wake up tasks earlier than before, not sure if it might have side effects. Thanks, -- Ming Lei -- To unsubscribe

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-21 Thread Ming Lei
On Sat, Jul 21, 2012 at 5:56 PM, Rafael J. Wysocki r...@sisk.pl wrote: On Saturday, July 21, 2012, Ming Lei wrote: CC guys who discussed the problem in the below link in Jan. : http://marc.info/?t=13252895602r=10w=2 On Fri, Jul 20, 2012 at 8:33 PM, Ming Lei tom.leim...@gmail.com

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-21 Thread Ming Lei
Thanks for your so detailed comments. On Sun, Jul 22, 2012 at 1:31 AM, Linus Torvalds torva...@linux-foundation.org wrote: On Fri, Jul 20, 2012 at 5:33 AM, Ming Lei tom.leim...@gmail.com wrote: The RFC patch is just for discussing if the idea of deferring request_firmware is doable

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-21 Thread Ming Lei
On Sun, Jul 22, 2012 at 1:49 AM, Rafael J. Wysocki r...@sisk.pl wrote: On Friday, July 20, 2012, Ming Lei wrote: + if (system_state != SYSTEM_RUNNING) + return -EPROBE_DEFER; You can't just return here, _request_firmware_cleanup() has to be done still. Good catch, thanks

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-20 Thread Ming Lei
a new SYSTEM_SUSPEND state. So are you sure you really need it? If the approach is workable, I will rename SYSTEM_SUSPEND_DISK as SYSTEM_SUSPEND since SYSTEM_SUSPEND_DISK is not used now. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-20 Thread Ming Lei
SYSTEM_RUNNING during S2R or hibernation. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-20 Thread Ming Lei
requirement for the error handling of request_firmware, just like other failures' handling, undo things which has been done, isn't there? Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo

Re: [RFC] firmware load: defer request_firmware during early boot and resume

2012-07-20 Thread Ming Lei
CC guys who discussed the problem in the below link in Jan. : http://marc.info/?t=13252895602r=10w=2 On Fri, Jul 20, 2012 at 8:33 PM, Ming Lei tom.leim...@gmail.com wrote: The RFC patch is just for discussing if the idea of deferring request_firmware is doable for addressing

Re: [RFC PATCH] USB: enable power/wakeup to control remote wakeup in the runtime suspend

2012-07-19 Thread Ming Lei
, how about store the user setting things inside usb_device instance of the interfaces? Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

Re: [RFC PATCH] USB: enable power/wakeup to control remote wakeup in the runtime suspend

2012-07-19 Thread Ming Lei
the device will be disconnected and enumerate again. For this situation, firmware downloading is not a big problem since it happens in .probe path. But user space application will find the device changed. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb

Re: [PATCH 9/25] USB: EHCI: use hrtimer for the periodic schedule

2012-07-16 Thread Ming Lei
, TIMER_IO_WATCHDOG); } -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Thanks, -- Ming Lei -- To unsubscribe from this list: send the line

Re: [PATCH 12/25] USB: EHCI: use hrtimer for async schedule

2012-07-16 Thread Ming Lei
the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org

Re: [PATCH 14/25] USB: EHCI: use hrtimer for controller death

2012-07-16 Thread Ming Lei
*/ -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body

[PATCH] USB: ehci-omap: fix compile failure(v1)

2012-07-13 Thread Ming Lei
...@rowland.harvard.edu Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/host/ehci-omap.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 6133d93..ec21f4a 100644 --- a/drivers/usb/host/ehci

[PATCH -next] USB: ehci-omap: fix compile failure

2012-07-12 Thread Ming Lei
...@rowland.harvard.edu Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/host/ehci-omap.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 6133d93..4c43681 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers

Re: [PATCH -next] USB: ehci-omap: fix compile failure

2012-07-12 Thread Ming Lei
On Fri, Jul 13, 2012 at 11:54 AM, Ming Lei ming@canonical.com wrote: The omap_ehci_init() is introduced in the below commit: commit 1a49e2ac9651df7349867a5cf44e2c83de1046af(EHCI: centralize controller initialization) the local variable of 'pdev' inside omap_ehci_init

<    3   4   5   6   7   8