[Resend PATCH v4 10/10] usb: add usb_device_allow_power_off() and usb_device_prevent_power_off() function.

2013-01-11 Thread Lan Tianyu
will not be powered off. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/port.c | 28 include/linux/usb.h | 12 2 files changed, 40 insertions(+) diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index a44523e..1b1c95e 100644

[Resend PATCH v4 09/10] usb: expose usb port's pm qos flags to user space

2013-01-11 Thread Lan Tianyu
This patch is to expose usb port's pm qos flags(pm_qos_no_power_off, pm_qos_remote_wakeup) to user space. User can set pm_qos_no_power_off flag to prohibit the port from being powered off. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/port.c | 11 ++- 1 file

Re: [PATCH 1/3] usb: add find_raw_port_number callback to struct hc_driver()

2013-01-10 Thread Lan Tianyu
于 2013/1/10 23:14, Alan Stern 写道: On Thu, 10 Jan 2013, Lan Tianyu wrote: xhci driver divides the root hub into two logical hubs which work respectively for usb 2.0 and usb 3.0 devices. They are independent devices in the usb core. But in the ACPI table, it's one device node and all usb2.0

[PATCH v4 06/10] usb: add runtime pm support for usb port device

2013-01-09 Thread Lan Tianyu
it is active. Acked-by: Rafael J. Wysocki rafael.j.wyso...@intel.com Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 18 ++ drivers/usb/core/hub.h |4 drivers/usb/core/port.c | 43 +++ 3 files changed, 65

[PATCH v4 08/10] usb: expose usb port's pm qos flags to user space

2013-01-09 Thread Lan Tianyu
This patch is to expose usb port's pm qos flags(pm_qos_no_power_off, pm_qos_remote_wakeup) to user space. User can set pm_qos_no_power_off flag to prohibit the port from being powered off. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/port.c | 11 ++- 1 file

[PATCH v4 09/10] usb: add usb_device_allow_power_off() and usb_device_prevent_power_off() function.

2013-01-09 Thread Lan Tianyu
will not be powered off. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/port.c | 28 include/linux/usb.h | 12 2 files changed, 40 insertions(+) diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index 6bb5b2b..df9fd4e 100644

[PATCH v4 02/10] USB: Set usb port's DeviceRemovable according acpi information

2013-01-09 Thread Lan Tianyu
ACPI information and this also works for non-root hub. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hcd.c |4 drivers/usb/core/hub.c | 48 drivers/usb/core/usb.h |3 +++ 3 files changed, 55 insertions(+) diff

[PATCH v4 07/10] usb: add usb port auto power off mechanism

2013-01-09 Thread Lan Tianyu
clear and persist enable. When it resumes, power on port again. Add did_runtime_put in the struct usb_port in order to call pm_runtime_get/put(portdev) paired during suspending and resuming. Acked-by: Rafael J. Wysocki rafael.j.wyso...@intel.com Signed-off-by: Lan Tianyu tianyu@intel.com

[PATCH v4 10/10] PM/Qos: Expose dev_pm_qos_flags symbol

2013-01-09 Thread Lan Tianyu
The dev_pm_qos_flags() will be used in the usb core which could be compiled as a module. This patch is to epose it. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/base/power/qos.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/power/qos.c b/drivers/base/power

Re: [PATCH v4 10/10] PM/Qos: Expose dev_pm_qos_flags symbol

2013-01-09 Thread Lan Tianyu
On 2013年01月09日 20:52, Sergei Shtylyov wrote: Hello. On 09-01-2013 12:45, Lan Tianyu wrote: The dev_pm_qos_flags() will be used in the usb core which could be compiled as a module. This patch is to epose it. ^ Either expose or export

Re: [PATCH v4 10/10] PM/Qos: Expose dev_pm_qos_flags symbol

2013-01-09 Thread Lan Tianyu
On 2013年01月09日 23:02, Alan Stern wrote: On Wed, 9 Jan 2013, Lan Tianyu wrote: The dev_pm_qos_flags() will be used in the usb core which could be compiled as a module. This patch is to epose it. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/base/power/qos.c |1 + 1 file

[PATCH 1/3] usb: add find_raw_port_number callback to struct hc_driver()

2013-01-09 Thread Lan Tianyu
port number which is reflected in the xhci extended capabilities table. This patch is to add find_raw_port_number callback to struct hc_driver() and fill it with xhci_find_raw_port_number(). Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hcd.c |9 + drivers

[PATCH 2/3] usb/acpi: binding xhci root hub usb port with ACPI

2013-01-09 Thread Lan Tianyu
extended capabilities table before binding. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/usb-acpi.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c index cef4252..40f5a6a 100644 --- a/drivers/usb/core/usb

[PATCH v4 01/10] usb: Add driver/usb/core/(port.c,hub.h) files

2013-01-09 Thread Lan Tianyu
This patch is to create driver/usb/core/(port.c,hub.h) files and move usb port related code into port.c. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/Makefile |1 + drivers/usb/core/hub.c| 107 + drivers/usb/core/hub.h

