[RESEND 2/2] musb: fix dependency on transceiver driver

2013-01-04 Thread Ming Lei
'twl4030_usb' [ 19.263580] bus: 'platform': really_probe: bound device twl4030_usb to driver twl4030_usb Cc: Sebastian Andrzej Siewior sebast...@breakpoint.cc Cc: Felipe Balbi ba...@ti.com Cc: sta...@vger.kernel.org v3.8 Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/musb/am35x.c

[PATCH v7 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2013-01-04 Thread Ming Lei
r...@sisk.pl Signed-off-by: Minchan Kim minc...@kernel.org Signed-off-by: Ming Lei ming@canonical.com -- v7: - fix type of 'flags' in memalloc_noio_save()/memalloc_noio_restore() - rebase on v3.8-rc2-next-20130104 v6: - replace GFP_IO with __GFP_IO to fix compile failure

Re: [PATCHv2][RFC] smsc95xx: enable dynamic autosuspend

2012-12-14 Thread Ming Lei
/ethtool_ops is still set dynamically inside bind(). especially as this not protected by a lock. Looks lock isn't needed since probe/remove and open/close path can't be concurrent. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message

Re: [PATCH][RFC] smsc95xx: enable dynamic autosuspend (RFC)

2012-12-11 Thread Ming Lei
On Tue, Dec 11, 2012 at 6:27 PM, Oliver Neukum oli...@neukum.org wrote: On Tuesday 11 December 2012 10:24:57 Ming Lei wrote: On Mon, Dec 10, 2012 at 10:18 PM, Steve Glendinning st...@shawell.net wrote: Thanks, so something like this should do the job? This will do, but not simple

Re: [PATCH][RFC] smsc95xx: enable dynamic autosuspend (RFC)

2012-12-11 Thread Ming Lei
CC linux-power On Tue, Dec 11, 2012 at 11:19 PM, Oliver Neukum oli...@neukum.org wrote: On Tuesday 11 December 2012 20:53:19 Ming Lei wrote: In fact, I have test data which can show a much power save on OMAP3 based beagle board plus asix usbnet device with the periodic work. IMO, the power

Re: [PATCHv2][RFC] smsc95xx: enable dynamic autosuspend

2012-12-11 Thread Ming Lei
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 More majordomo info at http://vger.kernel.org/majordomo

Re: [PATCH][RFC] smsc95xx: enable dynamic autosuspend (RFC)

2012-12-10 Thread Ming Lei
On Mon, Dec 10, 2012 at 7:51 PM, Steve Glendinning steve.glendinn...@shawell.net wrote: This is a work in-progress patch. It's not yet complete but I thought I'd share it for comments, feedback and testing. This patch enables dynamic autosuspend for all devices supported by the driver, but

Re: [PATCH][RFC] smsc95xx: enable dynamic autosuspend (RFC)

2012-12-10 Thread Ming Lei
doesn't support USB autosuspend\n); if (on) usb_autopm_get_interface_no_resume(dev-intf); else usb_autopm_put_interface_no_suspend(dev-intf); return 0; } Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord

Re: [RFC PATCH 1/5] Device Power: introduce power controller

2012-12-06 Thread Ming Lei
external resources does a chip need ? For example, one indicator LED which doesn't connect to the same power domain might need to be triggered after the power switch state is changed. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message

Re: [RFC PATCH 1/5] Device Power: introduce power controller

2012-12-05 Thread Ming Lei
On Thu, Dec 6, 2012 at 12:49 AM, Roger Quadros rog...@ti.com wrote: On 12/03/2012 05:00 AM, Ming Lei wrote: On Mon, Dec 3, 2012 at 12:02 AM, Andy Green andy.gr...@linaro.org wrote: On 02/12/12 23:01, the mail apparently from Ming Lei included: Power controller is an abstract on simple power

Re: [RFC PATCH 4/5] arm: omap2: support port power on lan95xx devices

2012-12-03 Thread Ming Lei
be shared with more than one port, so it is better to introduce power domain to the problem. Looks generic_pm_domain is overkill, so I introduced power controller which only focuses on power on/off and being shared by multiple devices. Thanks, -- Ming Lei -- To unsubscribe from this list: send

[RFC PATCH 0/5] USB: prepare for support port power off on non-ACPI device

2012-12-02 Thread Ming Lei
/device.h | 13 include/linux/power_controller.h | 48 ++ include/linux/usb/port.h | 16 + kernel/power/Kconfig |6 ++ 10 files changed, 339 insertions(+), 42 deletions(-) Thanks, -- Ming Lei [1], http://marc.info/?t

[RFC PATCH 1/5] Device Power: introduce power controller

2012-12-02 Thread Ming Lei
...@sisk.pl Cc: Andy Green andy.gr...@linaro.org Cc: Roger Quadros rog...@ti.com Cc: Alan Stern st...@rowland.harvard.edu Cc: Felipe Balbi ba...@ti.com Signed-off-by: Ming Lei tom.leim...@gmail.com --- drivers/base/power/Makefile |1 + drivers/base/power/power_controller.c | 110

[RFC PATCH 2/5] driver core: introduce global device ADD/DEL notifier

2012-12-02 Thread Ming Lei
rog...@ti.com Cc: Alan Stern st...@rowland.harvard.edu Cc: Felipe Balbi ba...@ti.com Signed-off-by: Ming Lei tom.leim...@gmail.com --- drivers/base/core.c| 21 + include/linux/device.h | 13 + 2 files changed, 34 insertions(+) diff --git a/drivers/base

[RFC PATCH 3/5] USB: hub: apply power controller on usb port

2012-12-02 Thread Ming Lei
This patch applies the power controller on usb port, so that hub driver can power on one port which isn't provided power by bus. Cc: Andy Green andy.gr...@linaro.org Cc: Roger Quadros rog...@ti.com Cc: Alan Stern st...@rowland.harvard.edu Cc: Felipe Balbi ba...@ti.com Signed-off-by: Ming Lei

[RFC PATCH 4/5] arm: omap2: support port power on lan95xx devices

2012-12-02 Thread Ming Lei
Stern st...@rowland.harvard.edu Cc: Felipe Balbi ba...@ti.com Signed-off-by: Ming Lei tom.leim...@gmail.com --- arch/arm/mach-omap2/board-omap4panda.c | 99 +++- 1 file changed, 96 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap4panda.c b

[RFC PATCH 5/5] usb: omap ehci: remove all regulator control from ehci omap

2012-12-02 Thread Ming Lei
...@linaro.org Signed-off-by: Ming Lei tom.leim...@gmail.com --- drivers/usb/host/ehci-omap.c | 36 1 file changed, 36 deletions(-) diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index ac17a7c..d25e39e 100644 --- a/drivers/usb/host/ehci-omap.c

Re: [RFC PATCH 1/5] Device Power: introduce power controller

2012-12-02 Thread Ming Lei
On Mon, Dec 3, 2012 at 12:02 AM, Andy Green andy.gr...@linaro.org wrote: On 02/12/12 23:01, the mail apparently from Ming Lei included: Power controller is an abstract on simple power on/off switch. One power controller can bind to more than one device, which provides power logically

Re: [RFC PATCH 2/5] driver core: introduce global device ADD/DEL notifier

2012-12-02 Thread Ming Lei
On Mon, Dec 3, 2012 at 12:13 AM, Andy Green andy.gr...@linaro.org wrote: On 02/12/12 23:01, the mail apparently from Ming Lei included: The global device ADD/DEL notifier is introduced so that some platform code can bind some device resource to the device. When this platform code runs

Re: [RFC PATCH 4/5] arm: omap2: support port power on lan95xx devices

2012-12-02 Thread Ming Lei
On Mon, Dec 3, 2012 at 12:37 AM, Andy Green andy.gr...@linaro.org wrote: On 02/12/12 23:01, the mail apparently from Ming Lei included: Hi - This patch defines power controller for powering on/off LAN95xx USB hub and USB ethernet devices, and implements one match function to associate

Re: [PATCH v6 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-11-28 Thread Ming Lei
counter? and I will update with the above improvement you suggested. 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 v6 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-11-28 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: [RFC PATCH 1/5] drivers : introduce device_path api

2012-11-28 Thread Ming Lei
things? 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 PATCH 1/5] drivers : introduce device_path api

2012-11-27 Thread Ming Lei
On Wed, Nov 28, 2012 at 1:55 AM, Andy Green andy.gr...@linaro.org wrote: On 11/28/2012 01:22 AM, the mail apparently from Ming Lei included: On Wed, Nov 28, 2012 at 12:30 AM, Alan Stern st...@rowland.harvard.edu wrote: On Tue, 27 Nov 2012, Ming Lei wrote: IMO, all matches mean the devices

Re: [PATCH 1/2] USB: musb: fix failure path

2012-11-27 Thread Ming Lei
On Wed, Nov 28, 2012 at 1:23 AM, Greg Kroah-Hartman gre...@linuxfoundation.org wrote: On Tue, Nov 27, 2012 at 11:48:41AM +0800, Ming Lei wrote: Hi, On Thu, Nov 22, 2012 at 10:35 AM, Ming Lei ming@canonical.com wrote: In the fail1~fail5 failure path, pm_runtime_disable() should

Re: [RFC PATCH 1/5] drivers : introduce device_path api

2012-11-27 Thread Ming Lei
On Wed, Nov 28, 2012 at 7:06 AM, Ming Lei tom.leim...@gmail.com wrote: Also from my intuition, power domain should be involved in the problem, because these hard-wired and self-powered USB devices should have its own power domains, and the ehci-omap driver may enable/disable these power

Re: [PATCH v6 5/6] PM / Runtime: force memory allocation with no I/O during Runtime PM callbcack

2012-11-27 Thread Ming Lei
, -- 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 v6 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-11-27 Thread Ming Lei
On Wed, Nov 28, 2012 at 5:19 AM, Rafael J. Wysocki r...@sisk.pl wrote: On Saturday, November 24, 2012 08:59:14 PM Ming Lei wrote: The patch introduces the flag of memalloc_noio in 'struct dev_pm_info' to help PM core to teach mm not allocating memory with GFP_KERNEL flag for avoiding probable

Re: [PATCH v6 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-11-27 Thread Ming Lei
the whole path can't be avoided too, and may be a explicit walking or recursion, because pm_runtime_set_memalloc_noio is required to set or clear the flag(or increase/decrease the counter) of devices in the whole path. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux

Re: [RFC PATCH 1/5] drivers : introduce device_path api

2012-11-26 Thread Ming Lei
the specific ehci-omap usb bus inside ehci-omap driver. 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: musb: fix failure path

2012-11-26 Thread Ming Lei
Hi, On Thu, Nov 22, 2012 at 10:35 AM, Ming Lei ming@canonical.com wrote: In the fail1~fail5 failure path, pm_runtime_disable() should be called to avoid 'Unbalanced pm_runtime_enable' error in next probe() which may be triggered by defer probe or next 'modprobe musb_hdrc'. Greg/Felipe

[PATCH v6 0/6] solve deadlock caused by memory allocation with I/O

2012-11-24 Thread Ming Lei
|9 - mm/vmscan.c |4 +- net/core/net-sysfs.c |5 +++ 9 files changed, 154 insertions(+), 5 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

[PATCH v6 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-11-24 Thread Ming Lei
r...@sisk.pl Signed-off-by: Minchan Kim minc...@kernel.org Signed-off-by: Ming Lei ming@canonical.com --- v6: - replace GFP_IO with __GFP_IO to fix compile failure v5: - use inline instead of macro to define memalloc_noio_* - replace memalloc_noio

[PATCH v6 4/6] net/core: apply pm_runtime_set_memalloc_noio on network devices

2012-11-24 Thread Ming Lei
...@davemloft.net Cc: Eric Dumazet eric.duma...@gmail.com Cc: David Decotigny david.decoti...@google.com Cc: Tom Herbert therb...@google.com Cc: Ingo Molnar mi...@elte.hu Signed-off-by: Ming Lei ming@canonical.com --- v4: - call pm_runtime_set_memalloc_noio(ddev, true) after device_add

[PATCH v6 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-11-24 Thread Ming Lei
-by: Ming Lei ming@canonical.com --- v5: - fix code style error - add comment on clear the device memalloc_noio flag v4: - rename memalloc_noio_resume as memalloc_noio - remove pm_runtime_get_memalloc_noio() - add comments on pm_runtime_set_memalloc_noio v3

[PATCH v6 3/6] block/genhd.c: apply pm_runtime_set_memalloc_noio on block devices

2012-11-24 Thread Ming Lei
This patch applyes the introduced pm_runtime_set_memalloc_noio on block device so that PM core will teach mm to not allocate memory with GFP_IOFS when calling the runtime_resume and runtime_suspend callback for block devices and its ancestors. Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Ming

[PATCH v6 5/6] PM / Runtime: force memory allocation with no I/O during Runtime PM callbcack

2012-11-24 Thread Ming Lei
: Rafael J. Wysocki r...@sisk.pl Signed-off-by: Ming Lei ming@canonical.com --- v5: - use inline memalloc_noio_save() v4: - runtime_suspend need this too because rpm_resume may wait for completion of concurrent runtime_suspend, so deadlock still may be triggered

Re: doubt about usb_cancel_queued_reset()

2012-11-23 Thread Ming Lei
is to be unbound. 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 v1] USB: musb: defer probe if transceiver is not ready

2012-11-22 Thread Ming Lei
On Thu, Nov 22, 2012 at 12:51 AM, Sebastian Andrzej Siewior sebast...@breakpoint.cc wrote: On Wed, Nov 21, 2012 at 10:36:37PM +0800, Ming Lei wrote: On Wed, Nov 21, 2012 at 10:09 PM, Felipe Balbi ba...@ti.com wrote: status = musb_platform_init(musb); - if (status 0

[PATCH 1/2] USB: musb: fix failure path

2012-11-22 Thread Ming Lei
-by: Ming Lei ming@canonical.com --- drivers/usb/musb/musb_core.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 774d815..f3345d7 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1994,6

[PATCH] USB: musb: defer probe if transceiver is not ready

2012-11-21 Thread Ming Lei
' [ 19.263580] bus: 'platform': really_probe: bound device twl4030_usb to driver twl4030_usb Cc: Felipe Balbi ba...@ti.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/musb/musb_core.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_core.c b

Re: [PATCH] USB: musb: defer probe if transceiver is not ready

2012-11-21 Thread Ming Lei
On Wed, Nov 21, 2012 at 9:04 PM, Sebastian Andrzej Siewior sebast...@breakpoint.cc wrote: On Wed, Nov 21, 2012 at 08:39:27PM +0800, Ming Lei wrote: diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 774d815..ef57a60 100644 --- a/drivers/usb/musb/musb_core.c +++ b

[PATCH v1] USB: musb: defer probe if transceiver is not ready

2012-11-21 Thread Ming Lei
] bus: 'platform': really_probe: bound device twl4030_usb to driver twl4030_usb Cc: Sebastian Andrzej Siewior sebast...@breakpoint.cc Cc: Felipe Balbi ba...@ti.com Signed-off-by: Ming Lei ming@canonical.com --- V1: - return -EPROBE_DEFER only for -ENODEV case as pointed

Re: [PATCH v1] USB: musb: defer probe if transceiver is not ready

2012-11-21 Thread Ming Lei
); still wrong, what you should do is that when you can't get the phy, you set status to -EPROBE_DEFER, instead of -ENODEV. The above code does set status to to -EPROBE_DEFER when phy can't be got, doesn't it? Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb

[PATCH v5 0/6] solve deadlock caused by memory allocation with I/O

2012-11-11 Thread Ming Lei
/linux/pm_runtime.h |3 ++ include/linux/sched.h| 22 ++ mm/page_alloc.c |9 - mm/vmscan.c |4 +- net/core/net-sysfs.c |5 +++ 9 files changed, 154 insertions(+), 5 deletions(-) Thanks, -- Ming Lei -- To unsubscribe from

[PATCH v5 3/6] block/genhd.c: apply pm_runtime_set_memalloc_noio on block devices

2012-11-11 Thread Ming Lei
This patch applyes the introduced pm_runtime_set_memalloc_noio on block device so that PM core will teach mm to not allocate memory with GFP_IOFS when calling the runtime_resume and runtime_suspend callback for block devices and its ancestors. Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Ming

[PATCH v5 4/6] net/core: apply pm_runtime_set_memalloc_noio on network devices

2012-11-11 Thread Ming Lei
...@davemloft.net Cc: Eric Dumazet eric.duma...@gmail.com Cc: David Decotigny david.decoti...@google.com Cc: Tom Herbert therb...@google.com Cc: Ingo Molnar mi...@elte.hu Signed-off-by: Ming Lei ming@canonical.com --- v4: - call pm_runtime_set_memalloc_noio(ddev, true) after device_add

[PATCH v5 5/6] PM / Runtime: force memory allocation with no I/O during Runtime PM callbcack

2012-11-11 Thread Ming Lei
: Rafael J. Wysocki r...@sisk.pl Signed-off-by: Ming Lei ming@canonical.com --- v5: - use inline memalloc_noio_save() v4: - runtime_suspend need this too because rpm_resume may wait for completion of concurrent runtime_suspend, so deadlock still may be triggered

[PATCH v5 6/6] USB: forbid memory allocation with I/O during bus reset

2012-11-11 Thread Ming Lei
() and the storage interface can't do I/O transfer when the reset is triggered by other interface, or the error handling can't be completed if the reset is triggered by the storage itself(error handling path). Cc: Alan Stern st...@rowland.harvard.edu Cc: Oliver Neukum oneu...@suse.de Signed-off-by: Ming Lei ming

[PATCH v5 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-11-11 Thread Ming Lei
-by: Ming Lei ming@canonical.com --- v5: - fix code style error - add comment on clear the device memalloc_noio flag v4: - rename memalloc_noio_resume as memalloc_noio - remove pm_runtime_get_memalloc_noio() - add comments on pm_runtime_set_memalloc_noio v3

Re: [PATCH v3 3/5] usbnet: smsc95xx: fix memory leak in smsc95xx_suspend

2012-11-06 Thread Ming Lei
On Tue, Nov 6, 2012 at 9:20 PM, Steve Glendinning st...@shawell.net wrote: On 6 November 2012 01:45, Ming Lei ming@canonical.com wrote: This patch fixes memory leak in smsc95xx_suspend. Good spot, thanks! Note that check_warn_return just above your kfree can cause early return

Re: [PATCH v3 3/5] usbnet: smsc95xx: fix memory leak in smsc95xx_suspend

2012-11-06 Thread Ming Lei
packets'(SUSPEND3) is only supported by LAN9500A. Thanks, -- 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

[PATCH v4 1/5] usbnet: introduce usbnet_{read|write}_cmd_nopm

2012-11-06 Thread Ming Lei
by usbnet resume/suspend callback to avoid deadlock. Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/usbnet.c | 62 include/linux/usb/usbnet.h |4 +++ 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb

[PATCH v4 5/5] usbnet: runtime wake up device before calling usbnet_{read|write}_cmd

2012-11-06 Thread Ming Lei
This patch gets the runtime PM reference count before calling usbnet_{read|write}_cmd, and puts it after completion of the usbnet_{read|write}_cmd, so that the usb control message can always be sent to one active device in the non-PM context. Signed-off-by: Ming Lei ming@canonical.com

Re: [PATCH v4 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-11-06 Thread Ming Lei
didn't think about it too hard ;) Yes, we can do it by initializing 'shrink' local variable just after the branch, so one writing is enough. Will do it in -v5. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord

Re: [PATCH v4 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-11-06 Thread Ming Lei
(dev_hotplug_mutex); +} +EXPORT_SYMBOL_GPL(pm_runtime_set_memalloc_noio); 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 v4 0/6] solve deadlock caused by memory allocation with I/O

2012-11-06 Thread Ming Lei
On Wed, Nov 7, 2012 at 7:23 AM, Andrew Morton a...@linux-foundation.org wrote: It generally looks OK to me. I have a few comments and I expect to grab v5. Andrew, thanks for your review, and I will prepare -v5 later. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line

Re: [PATCH v4 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-11-06 Thread Ming Lei
)), .b = b1, }; which is a bit arcane but not t bad. Have a think about it... Got it, looks memalloc_noio_flags() neater, and I will take it in v5. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord

[PATCH v3 0/5] usbnet: avoiding access auto-suspended device

2012-11-05 Thread Ming Lei
+++ drivers/net/usb/usbnet.c | 74 -- include/linux/usb/usbnet.h |4 ++ 4 files changed, 257 insertions(+), 114 deletions(-) Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message

[PATCH v3 1/5] usbnet: introduce usbnet_{read|write}_cmd_nopm

2012-11-05 Thread Ming Lei
by usbnet resume/suspend callback to avoid deadlock. Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/usbnet.c | 62 include/linux/usb/usbnet.h |4 +++ 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb

[PATCH v3 2/5] usbnet: smsc75xx: apply the introduced usbnet_{read|write}_cmd_nopm

2012-11-05 Thread Ming Lei
This patch applies the introduced usbnet_read_cmd_nopm() and usbnet_write_cmd_nopm() in the callback of resume and suspend to avoid deadlock if USB runtime PM is considered into usbnet_read_cmd() and usbnet_write_cmd(). Cc: Steve Glendinning steve.glendinn...@shawell.net Signed-off-by: Ming Lei

[PATCH v3 3/5] usbnet: smsc95xx: fix memory leak in smsc95xx_suspend

2012-11-05 Thread Ming Lei
This patch fixes memory leak in smsc95xx_suspend. Also, it isn't necessary to bother mm to allocate 8bytes/16byte, and we can use stack variable safely. Cc: Steve Glendinning steve.glendinn...@shawell.net Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/smsc95xx.c | 12

[PATCH v3 4/5] usbnet: smsc95xx: apply the introduced usbnet_{read|write}_cmd_nopm

2012-11-05 Thread Ming Lei
This patch applies the introduced usbnet_read_cmd_nopm() and usbnet_write_cmd_nopm() in the callback of resume and suspend to avoid deadlock if USB runtime PM is considered into usbnet_read_cmd() and usbnet_write_cmd(). Cc: Steve Glendinning steve.glendinn...@shawell.net Signed-off-by: Ming Lei

[PATCH v3 5/5] usbnet: runtime wake up device before calling usbnet_{read|write}_cmd

2012-11-05 Thread Ming Lei
This patch gets the runtime PM reference count before calling usbnet_{read|write}_cmd, and puts it after completion of the usbnet_{read|write}_cmd, so that the usb control message can always be sent to one active device in the non-PM context. Signed-off-by: Ming Lei ming@canonical.com

Re: [PATCH v1 0/5] usbnet: avoiding access auto-suspended device

2012-11-05 Thread Ming Lei
incorporated. The comment is just about commit log and code style, and I have fixed that in V3. 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

[PATCH v2 0/5] usbnet: avoiding access auto-suspended device

2012-11-04 Thread Ming Lei
-- include/linux/usb/usbnet.h |4 ++ 4 files changed, 255 insertions(+), 114 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

[PATCH v2 1/5] usbnet: introduce usbnet_read[write]_cmd_nopm

2012-11-04 Thread Ming Lei
by usbnet resume/suspend callback to avoid deadlock. Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/usbnet.c | 62 include/linux/usb/usbnet.h |4 +++ 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb

[PATCH v2 2/5] usbnet: smsc75xx: apply the introduced usbnet_read[write]_cmd_nopm

2012-11-04 Thread Ming Lei
This patch applies the introduced usbnet_read_cmd_nopm() and usbnet_write_cmd_nopm() in the callback of resume and suspend to avoid deadlock if USB runtime PM is considered into usbnet_read_cmd() and usbnet_write_cmd(). Cc: Steve Glendinning steve.glendinn...@shawell.net Signed-off-by: Ming Lei

[PATCH v2 3/5] usbnet: smsc95xx: fix memory leak in smsc95xx_suspend

2012-11-04 Thread Ming Lei
This patch fixes memory leak in smsc95xx_suspend. Also, it isn't necessary to bother mm to allocate 8bytes/16byte, and we can use stack variable safely. Cc: Steve Glendinning steve.glendinn...@shawell.net Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/smsc95xx.c | 12

[PATCH v2 4/5] usbnet: smsc95xx: apply the introduced usbnet_read[write]_cmd_nopm

2012-11-04 Thread Ming Lei
This patch applies the introduced usbnet_read_cmd_nopm() and usbnet_write_cmd_nopm() in the callback of resume and suspend to avoid deadlock if USB runtime PM is considered into usbnet_read_cmd() and usbnet_write_cmd(). Cc: Steve Glendinning steve.glendinn...@shawell.net Signed-off-by: Ming Lei

[PATCH v2 5/5] usbnet: make device out of suspend before calling usbnet_read[write]_cmd

2012-11-04 Thread Ming Lei
This patche gets the runtime PM reference count before calling usbnet_read[write]_cmd, and puts it after completion of the usbnet_read[write]_cmd, so that the usb control message can always be sent to one active device in the non-PM context. Signed-off-by: Ming Lei ming@canonical.com

Re: [PATCH v1 2/5] usbnet: smsc75xx: apply the introduced usbnet_read[write]_cmd_nopm

2012-11-04 Thread Ming Lei
On Sun, Nov 4, 2012 at 1:58 PM, David Miller da...@davemloft.net wrote: This gets rejects, you didn't have your net-next tree uptodate enough. Sorry, I just rebased that on 3.7.0-rc3-next-20121102. The new patchset which is against the latest net-next has been sent out. Thanks, -- Ming Lei

Re: USB issue with kernel 3.6

2012-11-04 Thread Ming Lei
might try on a different PC, with a vanilla kernel, not sure... Upstream kernel should run on Fedora distribution directly after you compile and install it. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord

[PATCH v4 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-11-03 Thread Ming Lei
...@sisk.pl Signed-off-by: Minchan Kim minc...@kernel.org Signed-off-by: Ming Lei ming@canonical.com --- v4: - fix comment v3: - no change v2: - remove changes on 'may_writepage' and 'may_swap' because that isn't related with the patchset, and can't introduce I/O

[PATCH v4 3/6] block/genhd.c: apply pm_runtime_set_memalloc_noio on block devices

2012-11-03 Thread Ming Lei
This patch applyes the introduced pm_runtime_set_memalloc_noio on block device so that PM core will teach mm to not allocate memory with GFP_IOFS when calling the runtime_resume and runtime_suspend callback for block devices and its ancestors. Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Ming

[PATCH v4 4/6] net/core: apply pm_runtime_set_memalloc_noio on network devices

2012-11-03 Thread Ming Lei
...@davemloft.net Cc: Eric Dumazet eric.duma...@gmail.com Cc: David Decotigny david.decoti...@google.com Cc: Tom Herbert therb...@google.com Cc: Ingo Molnar mi...@elte.hu Signed-off-by: Ming Lei ming@canonical.com --- v4: - call pm_runtime_set_memalloc_noio(ddev, true) after device_add

[PATCH v4 5/6] PM / Runtime: force memory allocation with no I/O during Runtime PM callbcack

2012-11-03 Thread Ming Lei
: Rafael J. Wysocki r...@sisk.pl Signed-off-by: Ming Lei ming@canonical.com --- v4: - runtime_suspend need this too because rpm_resume may wait for completion of concurrent runtime_suspend, so deadlock still may be triggered in runtime_suspend path. --- drivers/base/power

[PATCH v4 6/6] USB: forbid memory allocation with I/O during bus reset

2012-11-03 Thread Ming Lei
() and the storage interface can't do I/O transfer when the reset is triggered by other interface, or the error handling can't be completed if the reset is triggered by the storage itself(error handling path). Cc: Alan Stern st...@rowland.harvard.edu Cc: Oliver Neukum oneu...@suse.de Signed-off-by: Ming Lei ming

[PATCH v4 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-11-03 Thread Ming Lei
-by: Ming Lei ming@canonical.com --- v4: - rename memalloc_noio_resume as memalloc_noio - remove pm_runtime_get_memalloc_noio() - add comments on pm_runtime_set_memalloc_noio v3: - introduce pm_runtime_get_memalloc_noio() - hold one global lock

[PATCH v4 0/6] solve deadlock caused by memory allocation with I/O

2012-11-03 Thread Ming Lei
/vmscan.c | 12 ++ net/core/net-sysfs.c |5 +++ 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

[PATCH v1 0/5] usbnet: avoiding access auto-suspended device

2012-11-03 Thread Ming Lei
insertions(+), 107 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

[PATCH v1 1/5] usbnet: introduce usbnet_read[write]_cmd_nopm

2012-11-03 Thread Ming Lei
by usbnet resume/suspend callback to avoid deadlock. Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/usbnet.c | 62 include/linux/usb/usbnet.h |4 +++ 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb

[PATCH v1 2/5] usbnet: smsc75xx: apply the introduced usbnet_read[write]_cmd_nopm

2012-11-03 Thread Ming Lei
This patch applies the introduced usbnet_read_cmd_nopm() and usbnet_write_cmd_nopm() in the callback of resume and suspend to avoid deadlock if USB runtime PM is considered into usbnet_read_cmd() and usbnet_write_cmd(). Cc: Steve Glendinning steve.glendinn...@shawell.net Signed-off-by: Ming Lei

[PATCH v1 3/5] usbnet: smsc95xx: fix memory leak in smsc95xx_suspend

2012-11-03 Thread Ming Lei
This patch fixes memory leak in smsc95xx_suspend. Also, it isn't necessary to bother mm to allocate 8bytes/16byte, and we can use stack variable safely. Cc: Steve Glendinning steve.glendinn...@shawell.net Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/smsc95xx.c | 12

[PATCH v1 4/5] usbnet: smsc95xx: apply the introduced usbnet_read[write]_cmd_nopm

2012-11-03 Thread Ming Lei
This patch applies the introduced usbnet_read_cmd_nopm() and usbnet_write_cmd_nopm() in the callback of resume and suspend to avoid deadlock if USB runtime PM is considered into usbnet_read_cmd() and usbnet_write_cmd(). Cc: Steve Glendinning steve.glendinn...@shawell.net Signed-off-by: Ming Lei

[PATCH v1 5/5] usbnet: make device out of suspend before calling usbnet_read[write]_cmd

2012-11-03 Thread Ming Lei
This patche gets the runtime PM reference count before calling usbnet_read[write]_cmd, and puts it after completion of the usbnet_read[write]_cmd, so that the usb control message can always be sent to one active device in the non-PM context. Signed-off-by: Ming Lei ming@canonical.com

Re: [PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-30 Thread Ming Lei
the disk into device model via register_disk(), the solution should be fine. 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: host to host usb transfer

2012-10-30 Thread Ming Lei
or rndis ether gadget, which will be recognized as ethernet interface without other software involved. 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

Re: [PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-30 Thread Ming Lei
during resets. That would also help with the race described above. I have thought about this. IMO, pm_runtime_get_memalloc_noio should return true always if CONFIG_PM_RUNTIME is unset. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body

Re: [PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-30 Thread Ming Lei
On Wed, Oct 31, 2012 at 12:00 AM, Ming Lei ming@canonical.com wrote: Looks the simplest approach is to handle the noio flag thing at the start and end of rpm_resume. Sorry, that doesn't work, runtime_suspend need that too because memory allocation with block I/O might deadlock when doing I

[PATCH 3/4] usbnet: smsc95xx: apply the introduced usbnet_read[write]_cmd_nopm

2012-10-29 Thread Ming Lei
This patch applies the introduced usbnet_read_cmd_nopm() and usbnet_write_cmd_nopm() in the callback of resume and suspend to avoid deadlock if USB runtime PM is considered into usbnet_read_cmd() and usbnet_write_cmd(). Cc: Steve Glendinning steve.glendinn...@shawell.net Signed-off-by: Ming Lei

[PATCH 4/4] usbnet: make device out of suspend before calling usbnet_read[write]_cmd

2012-10-29 Thread Ming Lei
This patche gets the runtime PM reference count before calling usbnet_read[write]_cmd, and puts it after completion of the usbnet_read[write]_cmd, so that the usb control message can always be sent to one active device in the non-PM context. Signed-off-by: Ming Lei ming@canonical.com

[PATCH v3 0/6] solve deadlock caused by memory allocation with I/O

2012-10-29 Thread Ming Lei
+++ include/linux/sched.h| 10 + mm/page_alloc.c | 10 - mm/vmscan.c | 12 ++ net/core/net-sysfs.c |5 +++ 9 files changed, 152 insertions(+), 2 deletions(-) Thanks, -- Ming Lei -- To unsubscribe from this list: send the line

[PATCH v3 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-10-29 Thread Ming Lei
: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com Cc: Michal Hocko mho...@suse.cz Cc: Ingo Molnar mi...@redhat.com Cc: Peter Zijlstra pet...@infradead.org Cc: Rafael J. Wysocki r...@sisk.pl Signed-off-by: Minchan Kim minc...@kernel.org Signed-off-by: Ming Lei ming@canonical.com --- v3

[PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-29 Thread Ming Lei
device's error handling path (for example, usb device reset) Cc: Alan Stern st...@rowland.harvard.edu Cc: Rafael J. Wysocki r...@sisk.pl Signed-off-by: Ming Lei ming@canonical.com --- v3: - introduce pm_runtime_get_memalloc_noio() - hold one global lock

[PATCH v3 4/6] net/core: apply pm_runtime_set_memalloc_noio on network devices

2012-10-29 Thread Ming Lei
Dumazet eric.duma...@gmail.com Cc: David Decotigny david.decoti...@google.com Cc: Tom Herbert therb...@google.com Cc: Ingo Molnar mi...@elte.hu Signed-off-by: Ming Lei ming@canonical.com --- net/core/net-sysfs.c |5 + 1 file changed, 5 insertions(+) diff --git a/net/core/net-sysfs.c b

[PATCH v3 5/6] PM / Runtime: force memory allocation with no I/O during runtime_resume callbcack

2012-10-29 Thread Ming Lei
. Wysocki r...@sisk.pl Signed-off-by: Ming Lei ming@canonical.com --- drivers/base/power/runtime.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 9fa6ea7..c9e26b9 100644 --- a/drivers/base/power

[PATCH v3 6/6] USB: forbid memory allocation with I/O during bus reset

2012-10-29 Thread Ming Lei
() and the storage interface can't do I/O transfer when the reset is triggered by other interface, or the error handling can't be completed if the reset is triggered by the storage itself(error handling path). Cc: Alan Stern st...@rowland.harvard.edu Cc: Oliver Neukum oneu...@suse.de Signed-off-by: Ming Lei ming

Re: host to host usb transfer

2012-10-29 Thread Ming Lei
which both usb hosts can recognize the 'cable' as one usbnet device, see below link: http://www.virtualblueness.net/USB-guide-1.0.10/x573.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: host to host usb transfer

2012-10-29 Thread Ming Lei
.c Maybe others can be supported by usbnet kernel driver too. 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

<    1   2   3   4   5   6   7   8   >