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.:) > > Ti

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

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() f

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 : > 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, >>

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

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

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

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

2012-12-07 Thread Lan Tianyu
On 2012年12月06日 23:43, Alan Stern wrote: > On Thu, 6 Dec 2012, Lan Tianyu wrote: > >> Hi Alan: >> Doing port_dev->power_on = true in usb_hub_set_port_power() just after >> set PORT_POWER feature will cause device to be disconnected. If user set >> PM Qos NO_PO

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 >&

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

2012-12-10 Thread Lan Tianyu
Hi Alan&Greg: 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 core(xh

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 po

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 meth

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 Alan&Greg: >>> We meet a problem that bind usb3.0 port(supper-speed port) with ACPI. >>> The

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

2012-12-11 Thread Lan Tianyu
Hi Alan&Greg: Since 3.1, Alan enabled usb device wakeup default, there are a lot of problem that immediately resume when enter into s2ram/s2disk. I have traced some these bugs. Most of these bugs are related usb1.1 device which attached to OHCI/UHCI. If disable the hc wakeup or no device

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 de

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); >&

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, de

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:

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

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? >>>> >&g

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

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

2012-12-16 Thread Lan Tianyu
On 2012/12/14 23:44, Alan Stern wrote: On Fri, 14 Dec 2012, Lan Tianyu wrote: Hi Alan: debounce is still needed. If connect status was not stable, resume operation will fail. So how about following? Actually, I'm not sure that a debounce is needed. Debouncing is used when a pl

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 >> wrote: >> >>> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c >>> index f034716..9335f1b 100644

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