[PATCH v4 03/10] usb: Add portX/connect_type attribute to expose usb port's connect type

2013-01-09 Thread Lan Tianyu
Some platforms provide usb port connect types through ACPI. This patch is to add this new attribute to expose these information to user space. Signed-off-by: Lan Tianyu tianyu@intel.com --- Documentation/ABI/testing/sysfs-bus-usb |9 +++ drivers/usb/core/port.c | 43

[PATCH v4 04/10] usb: Create link files between child device and usb port device.

2013-01-09 Thread Lan Tianyu
To show the relationship between usb port and child device, add link file port under usb device's sysfs directoy and device under usb port device's sysfs directory. They are linked to each other. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 26

[PATCH V4 0/10] usb: usb port power off mechanism anc expose usb port connect type

2013-01-09 Thread Lan Tianyu
Change since v1: optimize the export connect type patch and adjust the DeviceRemovalbe flag in the rh_call_control() after GetHubDescriptor request being processed. move all debounce operation to usb port's runtime resume callback(). Add did_runtime_put in the struct usb_port to

[PATCH v4 05/10] usb: Register usb port's acpi power resources

2013-01-09 Thread Lan Tianyu
This patch is to register usb port's acpi power resources. Create link between usb port device and its acpi power resource. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/port.c |3 +++ drivers/usb/core/usb-acpi.c | 20 drivers/usb/core/usb.h

Re: [PATCH v3 8/9] usb: expose usb port's pm qos flags to user space

2013-01-08 Thread Lan Tianyu
On 2013年01月08日 23:16, Alan Stern wrote: On Tue, 8 Jan 2013, Lan Tianyu wrote: On 2013年01月08日 02:44, Alan Stern wrote: On Sun, 6 Jan 2013, Lan Tianyu wrote: This patch is to expose usb port's pm qos flags(pm_qos_no_power_off, pm_qos_remote_wakeup) to user space. User can set

[PATCH v3 8/9] usb: expose usb port's pm qos flags to user space

2013-01-06 Thread Lan Tianyu
This patch is to expose usb port's pm qos flags(pm_qos_no_power_off, pm_qos_remote_wakeup) to user space. User can set pm_qos_no_power_off flag to prohibit the port from being power off. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/port.c |9 +++-- 1 file changed

Re: [PATCH v3 9/9] usb: add usb_device_allow_power_off() and usb_device_prevent_power_off() function.

2013-01-06 Thread Lan Tianyu
On 2013年01月06日 23:16, Sergei Shtylyov wrote: Hello. On 06-01-2013 12:29, Lan Tianyu wrote: Some usb devices can't be resumed correctly after power off. This patch is to add usb_device_allow_power_off() and usb_device_prevent_power_off() for device's driver to allow or prohibit device

[PATCH V2 0/9] usb: usb port power off mechanism anc expose usb port connect type

2013-01-04 Thread Lan Tianyu
Change since v1: optimize the export connect type patch and adjust the DeviceRemovalbe flag in the rh_call_control() after GetHubDescriptor request being processed. move all debounce operation to usb port's runtime resume callback(). Add did_runtime_put in the struct usb_port to

[PATCH v2 1/9] usb: Add driver/usb/core/(port.c,hub.h) files

2013-01-04 Thread Lan Tianyu
This patch is to create driver/usb/core/(port.c,hub.h) files and move usb port related code into port.c. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/Makefile |1 + drivers/usb/core/hub.c| 107 + drivers/usb/core/hub.h

[PATCH v2 2/9] USB: Set usb port's DeviceRemovable according acpi information

2013-01-04 Thread Lan Tianyu
ACPI information and this also works for non-root hub. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hcd.c |4 drivers/usb/core/hub.c | 48 drivers/usb/core/usb.h |3 +++ 3 files changed, 55 insertions(+) diff

[PATCH v2 3/9] usb: Add portX/connect_type attribute to expose usb port's connect type

2013-01-04 Thread Lan Tianyu
Some platforms provide usb port connect types through ACPI. This patch is to add this new attribute to expose these information to user space. Signed-off-by: Lan Tianyu tianyu@intel.com --- Documentation/ABI/testing/sysfs-bus-usb |9 +++ drivers/usb/core/port.c | 43

[PATCH v2 4/9] usb: Create link files between child device and usb port device.

2013-01-04 Thread Lan Tianyu
To show the relationship between usb port and child device, add link file port under usb device's sysfs directoy and device under usb port device's sysfs directory. They are linked to each other. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 26

[PATCH v2 5/9] usb: Register usb port's acpi power resources

2013-01-04 Thread Lan Tianyu
This patch is to register usb port's acpi power resources. Create link between usb port device and its acpi power resource. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/port.c |3 +++ drivers/usb/core/usb-acpi.c | 20 drivers/usb/core/usb.h

[PATCH v2 6/9] usb: add runtime pm support for usb port device

