Re: [PATCH 0/3] ACPI / bind: Use struct acpi_device pointers instead of ACPI handles

2013-11-28 Thread Lan Tianyu
y acpi_bind_one() to take a struct acpi_device > pointer as > the second argument. > [3/3] ACPI / bind: Move acpi_get_child() to ide-acpi.c which is the only > remaining > user of that function. > Test usb/ACPI bind part, it works normally. Tested-by: Lan Tianyu >

Re: [PATCH 1/3] ACPI / bind: Rework struct acpi_bus_type

2013-11-28 Thread Lan Tianyu
On 2013年11月29日 08:37, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Replace the .find_device function pointer in struct acpi_bus_type > with a new one, .find_copmanion, that is supposed to point to a -^ A typo > function returning struct acpi_device pointer (inst

Re: [RFC Patch] USB: Add check for portnum in the usb_acpi_find_device()

2013-06-02 Thread Lan Tianyu
On 2013/5/31 19:18 Greg KH wrote the following: On Fri, May 31, 2013 at 02:18:06PM +0800, Lan Tianyu wrote: This patch is to add a check of "portnum" which from the usb port dev's name. Why do we need this now? The "portnum" will be used as array index for str

[RFC Patch] USB: Add check for portnum in the usb_acpi_find_device()

2013-05-30 Thread Lan Tianyu
This patch is to add a check of "portnum" which from the usb port dev's name. The "portnum" will be used as array index for struct usb_hub->ports in the usb_set_hub_port_connect_type(). Signed-off-by: Lan Tianyu --- drivers/usb/core/usb-acpi.c |3 +++ 1 file ch

Re: [PATCH 2/4] usb: introduce usb force power off mechanism

2013-04-08 Thread Lan Tianyu
On 2013/4/1 23:12, Alan Stern wrote: On Mon, 1 Apr 2013, Lan Tianyu wrote: On 2013年03月30日 01:23, Alan Stern wrote: On Fri, 29 Mar 2013, Sarah Sharp wrote: However, what happens if you echo 0 to pm_qos_no_power_off, the power/control is set to auto, and there's a suspended USB device att

Re: [PATCH 2/4] usb: introduce usb force power off mechanism

2013-04-08 Thread Lan Tianyu
On 2013/3/30 4:24, Alan Stern wrote: On Fri, 29 Mar 2013, Sarah Sharp wrote: Also, bear in mind that the proposed patch does not give userspace a way to power off ports via usbfs. What the new code does is a power-off reset -- it turns off power to the port, waits a short time, and then turns

Re: [PATCH 2/4] usb: introduce usb force power off mechanism

2013-04-01 Thread Lan Tianyu
On 2013年03月30日 01:23, Alan Stern wrote: > On Fri, 29 Mar 2013, Sarah Sharp wrote: >> However, what happens if you echo 0 to pm_qos_no_power_off, the >> power/control is set to auto, and there's a suspended USB device >> attached to the port with remote wakeup enabled? Will the port be >> powered o

Re: [PATCH 2/4] usb: introduce usb force power off mechanism

2013-03-31 Thread Lan Tianyu
On 2013年03月29日 22:11, Alan Stern wrote: > On Fri, 29 Mar 2013, Lan Tianyu wrote: > >> Actually, I exposed pm qos flags for usb port via dev_pm_qos_expose_flags(). >> It creates power/pm_qos_no_power_off under usb port sysfs directory. >> User can echo 0 > pm_qos_no

Re: [PATCH 4/4] usb: register usb port to usb_bus_type

2013-03-28 Thread Lan Tianyu
On 2013/3/29 6:56, Greg KH wrote: On Thu, Mar 28, 2013 at 03:16:08PM -0400, Alan Stern wrote: On Thu, 28 Mar 2013, Greg KH wrote: On Thu, Mar 28, 2013 at 02:44:01PM -0400, Alan Stern wrote: On Thu, 28 Mar 2013, Greg KH wrote: ls /sys/bus/usb/devices 1-0:1.02-0:1.0 port1-1 port1-1.

Re: [PATCH 2/4] usb: introduce usb force power off mechanism

2013-03-28 Thread Lan Tianyu
On 2013/3/29 6:43, Sarah Sharp wrote: On Thu, Mar 28, 2013 at 05:00:23PM -0400, Alan Stern wrote: On Thu, 28 Mar 2013, Sarah Sharp wrote: On Thu, Mar 28, 2013 at 01:11:02AM +0800, Lan Tianyu wrote: Some devices' firmware will be broken at some points. Power down and power on device can

Re: [PATCH 3/4] usb: Add usb port system pm support

2013-03-28 Thread Lan Tianyu
On 2013/3/29 4:47, Sarah Sharp wrote: On Thu, Mar 28, 2013 at 07:58:47AM +0800, Lan Tianyu wrote: On 2013/3/28 2:47, Alan Stern wrote: On Thu, 28 Mar 2013, Lan Tianyu wrote What happens if there's no device plugged in to the port, but the hub is enabled for remote wakeup? How will the h

Re: [PATCH 2/4] usb: introduce usb force power off mechanism

2013-03-28 Thread Lan Tianyu
On 2013/3/29 3:38, Alan Stern wrote: On Fri, 29 Mar 2013, Lan Tianyu wrote: Ok. I just refresh patch "usb: introduce usb force power off mechanism" Please have a look. From 16f5c7c6dd00830530a9ac758af25b575e0b8731 Mon Sep 17 00:00:00 2001 From: Lan Tianyu Date: Tue, 26 Feb 201

Re: [PATCH 4/4] usb: register usb port to usb_bus_type

2013-03-28 Thread Lan Tianyu
On 2013/3/29 2:53, Greg KH wrote: On Thu, Mar 28, 2013 at 02:44:01PM -0400, Alan Stern wrote: On Thu, 28 Mar 2013, Greg KH wrote: ls /sys/bus/usb/devices 1-0:1.02-0:1.0 port1-1 port1-1.3 port2-1.2 port2-2 port4-3 1-12-1 port1-1.1port1-1.4 port2-1.3 port3-1 port

Re: [PATCH 4/4] usb: register usb port to usb_bus_type

2013-03-28 Thread Lan Tianyu
On 2013/3/29 2:44, Alan Stern wrote: On Thu, 28 Mar 2013, Greg KH wrote: ls /sys/bus/usb/devices 1-0:1.02-0:1.0 port1-1 port1-1.3 port2-1.2 port2-2 port4-3 1-12-1 port1-1.1port1-1.4 port2-1.3 port3-1 port4-4 1-1.1 2-1:1.0 port1-1.2port1-1.5 port2-1.4

Re: [PATCH 4/4] usb: register usb port to usb_bus_type

2013-03-28 Thread Lan Tianyu
On 2013/3/29 2:21, Greg KH wrote: What does it look like if you reverse the naming scheme (hub dev name + "port")? Doesn't that show the devices in a bit more logical way? Hi Greg: Do you mean e.g "port1.2-1", originally it's "port2-1.1". 2-1 is hub dev name? No, I mean "2-1.port1" as

Re: [PATCH 4/4] usb: register usb port to usb_bus_type

2013-03-28 Thread Lan Tianyu
On 2013/3/29 1:59, Greg KH wrote: On Thu, Mar 28, 2013 at 01:11:04AM +0800, Lan Tianyu wrote: Usb port isn't assigned to any bus_type. This seems not good from Greg's comments. http://marc.info/?l=linux-usb&m=136200364929942&w=2 This patch is to register usb port to

Re: [PATCH 2/4] usb: introduce usb force power off mechanism

2013-03-28 Thread Lan Tianyu
On 2013/3/29 1:49, Alan Stern wrote: On Fri, 29 Mar 2013, Lan Tianyu wrote: On 2013/3/29 0:50, Alan Stern wrote: On Fri, 29 Mar 2013, Lan Tianyu wrote: About the path "usb: Add usb port system pm support", do you think it's ok? Generally yes. But why doesn't usb_port_

Re: [PATCH 2/4] usb: introduce usb force power off mechanism

2013-03-28 Thread Lan Tianyu
On 2013/3/29 0:50, Alan Stern wrote: On Fri, 29 Mar 2013, Lan Tianyu wrote: About the path "usb: Add usb port system pm support", do you think it's ok? Generally yes. But why doesn't usb_port_system_suspend check for any PM_QOS constraints? Either on the port itself or

Re: [PATCH 2/4] usb: introduce usb force power off mechanism

2013-03-28 Thread Lan Tianyu
On 2013/3/28 22:46, Alan Stern wrote: On Thu, 28 Mar 2013, Lan Tianyu wrote: How long do you think the power should remain turned off? This code will leave it off for only a few milliseconds at most. That may not even be long enough for the voltage to drop all the way to 0. The delay

Re: [PATCH 2/4] usb: introduce usb force power off mechanism

2013-03-28 Thread Lan Tianyu
On 2013/3/28 2:45, Alan Stern wrote: +int usb_hub_port_power_reset(struct usb_device *hdev, int port1) +{ + struct usb_hub *hub = usb_hub_to_struct_hub(hdev); + struct usb_interface *intf = to_usb_interface(hub->intfdev); + int ret; + + usb_autopm_get_interface(intf); Wh

Re: [PATCH 3/4] usb: Add usb port system pm support

2013-03-27 Thread Lan Tianyu
On 2013/3/28 2:47, Alan Stern wrote: On Thu, 28 Mar 2013, Lan Tianyu wrote What happens if there's no device plugged in to the port, but the hub is enabled for remote wakeup? How will the hub be able to detect a plug-in event if the port isn't powered? Alan Stern Hi Alan:

RE: [PATCH 2/4] usb: introduce usb force power off mechanism

2013-03-27 Thread Lan, Tianyu
0; } Best Regards Tianyu Lan -Original Message- From: Lan, Tianyu Sent: Thursday, March 28, 2013 1:11 AM To: gre...@linuxfoundation.org; sarah.a.sh...@linux.intel.com; st...@rowland.harvard.edu Cc: linux-usb@vger.kernel.org; Lan, Tianyu Subject: [PATCH 2/4] usb: introduce usb force

[PATCH 2/4] usb: introduce usb force power off mechanism

2013-03-27 Thread Lan Tianyu
down and up usb port. This patch is also helpful fo some QAs who want to do hcd's memleak test(Plug and unplug device thousand times.) Signed-off-by: Lan Tianyu --- drivers/usb/core/devio.c | 13 + drivers/usb/core/hub.c| 16 driver

[PATCH 3/4] usb: Add usb port system pm support

2013-03-27 Thread Lan Tianyu
t_dev->power_is_on being false, usb_port_system_suspend() returns directly. If usb port was not powered off during system suspend with port_dev->power_is_on being true, usb_port_system_resume() returns directly. Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c |4 drivers/usb/

[PATCH 4/4] usb: register usb port to usb_bus_type

2013-03-27 Thread Lan Tianyu
port1-1.6 port2-1.5 port3-3 usb2 1-1.1:1.0 3-1 port1-1.2.2 port1-2port2-1.6 port3-4 usb3 1-1.2 3-1:1.0 port1-1.2.3 port2-1port2-1.7 port4-1 usb4 1-1.2:1.0 4-0:1.0 port1-1.2.4 port2-1.1 port2-1.8 port4-2 Signed-off-by: Lan Tianyu --- Documentation/ABI/testi

[PATCH 0/4] usb: remote_wakeup code clean up and usb port related feature

2013-03-27 Thread Lan Tianyu
PATCH 1 is for code clean up. PATCH 2~3 is to introduce usb port power off new feature PATCH 4 is to fix usb port doesn't register to any bus_type usb: add usb_enable/disable_remote_wakeup() usb: introduce usb force power off mechanism usb: Add usb port system pm support usb: register usb port to

[PATCH 1/4] usb: add usb_enable/disable_remote_wakeup()

2013-03-27 Thread Lan Tianyu
convienient to use and more readable. Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 136 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 7815462..6b7f5b9 100644 --- a

RE: USB port power-off and system suspend

2013-03-23 Thread Lan, Tianyu
qos request for NO_POWER_OFF flag? I'd like to see your opinion. I have a patch that can work and it still needs to add some condition checks in the usb_port_system_suspend(). Dev's system wakeup disable and persist enable. >From c3abd373707910672d6fd2e96da78879b3e22417 Mon Sep 17 0

[RFC PATCH] usb: register usb port to usb_bus_type

2013-03-21 Thread Lan Tianyu
port1-1.6 port2-1.5 port3-3 usb2 1-1.1:1.0 3-1 port1-1.2.2 port1-2port2-1.6 port3-4 usb3 1-1.2 3-1:1.0 port1-1.2.3 port2-1port2-1.7 port4-1 usb4 1-1.2:1.0 4-0:1.0 port1-1.2.4 port2-1.1 port2-1.8 port4-2 Signed-off-by: Lan Tianyu --- Documentation/ABI/testi

[Resend PATCH V2] usb: add usb_enable/disable_remote_wakeup()

2013-03-20 Thread Lan Tianyu
convienient to use and more readable. Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 136 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 5480352..56eea28 100644 --- a

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

2013-03-20 Thread Lan Tianyu
On 2013年03月21日 02:28, Sarah Sharp wrote: > On Wed, Mar 20, 2013 at 10:18:03AM +0800, Lan Tianyu wrote: >> On 2013年03月20日 03:06, Sarah Sharp wrote: >>> Ok, this looks sane, and our Intel testers report it doesn't oops like >>> v2. The patch description on t

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

2013-03-19 Thread Lan Tianyu
chs to 3.7, 3.8, 3.9 if possible. These patches also depend on the commit 1033f9041d "ACPI: Allow ACPI binding with USB-3.0 hub". I'd like to take the job if I could do. BTW, the sysfs files to turn on and off ports has been reverted by Greg in v3.7. > > Sarah Sharp > &

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

2013-03-19 Thread Lan Tianyu
extended capabilities table before binding. Signed-off-by: Lan Tianyu --- Change since v3: add a temprorary variable to recard raw port num and get ACPI handle rahter than overwrite port num with raw port num. This is to avoid passing raw port num as port num to

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

2013-03-19 Thread Lan Tianyu
touch bad ports above. Signed-off-by: Lan Tianyu --- This patchset is based on usb-next tree commit 3f3b55bf "usb: ehci-s5p: Use devm for requesting ehci_vbus_gpio". Change since v1: Don't export usb_hcd_find_raw_port_number() symbol since there is no its user o

Re: Testing for hardware bug in EHCI controllers

2013-03-04 Thread Lan Tianyu
2013/2/26 Alan Stern : > Sarah (and anyone else who's interested): > > A while ago I wrote about a hardware bug in my Intel ICH5 and ICH8 EHCI > controllers. You pointed out that these are rather old components, not > being used in current systems, which is quite true. > > Now I have figured out a

Re: [PATCH 4/5] usb: call pm_runtime_put_sync in pm_runtime_get_sync failed case

2013-02-28 Thread Lan Tianyu
On 2013年02月28日 15:57, Li Fei wrote: > > Even in failed case of pm_runtime_get_sync, the usage_count > is incremented. In order to keep the usage_count with correct > value and runtime power management to behave correctly, call > pm_runtime_put(_sync) in such case. Hi Fei: It's not necessa

Re: [Resend][PATCH] ACPI / glue: Drop .find_bridge() callback from struct acpi_bus_type

2013-02-27 Thread Lan Tianyu
't have a bus type defined, but have >>> usb_port_device_type as their device type. >> >> Ick, that's not good. Can you have the original creator of that code >> (someone else from Intel, I can't remember at the moment), fix that up >> properly and

Re: [GIT PATCH] USB patches for 3.9-rc1

2013-02-22 Thread Lan Tianyu
On 2013/2/23 1:20, Dave Jones wrote: On Sat, Feb 23, 2013 at 01:17:42AM +0800, Lan Tianyu wrote: > On 2013/2/23 1:14, Dave Jones wrote: > > On Sat, Feb 23, 2013 at 01:02:11AM +0800, Lan Tianyu wrote: > > > > > > > > What can I do to debug this ?

Re: [GIT PATCH] USB patches for 3.9-rc1

2013-02-22 Thread Lan Tianyu
On 2013/2/23 1:14, Dave Jones wrote: On Sat, Feb 23, 2013 at 01:02:11AM +0800, Lan Tianyu wrote: > > > > What can I do to debug this ? > > > Can you attach the output of dmesg with CONFIG_USB_DEBUG? > > > > http://paste.fedoraproject.org/3620

Re: [GIT PATCH] USB patches for 3.9-rc1

2013-02-22 Thread Lan Tianyu
On 2013/2/23 0:43, Dave Jones wrote: On Fri, Feb 22, 2013 at 05:51:10PM +0800, Lan Tianyu wrote: > > > Nothing major, lots of gadget fixes, and of course, xhci stuff. > > > > I get no USB devices recognised when I insert them any more, which > > I think is

Re: [GIT PATCH] USB patches for 3.9-rc1

2013-02-22 Thread Lan Tianyu
en I insert them any more, which I think is pretty major. I suspect it has something to do with this ? > Lan Tianyu (12): > usb: add runtime pm support for usb port device > usb: add usb port auto power off mechanism It looks like every port on my laptop is powered

Re: [GIT PATCH] USB patches for 3.9-rc1

2013-02-22 Thread Lan Tianyu
en I insert them any more, which I think is pretty major. I suspect it has something to do with this ? > Lan Tianyu (12): > usb: add runtime pm support for usb port device > usb: add usb port auto power off mechanism It looks like every port on my laptop is powered

Re: Not enough resource for old configuration after USB bus reset

2013-02-20 Thread Lan Tianyu
13 i686 i686 i386 GNU/Linux. > > I try the same operation to produce the issue, and it also fails. Please attach the output of dmesg with CONFIG_USB_DEBUG and XHCI_DEBUG. > > Thanks, > Soar > > -----Original Message- > From: Lan Tianyu [mailto:lantianyu1...@gmail.com] &g

Re: Not enough resource for old configuration after USB bus reset

2013-02-07 Thread Lan Tianyu
ernel, and test again? I think you can "git clone git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git" and "git checkout usb-next". Compile kernel and test it. Best regards, Soar -----Original Message- From: Lan Tianyu [mailto:lantianyu1...@gmail.com] Sent: Th

Re: Not enough resource for old configuration after USB bus reset

2013-02-07 Thread Lan Tianyu
2013/2/4 Soar Hung : > Hi Alan, Sarah, > > Thank you for your kindly help. > > Can I do something to provide some help? > You found the issue on the 3.0.30+ kernel. Can you test it on the usb-next branch of usb tree? Sarah has fixed a lot of bugs since v3.0. > Best regards, > Soar > > -Origina

[PATCH] Revert "usb: Register usb port's acpi power resources"

2013-01-28 Thread Lan Tianyu
send a new patch with new routines after 3.9 merge window. Signed-off-by: Lan Tianyu --- drivers/usb/core/port.c |6 -- drivers/usb/core/usb-acpi.c | 18 -- drivers/usb/core/usb.h |6 -- 3 files changed, 30 deletions(-) diff --git a/drivers/usb/core/port.c

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

2013-01-24 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 v3 1/2] usb: add find_raw_port_number callback to struct hc_driver()

2013-01-24 Thread Lan Tianyu
ad of scanning through the xHCI roothub port array in the xhci_find_real_port_number(). Signed-off-by: Lan Tianyu --- Change since v1: Don't export usb_hcd_find_raw_port_number() symbol since there is no its user outside of usb core. Change since v2: combine patch

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

2013-01-24 Thread Lan Tianyu
On 2013年01月25日 08:52, Sarah Sharp wrote: > Please combine this patch with patch three, so that I can clearly see > what is being replaced in xhci-mem.c:xhci_find_real_port_number. > Ok, I will refresh it soon. > Sarah Sharp > > On Sat, Jan 19, 2013 at 12:43:32AM +0800, Lan Tia

[PATCH v2 2/2] usb: add usb_enable/disable_remote_wakeup()

2013-01-23 Thread Lan Tianyu
convienient to use and more readable. Signed-off-by: Lan Tianyu --- Change since v1: remove usb_disable_function_remotewakeup() and call usb_control_msg() directly in the usb_disable_remote_wakeup() drivers/usb/core/hub.c | 136 1 file

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

2013-01-23 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 patchset is based on the usb-next tree commit d2123fd: "USB:

[Resend PATCH 2/2] usb: add usb_enable/disable_remote_wakeup()

2013-01-23 Thread Lan Tianyu
convienient to use and more readable. Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 115 +--- 1 file changed, 61 insertions(+), 54 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 29791a6..d04985b 100644 --- a

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

2013-01-23 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 patchset is based on the usb-next tree commit d2123fd: "USB:

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

2013-01-22 Thread Lan Tianyu
off and powered on. Acked-by: Alan Stern Acked-by: Rafael J. Wysocki Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 161 ++- drivers/usb/core/hub.h | 21 +++ drivers/usb/core/port.c | 40 +++- 3 files changed, 164 insertions

[PATCH v7 6/6] usb: enable usb port device's async suspend.

2013-01-22 Thread Lan Tianyu
main suspend/resume thread wait for their "asynchronous" children (during suspend) or parents (during resume), effectively negating the possible gains from executing these devices' suspend and resume callbacks asynchronously. Signed-off-by: Lan Tianyu --- drivers/usb/core/port.c |1

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

2013-01-22 Thread Lan Tianyu
active. Acked-by: Alan Stern Acked-by: Rafael J. Wysocki Signed-off-by: Lan Tianyu --- drivers/usb/core/hub.c | 27 +++ drivers/usb/core/hub.h |4 drivers/usb/core/port.c | 46 ++ 3 files changed, 77 insertions

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

2013-01-22 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. Acked-by: Alan Stern Signed-off-by: Lan Tianyu --- drivers/usb/core/port.c | 11 ++- 1

[PATCH v7 2/6] PM/Qos: Expose dev_pm_qos_flags symbol

2013-01-22 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 v7 1/6] usb: Register usb port's acpi power resources

2013-01-22 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 |5 + drivers/usb/core/usb-acpi.c | 18 ++ drivers/usb/core/

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

2013-01-22 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

Re: [PATCH v6 5/8] usb: add usb port auto power off mechanism

2013-01-22 Thread Lan Tianyu
On 2013/1/23 1:18, Greg KH wrote: On Wed, Jan 23, 2013 at 12:58:09AM +0800, Lan Tianyu wrote The above line, as written is under 80 characters, so I don't understand the issue. If I do following, scripts/checkpatch.pl will complain over 80 characters. @@ -3767,7 +3

Re: [PATCH v6 5/8] usb: add usb port auto power off mechanism

2013-01-22 Thread Lan Tianyu
On 2013/1/23 0:02, Greg KH wrote: On Tue, Jan 22, 2013 at 11:32:13PM +0800, Lan Tianyu wrote: On 2013/1/22 5:30, Greg KH wrote: On Mon, Jan 21, 2013 at 10:18:04PM +0800, Lan Tianyu wrote: @@ -127,7 +128,7 @@ static inline char *portspeed(struct usb_hub *hub, int portstatus) } /* Note

Re: [PATCH v6 7/8] usb: add usb_device_allow_power_off() and usb_device_prevent_power_off() function.

2013-01-22 Thread Lan Tianyu
On 2013/1/22 23:05, Greg KH wrote: On Tue, Jan 22, 2013 at 10:23:12PM +0800, Lan Tianyu wrote: On 2013/1/22 5:33, Greg KH wrote: On Mon, Jan 21, 2013 at 10:18:06PM +0800, Lan Tianyu wrote: Some usb devices can't be resumed correctly after power off. This patch is t

Re: [PATCH v6 5/8] usb: add usb port auto power off mechanism

2013-01-22 Thread Lan Tianyu
On 2013/1/22 5:30, Greg KH wrote: On Mon, Jan 21, 2013 at 10:18:04PM +0800, 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

Re: [PATCH v6 8/8] usb: enable usb port device's async suspend.

2013-01-22 Thread Lan Tianyu
On 2013/1/22 5:34, Greg KH wrote: On Mon, Jan 21, 2013 at 10:18:07PM +0800, Lan Tianyu wrote: Signed-off-by: Lan Tianyu Why are you doing this? Why is it now ok? We need a much better changelog entry here. Ok. I will add later. thanks, greg k-h -- Best Regards Tianyu Lan linux

Re: [PATCH v6 7/8] usb: add usb_device_allow_power_off() and usb_device_prevent_power_off() function.

2013-01-22 Thread Lan Tianyu
On 2013/1/22 5:33, Greg KH wrote: On Mon, Jan 21, 2013 at 10:18:06PM +0800, 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. Call pm_runtime_get_sy

Re: [PATCH v6 7/8] usb: add usb_device_allow_power_off() and usb_device_prevent_power_off() function.

2013-01-22 Thread Lan Tianyu
On 2013/1/22 5:33, Greg KH wrote: On Mon, Jan 21, 2013 at 10:18:06PM +0800, 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. Call pm_runtime_get_sy

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

2013-01-22 Thread Lan Tianyu
On 2013/1/22 5:31, Greg KH wrote: On Mon, Jan 21, 2013 at 10:18:05PM +0800, 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 powered off. Ho

Re: [PATCH v6 4/8] usb: add runtime pm support for usb port device

2013-01-21 Thread Lan Tianyu
On 2013年01月22日 05:24, Greg KH wrote: > On Mon, Jan 21, 2013 at 10:18:03PM +0800, 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 r

Re: [PATCH v6 2/8] usb: Register usb port's acpi power resources

2013-01-21 Thread Lan Tianyu
Hi Greg: Great thanks for your review. I learn a lot from your comments which I have not noticed before. On 2013年01月22日 05:20, Greg KH wrote: > On Mon, Jan 21, 2013 at 10:18:01PM +0800, Lan Tianyu wrote: >> This patch is to register usb port's acpi power resources. Create &

[PATCH v6 8/8] usb: enable usb port device's async suspend.

2013-01-21 Thread Lan Tianyu
Signed-off-by: Lan Tianyu --- drivers/usb/core/port.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index 0334d91..50b646e 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -215,7 +215,7 @@ int

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

2013-01-21 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. Acked-by: Alan Stern Signed-off-by: Lan Tianyu --- drivers/usb/core/port.c | 11 ++- 1

[PATCH v6 3/8] PM/Qos: Expose dev_pm_qos_flags symbol

2013-01-21 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 v6 4/8] usb: add runtime pm support for usb port device

2013-01-21 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 v6 2/8] usb: Register usb port's acpi power resources

2013-01-21 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 V6 0/8] usb: usb port power off mechanism and expose usb port connect type

2013-01-21 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 v6 1/8] USB: Set usb port's DeviceRemovable according acpi information

2013-01-21 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

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

2013-01-20 Thread Lan Tianyu
2013/1/21 Greg KH > > On Sun, Jan 20, 2013 at 01:53:29AM +0800, Lan Tianyu wrote: > > Change since v5: > > use EXPORT_SYMBOL_GPL to export dev_pm_qos_flags(). > > correct some unnecessary link breaks. > > Add CONFIG_USB_SUSPEND check around

[PATCH v5 10/10] usb: enable usb port device's async suspend.

2013-01-19 Thread Lan Tianyu
Signed-off-by: Lan Tianyu --- drivers/usb/core/port.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index 0334d91..50b646e 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -215,7 +215,7 @@ int

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

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

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

2013-01-19 Thread Lan Tianyu
ice will not be powered off. Acked-by: Alan Stern Signed-off-by: Lan Tianyu --- drivers/usb/core/port.c | 28 1 file changed, 28 insertions(+) diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index 0c51d24..0334d91 100644 --- a/drivers/usb/core/port.c ++

[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

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

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

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

[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

[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

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

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

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

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

  1   2   3   4   >