[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 call

[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 --- drivers/usb/core/Makefile |1 + drivers/usb/core/hub.c| 107 + drivers/usb/core/hub.h| 97

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

2013-01-04 Thread Lan Tianyu
set hub port's DeviceRemovable according ACPI information and this also works for non-root hub. Signed-off-by: Lan Tianyu --- drivers/usb/core/hcd.c |4 drivers/usb/core/hub.c | 48 drivers/usb/core/usb.h |3 +++ 3 files changed, 55

[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 --- 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 --- 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 --- drivers/usb/core/port.c |3 +++ drivers/usb/core/usb-acpi.c | 20 drivers/usb/core/usb.h |6

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

2013-01-04 Thread Lan Tianyu
active. Acked-by: Rafael J. Wysocki Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 18 ++ drivers/usb/core/hub.h |4 drivers/usb/core/port.c | 37 + 3 files changed, 59 insertions(+) diff --git a/drivers/usb/core/hub.c b

[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 Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 61

[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 --- drivers/usb/core/port.c |9 +++-- 1 file changed, 7 insertions(

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

2013-01-04 Thread Lan Tianyu
patch 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 --- d

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

2013-01-04 Thread Lan Tianyu
suspended. The device will not be power off. Signed-off-by: Lan Tianyu --- 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/c

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

2013-01-04 Thread Lan Tianyu
On 2013年01月04日 23:53, Alan Stern wrote: > On Fri, 4 Jan 2013, 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. Do &g

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

2013-01-04 Thread Lan Tianyu
On 2013年01月04日 23:57, Alan Stern wrote: > On Fri, 4 Jan 2013, Lan Tianyu wrote: >> @@ -2862,6 +2880,20 @@ int usb_port_suspend(struct usb_device *udev, >> pm_message_t msg) >> udev->port_is_suspended = 1; >> msleep(10); >> } >

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

2013-01-04 Thread Lan Tianyu
On 2013年01月04日 23:59, Alan Stern wrote: > On Fri, 4 Jan 2013, Lan Tianyu wrote: > >> Some usb devices can't be resumed correctly after power off. This >> patch is to add usb_device_allow_power_off() for device's driver to allow or >> prohibit devic

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

2013-01-06 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 call

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

2013-01-06 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 --- drivers/usb/core/Makefile |1 + drivers/usb/core/hub.c| 107 + drivers/usb/core/hub.h| 97

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

2013-01-06 Thread Lan Tianyu
set hub port's DeviceRemovable according ACPI information and this also works for non-root hub. Signed-off-by: Lan Tianyu --- drivers/usb/core/hcd.c |4 drivers/usb/core/hub.c | 48 drivers/usb/core/usb.h |3 +++ 3 files changed, 55

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

2013-01-06 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 --- Documentation/ABI/testing/sysfs-bus-usb |9 +++ drivers/usb/core/port.c | 43

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

2013-01-06 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 --- drivers/usb/core/hub.c | 26

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

2013-01-06 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 --- drivers/usb/core/port.c |3 +++ drivers/usb/core/usb-acpi.c | 20 drivers/usb/core/usb.h |6

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

2013-01-06 Thread Lan Tianyu
active. Acked-by: Rafael J. Wysocki Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 18 ++ drivers/usb/core/hub.h |4 drivers/usb/core/port.c | 43 +++ 3 files changed, 65 insertions(+) diff --git a/drivers/usb/core/hub.c

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

2013-01-06 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 Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 64

[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 --- drivers/usb/core/port.c |9 +++-- 1 file changed, 7 insertions(

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

2013-01-06 Thread Lan Tianyu
count and then port will not be suspended. The device will not be power off. Signed-off-by: Lan Tianyu --- 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/

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()

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

2013-01-07 Thread Lan Tianyu
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 pm_qos_no_power_off >> flag to prohibit the port from bei

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

2013-01-07 Thread Lan Tianyu
On 2013年01月07日 15:43, Oliver Neukum wrote: > On Saturday 05 January 2013 13:58:27 Alan Stern wrote: >>> static int inline usb_device_prevent_power_off(struct usb_device *udev) >>> { >>> struct device *dev = usb_get_port_dev(udev); >>> >>> if(!dev) >>> return -ENODEV; >>> >

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, >

[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 --- drivers/usb/core/Makefile |1 + drivers/usb/core/hub.c| 107 + drivers/usb/core/hub.h| 97

[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 --- 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 --- 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 call

[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 --- drivers/usb/core/port.c |3 +++ drivers/usb/core/usb-acpi.c | 20 drivers/usb/core/usb.h |6

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

2013-01-09 Thread Lan Tianyu
active. Acked-by: Rafael J. Wysocki Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 18 ++ drivers/usb/core/hub.h |4 drivers/usb/core/port.c | 43 +++ 3 files changed, 65 insertions(+) diff --git a/drivers/usb/core

[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 --- drivers/usb/core/port.c | 11 ++- 1 file changed, 10 inser

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

2013-01-09 Thread Lan Tianyu
ice will not be powered off. Signed-off-by: Lan Tianyu --- 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 --- a/d

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

2013-01-09 Thread Lan Tianyu
set hub port's DeviceRemovable according ACPI information and this also works for non-root hub. Signed-off-by: Lan Tianyu --- drivers/usb/core/hcd.c |4 drivers/usb/core/hub.c | 48 drivers/usb/core/usb.h |3 +++ 3 files changed, 55

[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 Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 65

[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 --- drivers/base/power/qos.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index ff46387

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. > ^^

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 >> --- >> dr

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

2013-01-09 Thread Lan Tianyu
e raw 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 --- drivers/usb/core/hcd.c |9 + drivers/usb/host/xhci-

[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 --- 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-acpi.c +++ b/drivers/usb

[PATCH 3/3] usb/xhci: refactor xhci_find_real_port_number()

2013-01-09 Thread Lan Tianyu
This patch is to optimize xhci_find_realport_number(). Call xhci_find_raw_port_number() to get real index in the HW port status registers instead of scanning through the xHCI roothub port array. Signed-off-by: Lan Tianyu --- drivers/usb/host/xhci-mem.c | 36

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.

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

2013-01-11 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 call

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

2013-01-11 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 export it. Signed-off-by: Lan Tianyu --- drivers/base/power/qos.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index ff46387

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

2013-01-11 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 --- drivers/usb/core/Makefile |1 + drivers/usb/core/hub.c| 107 + drivers/usb/core/hub.h| 97

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

2013-01-11 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 --- Documentation/ABI/testing/sysfs-bus-usb |9 +++ drivers/usb/core/port.c | 43

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

2013-01-11 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 --- drivers/usb/core/hub.c | 26

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

2013-01-11 Thread Lan Tianyu
set hub port's DeviceRemovable according ACPI information and this also works for non-root hub. Signed-off-by: Lan Tianyu --- drivers/usb/core/hcd.c |4 drivers/usb/core/hub.c | 48 drivers/usb/core/usb.h |3 +++ 3 files changed, 55

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

2013-01-11 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 --- drivers/usb/core/port.c |3 +++ drivers/usb/core/usb-acpi.c | 20 drivers/usb/core/usb.h |6

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

2013-01-11 Thread Lan Tianyu
active. Acked-by: Rafael J. Wysocki Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 18 ++ drivers/usb/core/hub.h |4 drivers/usb/core/port.c | 43 +++ 3 files changed, 65 insertions(+) diff --git a/drivers/usb/core

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

2013-01-11 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 Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 65

[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
ice will not be powered off. Signed-off-by: Lan Tianyu --- 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 --- a/d

[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 --- drivers/usb/core/port.c | 11 ++- 1 file changed, 10 inser

Re: USB device cannot be reconnected and khubd "blocked for more than 120 seconds"

2013-01-12 Thread Lan Tianyu
On 2013年1月12日 15:48:59, Alex Riesen wrote: On Fri, Jan 11, 2013 at 10:04 PM, Alex Riesen wrote: Hi, the USB stick (an Cruzer Titanium 2GB) was not recognized at any of the USB ports of this system (an System76 lemu4 laptop, XHCI device) after it was removed. If I attempt to insert it again in

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

2013-01-14 Thread Lan Tianyu
On 2013年01月11日 20:10, Lan Tianyu wrote: > 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 run

[PATCH] usb: Using correct way to clear usb3.0 device's remote wakeup feature.

2013-01-16 Thread Lan Tianyu
y the SetFeature() requests using the FUNCTION_SUSPEND feature selector. This patch is to use correct way to disable usb3.0 device's function remote wakeup after suspend error and resuming. Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 71 +++--

Re: [PATCH] usb: Using correct way to clear usb3.0 device's remote wakeup feature.

2013-01-17 Thread Lan Tianyu
Sarah Sharp > > On Thu, Jan 17, 2013 at 03:47:51PM +0800, Lan Tianyu wrote: >> Usb3.0 device defines function remote wakeup which is only for interface >> recipient rather than device recipient. This is different with usb2.0 >> device's >> remote wakeup feature whi

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

2013-01-18 Thread Lan Tianyu
On 2013年01月16日 23:45, Alan Stern wrote: > On Tue, 15 Jan 2013, Lan Tianyu wrote: > >> Hi Greg&Alan: >> Do you have some more comments about this patchset? Thanks. > > I don't have any more comments at this point. It looks okay to me. > > Acked-by

[Rebase PATCH] usb: Using correct way to clear usb3.0 device's remote wakeup feature.

2013-01-18 Thread Lan Tianyu
y the SetFeature() requests using the FUNCTION_SUSPEND feature selector. This patch is to use correct way to disable usb3.0 device's function remote wakeup after suspend error and resuming. Signed-off-by: Lan Tianyu --- This patch is rebased on the usb-linus branch commit 1ee0a224bc9aa "USB:

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

2013-01-18 Thread Lan Tianyu
e raw 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 --- Change since v1: Don't export usb_hcd_find_raw_port_numbe

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

2013-01-18 Thread Lan Tianyu
extended capabilities table before binding. Signed-off-by: Lan Tianyu --- 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-acpi.c +++ b/drivers/usb

[PATCH v2 3/3] usb/xhci: refactor xhci_find_real_port_number()

2013-01-18 Thread Lan Tianyu
This patch is to optimize xhci_find_realport_number(). Call xhci_find_raw_port_number() to get real index in the HW port status registers instead of scanning through the xHCI roothub port array. Signed-off-by: Lan Tianyu --- drivers/usb/host/xhci-mem.c | 36

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

2013-01-18 Thread Lan, Tianyu
Regards Tianyu Lan -Original Message- From: Alan Stern [mailto:st...@rowland.harvard.edu] Sent: Saturday, January 19, 2013 12:21 AM To: Lan, Tianyu Cc: r...@sisk.pl; gre...@linuxfoundation.org; sarah.a.sh...@linux.intel.com; oneu...@suse.de; linux-usb@vger.kernel.org Subject: Re: [

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

2013-01-18 Thread Lan, Tianyu
Best Regards Tianyu Lan -Original Message- From: Alan Stern [mailto:st...@rowland.harvard.edu] Sent: Saturday, January 19, 2013 2:50 AM To: Lan, Tianyu Cc: r...@sisk.pl; gre...@linuxfoundation.org; sarah.a.sh...@linux.intel.com; oneu...@suse.de; linux-usb@vger.kernel.org Subject: RE

[PATCH] usb: fix compilation error and warning of driver/usb/core/port.c on arm and blackfin

2013-01-19 Thread Lan Tianyu
; drivers/usb/core/port.c:38:11: warning: assignment makes pointer from >> integer without a cast [enabled by default] cc1: some warnings being treated as errors Reported-by: Fengguang Wu Signed-off-by: Lan Tianyu --- drivers/usb/core/port.c |2 ++ 1 file changed, 2 insertions(+) di

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

2013-01-19 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 call

[PATCH v5 01/10] PM/Qos: Expose dev_pm_qos_flags symbol

2013-01-19 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 export it. Acked-by: Alan Stern Signed-off-by: Lan Tianyu --- drivers/base/power/qos.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/power/qos.c b/drivers/base/power

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

2013-01-19 Thread Lan Tianyu
set hub port's DeviceRemovable according ACPI information and this also works for non-root hub. Acked-by: Alan Stern Signed-off-by: Lan Tianyu --- drivers/usb/core/hcd.c |4 drivers/usb/core/hub.c | 43 +++ drivers/usb/core/usb.h |3 +++ 3 fi

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

2013-01-19 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. Acked-by: Alan Stern Signed-off-by: Lan Tianyu --- Documentation/ABI/testing/sysfs-bus-usb |9 +++ drivers/usb/core/port.c

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

2013-01-19 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. Acked-by: Alan Stern Signed-off-by: Lan Tianyu ---

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

2013-01-19 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. Acked-by: Alan Stern Signed-off-by: Lan Tianyu --- drivers/usb/core/port.c |3 +++ drivers/usb/core/usb-acpi.c | 20 drivers/usb/core/

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

2013-01-19 Thread Lan Tianyu
active. Acked-by: Alan Stern Acked-by: Rafael J. Wysocki Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 18 ++ drivers/usb/core/hub.h |4 drivers/usb/core/port.c | 45 + 3 files changed, 67 insertions(+) diff

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

2013-01-19 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: Alan Stern Acked-by: Rafael J. Wysocki Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c

  1   2   3   4   >