2013-01-04 Thread Lan Tianyu
it is active. Acked-by: Rafael J. Wysocki rafael.j.wyso...@intel.com Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 18 ++ drivers/usb/core/hub.h |4 drivers/usb/core/port.c | 37 + 3 files changed, 59 insertions

[PATCH v2 7/9] usb: add usb port auto power off mechanism

2013-01-04 Thread Lan Tianyu
clear and persist enable. When it resumes, power on port again. Add did_runtime_put in the struct usb_port in order to call pm_runtime_get/put(portdev) paired during suspending and resuming. Acked-by: Rafael J. Wysocki rafael.j.wyso...@intel.com Signed-off-by: Lan Tianyu tianyu@intel.com

[PATCH v2 8/9] usb: expose usb port's pm qos flags to user space

2013-01-04 Thread Lan Tianyu
This patch is to expose usb port's pm qos flags(pm_qos_no_power_off, pm_qos_remote_wakeup) to user space. User can set pm_qos_no_power_off flag to prohibit the port from being power off. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/port.c |9 +++-- 1 file changed

[PATCH v2 9/9] usb: add usb_device_allow_power_off() function.

2013-01-04 Thread Lan Tianyu
is to add usb_device_allow_power_off() for device's driver to allow or prohibit device to be power off the device. Call pm_runtime_get_sync(portdev) to increase port's usage count and then port will not be suspended. The device will not be power off. Signed-off-by: Lan Tianyu tianyu@intel.com

[PATCH v2 Resend 9/9] usb: add usb_device_allow_power_off() function.

2013-01-04 Thread Lan Tianyu
. The device will not be power off. Signed-off-by: Lan Tianyu tianyu@intel.com --- Sorry, correct format issue. --- drivers/usb/core/hub.c | 28 include/linux/usb.h|1 + 2 files changed, 29 insertions(+) diff --git a/drivers/usb/core/hub.c b/drivers/usb

Re: [PATCH 08/10] usb: add usb port auto power off mechanism

2012-12-20 Thread Lan Tianyu
On 2012年12月19日 23:39, Alan Stern wrote: On Wed, 19 Dec 2012, lantianyu wrote: I just find busy_bits is set or clear in the usb_port_resume() and usb_reset_and_verify_device(). So currently we should keep my changes mutually exclusive with them, right? Don't forget about what happens when a

Re: Bug#677472: [3.1-3.2 regression] Immediate wake on suspend, associated with OHCI on MCP51

2012-12-18 Thread Lan Tianyu
On 2012年12月18日 04:06, Alan Stern wrote: On Mon, 17 Dec 2012, Octavio Alvarez wrote: On Thu, 13 Dec 2012 00:45:05 -0800, Lan Tianyu tianyu@intel.com wrote: diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index f034716..9335f1b 100644 --- a/drivers/usb/core/hcd.c +++ b

Re: [PATCH 08/10] usb: add usb port auto power off mechanism

2012-12-14 Thread Lan Tianyu
On 2012年12月12日 23:56, Alan Stern wrote: On Wed, 12 Dec 2012, Lan Tianyu wrote: I tested a usb ssd which consumes about 1s to makes usb port status enter into connect status after powering off and powering on the port. So I set the tries 20 and the longest latency is larger than 2s

Re: Bug#677472: [3.1-3.2 regression] Immediate wake on suspend, associated with OHCI on MCP51

2012-12-13 Thread Lan Tianyu
On 2012年12月13日 04:28, Frank Schäfer wrote: Am 12.12.2012 09:23, schrieb Lan Tianyu: On 2012年12月12日 05:59, Frank Schäfer wrote: Am 11.12.2012 17:48, schrieb Alan Stern: [snip] We really need to know which component is bad: the host controller or the device. It happens with all USB 1.1

Re: Bug#677472: [3.1-3.2 regression] Immediate wake on suspend, associated with OHCI on MCP51

2012-12-13 Thread Lan Tianyu
On 2012年12月13日 23:47, Alan Stern wrote: On Thu, 13 Dec 2012, Frank Schäfer wrote: I write a quirk patch. Can you test? Yes, that makes it work ! I just find one MCP51 and two MCP79 OHCI id. Can you provide more buggy hcd id via lspci -nnvvv? Thanks. I have the MCP61 (rev. A2) with id

Re: Bug#677472: [3.1-3.2 regression] Immediate wake on suspend, associated with OHCI on MCP51

2012-12-13 Thread Lan Tianyu
On 2012年12月13日 23:35, Frank Schäfer wrote: Am 13.12.2012 09:45, schrieb Lan Tianyu: [snip] I am curious about whether disabling usb device's wakeup rather than usb hc's would make suspend work. Can you do a test? Go to /sys/bus/usb/devices/ and enter the usb 1,1 device directory(normally

Re: Bug#677472: [3.1-3.2 regression] Immediate wake on suspend, associated with OHCI on MCP51

2012-12-12 Thread Lan Tianyu
On 2012年12月12日 05:59, Frank Schäfer wrote: Am 11.12.2012 17:48, schrieb Alan Stern: [snip] We really need to know which component is bad: the host controller or the device. It happens with all USB 1.1 devices I have (several mice and a HP Deskjet 960c printer). The same devices do not

Re: [PATCH 08/10] usb: add usb port auto power off mechanism

2012-12-12 Thread Lan Tianyu
On 2012年12月12日 00:35, Alan Stern wrote: On Tue, 11 Dec 2012, Lan Tianyu wrote: @@ -108,11 +109,14 @@ MODULE_PARM_DESC(use_both_schemes, DECLARE_RWSEM(ehci_cf_port_reset_rwsem); EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem); +#define HUB_PORT_RECONNECT_TRIES 20 20 is an awful lot. Do

Re: Bug#677472: [3.1-3.2 regression] Immediate wake on suspend, associated with OHCI on MCP51

2012-12-12 Thread Lan Tianyu
On 2012年12月12日 23:50, Alan Stern wrote: On Wed, 12 Dec 2012, Lan Tianyu wrote: Hi Alan: About your question of Does the device send a remote wakeup request even when it is disabled for remote wakeup?, I am not very clear. Default, device remote wakeup is disabled and if we disable

Expose port sequence in the xhci extended capabilities table to usb core.

2012-12-10 Thread Lan Tianyu
Hi AlanGreg: We meet a problem that bind usb3.0 port(supper-speed port) with ACPI. The main problem is that the port index num of ss port in the usb ocre is mismatched with its counterpart in the ACPI table. The xhci usb3.0 root hub port's index num is based on 0 in the usb

Re: [PATCH 08/10] usb: add usb port auto power off mechanism

2012-12-10 Thread Lan Tianyu
On 2012年12月11日 00:53, Alan Stern wrote: On Mon, 10 Dec 2012, Lan Tianyu wrote: Hi Alan: I write a patch based on the needs_debounce flag. The flag will be set when port has child device and power on successfully. Otherwise, I separate resume port and wait for connect

Re: Expose port sequence in the xhci extended capabilities table to usb core.

2012-12-10 Thread Lan Tianyu
On 2012年12月11日 03:45, Sarah Sharp wrote: On Mon, Dec 10, 2012 at 02:43:25PM -0500, Alan Stern wrote: On Mon, 10 Dec 2012, Sarah Sharp wrote: Do you think we will ever need to do the mapping in the other direction? Meaning the xHCI driver would need to know which ACPI method was attached

Re: Expose port sequence in the xhci extended capabilities table to usb core.

2012-12-10 Thread Lan Tianyu
On 2012年12月11日 01:59, Sarah Sharp wrote: On Mon, Dec 10, 2012 at 11:29:38AM -0500, Alan Stern wrote: On Mon, 10 Dec 2012, Lan Tianyu wrote: Hi AlanGreg: We meet a problem that bind usb3.0 port(supper-speed port) with ACPI. The main problem is that the port index num of ss port in the usb

Re: [PATCH 08/10] usb: add usb port auto power off mechanism

2012-12-09 Thread Lan Tianyu
On 2012年12月07日 23:22, Alan Stern wrote: On Fri, 7 Dec 2012, Lan Tianyu wrote: Maybe you really need two flags. Do whatever is best; I'm sure you can figure out a good scheme. Yeah. Two flags maybe good. In this situation, it should be call power_is_on, right? power_is_on can be used

Re: [PATCH 08/10] usb: add usb port auto power off mechanism

2012-12-05 Thread Lan Tianyu
On 2012年11月29日 03:37, Alan Stern wrote: On Sat, 17 Nov 2012, Lan Tianyu wrote: This patch is to add usb port auto power off mechanism. When usb device is suspending, usb core will suspend usb port and usb port runtime pm callback will clear PORT_POWER feature to power off port if all

Re: [PATCH 01/10] USB: Set usb port's DeviceRemovable according acpi information in EHCI

2012-12-05 Thread Lan Tianyu
On 2012年12月05日 23:58, Alan Stern wrote: On Wed, 5 Dec 2012, Lan Tianyu wrote: Hi Alan: how about following patch? Index: usb/drivers/usb/core/hub.c === --- usb.orig/drivers/usb/core/hub.c +++ usb/drivers/usb/core/hub.c

Re: [PATCH 01/10] USB: Set usb port's DeviceRemovable according acpi information in EHCI

2012-12-04 Thread Lan Tianyu
On 2012年11月29日 08:08, Alan Stern wrote: On Wed, 28 Nov 2012, Sarah Sharp wrote: The shared code to overwrite the bits should probably print a warning if the host and ACPI bits differ. I'm not so sure about that. For one thing, who wants warnings to be logged every time they run lsusb -v?

Re: [PATCH 09/10] usb: expose usb port's pm qos flags to user space

2012-12-01 Thread Lan Tianyu
2012/11/30 Alan Stern st...@rowland.harvard.edu: On Fri, 30 Nov 2012, Lan Tianyu wrote: On 2012年11月29日 01:44, Alan Stern wrote: On Sat, 17 Nov 2012, Lan Tianyu wrote: This patch is to expose usb port's pm qos flags(pm_qos_no_power_off, pm_qos_remote_wakeup) to user space. User can set

Re: [PATCH 09/10] usb: expose usb port's pm qos flags to user space

2012-11-29 Thread Lan Tianyu
On 2012年11月29日 01:44, Alan Stern wrote: On Sat, 17 Nov 2012, Lan Tianyu wrote: This patch is to expose usb port's pm qos flags(pm_qos_no_power_off, pm_qos_remote_wakeup) to user space. User can set pm_qos_no_power_off flag to prohibit the port from being power off. Do we really need

Re: [PATCH 10/10] usb: add usb port's pm qos flags request to change NO_POWER_OFF flag

2012-11-29 Thread Lan Tianyu
On 2012年11月29日 03:42, Alan Stern wrote: On Sat, 17 Nov 2012, Lan Tianyu wrote: Some usb devices can't be resumed correctly after power off. This patch is to add pm qos flags request to change NO_POWER_OFF and provide usb_device_allow_power_off() for device drivers to allow or prohibit usb

Re: [PATCH 06/10] usb: Add driver/usb/core/(port.c,hub.h) files

2012-11-28 Thread Lan Tianyu
On 2012年11月29日 01:27, Alan Stern wrote: On Tue, 27 Nov 2012, Sarah Sharp wrote: Hi Alan, Could you take a look at this patchset since you asked Tianyu to refactor the hub code into new files? Yes, sorry. I've been busy. Oh. Never mind. Great thanks for your review.:) Tianyu, I think

[PATCH 0/10] usb: usb port power off mechanism and expose usb port connect type

2012-11-17 Thread Lan Tianyu
Hi Greg: The patchset is based on the pm qos flags patches which are on the linux-pm pm-qos branch http://git.kernel.org/?p=linux/kernel/git/rafael/linux-pm.git;a=shortlog;h=refs/heads/pm-qos So before merge this patchset, Please pull linux-pm pm-qos branch firstly. Thanks. git

[PATCH 01/10] USB: Set usb port's DeviceRemovable according acpi information in EHCI

2012-11-17 Thread Lan Tianyu
isn't created and usb port is not bound with acpi. So first hub descriptor request is not changed based on ACPI information. After usb port device being created, set hub port's DeviceRemovable according ACPI information and this also works for non-root hub. Signed-off-by: Lan Tianyu tianyu

[PATCH 03/10] usb: Create link files between child device and usb port device.

2012-11-17 Thread Lan Tianyu
To show the relationship between usb port and child device, add link file port under usb device's sysfs directoy and device under usb port device's sysfs directory. They are linked to each other. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 26

[PATCH 04/10] usb: Add portX/connect_type attribute to expose usb port's connect type

2012-11-17 Thread Lan Tianyu
Some platforms provide usb port connect types through ACPI. This patch is to add this new attribute to expose these information to user space. Signed-off-by: Lan Tianyu tianyu@intel.com --- Documentation/ABI/testing/sysfs-bus-usb |9 +++ drivers/usb/core/hub.c | 43

[PATCH 05/10] usb: Register usb port's acpi power resources

2012-11-17 Thread Lan Tianyu
This patch is to register usb port's acpi power resources. Create link between usb port device and its acpi power resource. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c |4 drivers/usb/core/usb-acpi.c | 20 drivers/usb/core/usb.h

[PATCH 06/10] usb: Add driver/usb/core/(port.c,hub.h) files

2012-11-17 Thread Lan Tianyu
This patch is to create driver/usb/core/(port.c,hub.h) files and move usb port related code into port.c. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/Makefile |1 + drivers/usb/core/hub.c| 174 + drivers/usb/core/hub.h

[PATCH 09/10] usb: expose usb port's pm qos flags to user space

2012-11-17 Thread Lan Tianyu
This patch is to expose usb port's pm qos flags(pm_qos_no_power_off, pm_qos_remote_wakeup) to user space. User can set pm_qos_no_power_off flag to prohibit the port from being power off. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/port.c |9 +++-- 1 file changed

[PATCH 10/10] usb: add usb port's pm qos flags request to change NO_POWER_OFF flag

2012-11-17 Thread Lan Tianyu
Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 36 drivers/usb/core/hub.h |2 ++ drivers/usb/core/port.c | 11 +++ include/linux/usb.h |1 + 4 files changed, 50 insertions(+) diff --git a/drivers/usb/core

[PATCH 07/10] usb: add runtime pm support for usb port device

2012-11-17 Thread Lan Tianyu
it is active. Acked-by: Rafael J. Wysocki rafael.j.wyso...@intel.com Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 20 drivers/usb/core/hub.h |5 + drivers/usb/core/port.c | 43 +++ 3 files changed, 68

[PATCH 08/10] usb: add usb port auto power off mechanism

2012-11-17 Thread Lan Tianyu
clear and persist enable. When device is suspended and power off, usb core will ignore port's connect and enable change event to keep the device not being disconnected. When it resumes, power on port again. Acked-by: Rafael J. Wysocki rafael.j.wyso...@intel.com Signed-off-by: Lan Tianyu tianyu

Re: [Resend PATCH V4 1/4] USB: Set usb port's DeviceRemovable according acpi information in EHCI

2012-11-15 Thread Lan Tianyu
On 2012年11月15日 04:12, Greg KH wrote: On Tue, Nov 13, 2012 at 04:07:17PM +0800, Lan Tianyu wrote: +for (i = 1; i = ports; i++) { +if (usb_get_hub_port_connect_type( +ehci_to_hcd(ehci)-self.root_hub, i

Re: [RFC PATCH v2 3/6] usb: add runtime pm support for usb port device

2012-11-14 Thread Lan Tianyu
于 2012/11/14 17:49, Rafael J. Wysocki 写道: On Wednesday, November 14, 2012 02:34:37 PM Lan Tianyu wrote: On 2012年11月14日 08:08, Rafael J. Wysocki wrote: On Tuesday, November 13, 2012 04:00:02 PM Lan Tianyu wrote: This patch is to add runtime pm callback for usb port device. Set/clear PORT_POWER

Re: [RFC PATCH v2 3/6] usb: add runtime pm support for usb port device

2012-11-14 Thread Lan Tianyu
于 2012/11/14 20:45, Lan Tianyu 写道: 于 2012/11/14 17:49, Rafael J. Wysocki 写道: On Wednesday, November 14, 2012 02:34:37 PM Lan Tianyu wrote: On 2012年11月14日 08:08, Rafael J. Wysocki wrote: On Tuesday, November 13, 2012 04:00:02 PM Lan Tianyu wrote: This patch is to add runtime pm callback

Re: [RFC PATCH v2 3/6] usb: add runtime pm support for usb port device

2012-11-14 Thread Lan Tianyu
于 2012/11/14 20:45, Lan Tianyu 写道: 于 2012/11/14 17:49, Rafael J. Wysocki 写道: On Wednesday, November 14, 2012 02:34:37 PM Lan Tianyu wrote: On 2012年11月14日 08:08, Rafael J. Wysocki wrote: On Tuesday, November 13, 2012 04:00:02 PM Lan Tianyu wrote: This patch is to add runtime pm callback

[RFC PATCH V2 0/6] usb: usb port power off mechanism

2012-11-13 Thread Lan Tianyu
Change Since v1: (1) Add driver/usb/core/port.c file and move usb port related code into new file. (2) Modify usb port's runtime pm callback and set/clear PORT_POWER feature in the resume/suspend callback. (3) Power off port through suspend port device instead of setting/

[RFC PATCH v2 1/6] usb: Register usb port's acpi power resources

2012-11-13 Thread Lan Tianyu
This patch is to register usb port's acpi power resources. Create link between usb port device and its acpi power resource. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c |4 drivers/usb/core/usb-acpi.c | 22 ++ drivers/usb/core

[RFC PATCH v2 2/6] usb: Add driver/usb/core/port.c file to fill usb port related code.

2012-11-13 Thread Lan Tianyu
This patch is to create driver/usb/core/port.c and move usb port related code into it. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/Makefile |1 + drivers/usb/core/hub.c| 113 +++-- drivers/usb/core/port.c | 82

[RFC PATCH v2 3/6] usb: add runtime pm support for usb port device

2012-11-13 Thread Lan Tianyu
This patch is to add runtime pm callback for usb port device. Set/clear PORT_POWER feature in the resume/suspend callbak. Add portnum for struct usb_port to record port number. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 14 ++ drivers/usb/core

[RFC PATCH v2 4/6] usb: add usb port auto power off mechanism

2012-11-13 Thread Lan Tianyu
clear and persist enable. When device is suspended and power off, usb core will ignore port's connect and enable change event to keep the device not being disconnected. When it resumes, power on port again. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 76

[Resend PATCH V4 0/4] usb: expose DeviceRemovable to user space via sysfs attribute

2012-11-13 Thread Lan Tianyu
Change since v1: [PATCH 3] Rename link file's name child to device, add check of return value of sysfs_create_link() and handle error return value properly. Change since v2: [PATCH 1] fix a logic backward problem. Add changelog about change ehci root hub descriptors based on ACPI

[Resend PATCH V4 1/4] USB: Set usb port's DeviceRemovable according acpi information in EHCI

2012-11-13 Thread Lan Tianyu
isn't created and usb port is not bound with acpi. So first hub descriptor request is not changed based on ACPI information. After usb port device being created, set hub port's DeviceRemovable according ACPI information and this also works for non-root hub. Signed-off-by: Lan Tianyu tianyu

[Resend PATCH V4 2/4] usb/xhci: set root hub's DeviceRemovable according to usb port connect type

2012-11-13 Thread Lan Tianyu
-by: Lan Tianyu tianyu@intel.com --- drivers/usb/host/xhci-hub.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index a686cf4..50a3c39 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb

[Resend PATCH V4 4/4] usb: Add portX/connect_type attribute to expose usb port's connect type

2012-11-13 Thread Lan Tianyu
Some platforms provide usb port connect types through ACPI. This patch is to add this new attribute to expose these information to user space. Signed-off-by: Lan Tianyu tianyu@intel.com --- Documentation/ABI/testing/sysfs-bus-usb |9 +++ drivers/usb/core/hub.c | 43

[Resend PATCH V4 3/4] usb: Create link files between child device and usb port device.

2012-11-13 Thread Lan Tianyu
To show the relationship between usb port and child device, add link file port under usb device's sysfs directoy and device under usb port device's sysfs directory. They are linked to each other. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 26

Re: [RFC PATCH v2 1/6] usb: Register usb port's acpi power resources

2012-11-13 Thread Lan Tianyu
于 2012/11/13 19:07, Sergei Shtylyov 写道: Hello. On 13-11-2012 12:00, Lan Tianyu wrote: This patch is to register usb port's acpi power resources. Create link between usb port device and its acpi power resource. Signed-off-by: Lan Tianyu tianyu@intel.com [...] diff --git a/drivers/usb

Re: [RFC PATCH v2 1/6] usb: Register usb port's acpi power resources

2012-11-13 Thread Lan Tianyu
On 2012年11月14日 07:56, Rafael J. Wysocki wrote: On Tuesday, November 13, 2012 08:36:15 PM Lan Tianyu wrote: 于 2012/11/13 19:07, Sergei Shtylyov 写道: Hello. On 13-11-2012 12:00, Lan Tianyu wrote: This patch is to register usb port's acpi power resources. Create link between usb port device

Re: [RFC PATCH v2 2/6] usb: Add driver/usb/core/port.c file to fill usb port related code.

2012-11-13 Thread Lan Tianyu
On 2012年11月14日 08:04, Rafael J. Wysocki wrote: On Tuesday, November 13, 2012 04:00:01 PM Lan Tianyu wrote: This patch is to create driver/usb/core/port.c and move usb port related code into it. It does seem to make functional changes in addition to that, however. No functional change

Re: [RFC PATCH v2 3/6] usb: add runtime pm support for usb port device

2012-11-13 Thread Lan Tianyu
On 2012年11月14日 08:08, Rafael J. Wysocki wrote: On Tuesday, November 13, 2012 04:00:02 PM Lan Tianyu wrote: This patch is to add runtime pm callback for usb port device. Set/clear PORT_POWER feature in the resume/suspend callbak. Add portnum for struct usb_port to record port number. Signed

Re: [RFC PATCH 4/5] usb: add runtime pm support for usb port device

2012-11-12 Thread Lan Tianyu
On 2012年11月12日 10:43, Alan Stern wrote: On Mon, 12 Nov 2012, Lan Tianyu wrote: This will consume more power than suspend it agian. No it won't, because the device will suspend itself after 3 ms. But the premise is they see a constant Idle state on their upstream facing bus lines

Re: [RFC PATCH 5/5] usb: add usb port's pm qos flags request to change NO_POWER_OFF flag

2012-11-11 Thread Lan Tianyu
On 2012/11/10 0:10, Alan Stern wrote: On Fri, 9 Nov 2012, Lan Tianyu wrote: Some usb devices can't be resumed correctly after power off. This patch is to add pm qos flags request to change NO_POWER_OFF and provide usb_device_allow_power_off() for device drivers to allow or prohibit usb core

Re: [RFC PATCH 5/5] usb: add usb port's pm qos flags request to change NO_POWER_OFF flag

2012-11-11 Thread Lan Tianyu
On 2012年11月11日 23:55, Alan Stern wrote: On Sun, 11 Nov 2012, Lan Tianyu wrote: On 2012/11/10 0:10, Alan Stern wrote: On Fri, 9 Nov 2012, Lan Tianyu wrote: Some usb devices can't be resumed correctly after power off. This patch is to add pm qos flags request to change NO_POWER_OFF

Re: [RFC PATCH 4/5] usb: add runtime pm support for usb port device

2012-11-11 Thread Lan Tianyu
On 2012年11月11日 23:46, Alan Stern wrote: On Sun, 11 Nov 2012, Lan Tianyu wrote: Hi Alan: Great thanks for your review and good suggestions. I think the main problem is that when the port device resumed(you said turn on/off power in the port's runtime callback ) and device powered

Re: [RFC PATCH 5/5] usb: add usb port's pm qos flags request to change NO_POWER_OFF flag

2012-11-11 Thread Lan Tianyu
On 2012年11月12日 10:41, Alan Stern wrote: On Mon, 12 Nov 2012, Lan Tianyu wrote: I think port and device are bound. Power off port also means to power off device. So prevent device from power off also means to prevent port from power off. They just like a power domain. Because power

[RFC PATCH 0/5] usb: usb port power off mechanism

2012-11-09 Thread Lan Tianyu
The patchset is based on the pm qos flags patches and now on the linux-pm's next tree and pm-qos. http://git.kernel.org/?p=linux/kernel/git/rafael/linux-pm.git;a=shortlog;h=refs/heads/pm-qos usb: add usb port's pm qos flags request to change NO_POWER_OFF flag usb: add runtime pm support for usb

[RFC PATCH 1/5] usb: Register usb port's acpi power resources

2012-11-09 Thread Lan Tianyu
This patch is to register usb port's acpi power resources. Create link between usb port device and its acpi power resource. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c |3 ++- drivers/usb/core/usb-acpi.c | 23 +++ drivers/usb/core

[RFC PATCH 2/5] usb: add usb port auto power off mechanism

2012-11-09 Thread Lan Tianyu
is suspended and power off, usb core will ignore port's connect and enable change event to keep the device not being disconnected. When it resumes, power on port again. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 78 ++-- 1

[RFC PATCH 3/5] usb: expose usb port's pm qos flags to user space

2012-11-09 Thread Lan Tianyu
This patch is to expose usb port's pm qos flags(pm_qos_no_power_off, pm_qos_remote_wakeup) to user space. The pm_qos_no_power_off will be used to control usb port auto power off mechanism from user space. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c |9

[RFC PATCH 5/5] usb: add usb port's pm qos flags request to change NO_POWER_OFF flag

2012-11-09 Thread Lan Tianyu
Some usb devices can't be resumed correctly after power off. This patch is to add pm qos flags request to change NO_POWER_OFF and provide usb_device_allow_power_off() for device drivers to allow or prohibit usb core to power off the device. Signed-off-by: Lan Tianyu tianyu@intel.com

[RFC PATCH 4/5] usb: add runtime pm support for usb port device

2012-11-09 Thread Lan Tianyu
will be resumed and suspended. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 48 1 file changed, 48 insertions(+) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index f0e1b29..3ba6a96 100644 --- a/drivers/usb

[PATCH V4 0/4] usb: expose DeviceRemovable to user space via sysfs attribute

2012-11-07 Thread Lan Tianyu
Change since v1: [PATCH 3] Rename link file's name child to device, add check of return value of sysfs_create_link() and handle error return value properly. Change since v2: [PATCH 1] fix a logic backward problem. Add changelog about change ehci root hub descriptors based on ACPI

[PATCH V4 1/4] USB: Set usb port's DeviceRemovable according acpi information in EHCI

2012-11-07 Thread Lan Tianyu
isn't created and usb port is not bound with acpi. So first hub descriptor request is not changed based on ACPI information. After usb port device being created, set hub port's DeviceRemovable according ACPI information and this also works for non-root hub. Signed-off-by: Lan Tianyu tianyu

[PATCH V4 2/4] usb/xhci: set root hub's DeviceRemovable according to usb port connect type

2012-11-07 Thread Lan Tianyu
-by: Lan Tianyu tianyu@intel.com --- drivers/usb/host/xhci-hub.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index a686cf4..50a3c39 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb

[PATCH V4 3/4] usb: Create link files between child device and usb port device.

2012-11-07 Thread Lan Tianyu
To show the relationship between usb port and child device, add link file port under usb device's sysfs directoy and device under usb port device's sysfs directory. They are linked to each other. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 26

[PATCH V4 4/4] usb: Add portX/connect_type attribute to expose usb port's connect type

2012-11-07 Thread Lan Tianyu
Some platforms provide usb port connect types through ACPI. This patch is to add this new attribute to expose these information to user space. Signed-off-by: Lan Tianyu tianyu@intel.com --- Documentation/ABI/testing/sysfs-bus-usb |9 +++ drivers/usb/core/hub.c | 43

RE: [PATCH V3 3/4] usb: Create link files between child device and usb port device.

2012-11-06 Thread Lan, Tianyu
Hi Alan: Thanks for your review. I will update soon. Best Regards Tianyu Lan -Original Message- From: Alan Stern [mailto:st...@rowland.harvard.edu] Sent: Monday, November 05, 2012 10:55 PM To: Lan, Tianyu Cc: gre...@linuxfoundation.org; sarah.a.sh...@linux.intel.com

[PATCH V3 1/4] USB: Set usb port's DeviceRemovable according acpi information in EHCI

2012-11-04 Thread Lan Tianyu
isn't created and usb port is not bound with acpi. So first hub descriptor request is not changed based on ACPI information. After usb port device being created, set hub port's DeviceRemovable according ACPI information and this also works for non-root hub. Signed-off-by: Lan Tianyu tianyu

[PATCH V3 3/4] usb: Create link files between child device and usb port device.

2012-11-04 Thread Lan Tianyu
To show the relationship between usb port and child device, add link file port under usb device's sysfs directoy and device under usb port device's sysfs directory. They are linked to each other. Signed-off-by: Lan Tianyu tianyu@intel.com --- drivers/usb/core/hub.c | 22

<    1   2   3   >