* [RFT]patch to remove kernel thread for runtime pm from usbhid
@ 2010-10-12 8:00 Oliver Neukum
[not found] ` <201010121000.50465.oneukum-l3A5Bk7waGM@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Oliver Neukum @ 2010-10-12 8:00 UTC (permalink / raw)
To: linux-input, linux-pm, USB list
Hi,
this patch saves a kernel thread. It works with my mouse. Please test.
Regards
Oliver
>From 89cb25b186e336c04f74165f08bca6c934ebdfad Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oliver@neukum.org>
Date: Tue, 12 Oct 2010 09:28:11 +0200
Subject: [PATCH] Input: usbhid: convert runtime pm to async API
This patch removes the dedicated work queue and thus the kernel thread
used to wake up USB HID devices. It is replaced with the use of
the async API which didn't exist when runtime pm was introduced to
usbhid.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
---
Makefile | 2 +-
drivers/hid/usbhid/hid-core.c | 57 +++++++++++++---------------------------
drivers/hid/usbhid/usbhid.h | 1 -
drivers/usb/core/usb.h | 13 +++++++++
4 files changed, 33 insertions(+), 40 deletions(-)
diff --git a/Makefile b/Makefile
index 77b5c6e..f610e8c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 36
-EXTRAVERSION = -rc7
+EXTRAVERSION = -rc7hid
NAME = Sheep on Meth
# *DOCUMENTATION*
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 599041a..8e7f785 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -67,7 +67,6 @@ MODULE_PARM_DESC(quirks, "Add/modify USB HID quirks by specifying "
* Input submission and I/O error handler.
*/
static DEFINE_MUTEX(hid_open_mut);
-static struct workqueue_struct *resumption_waker;
static void hid_io_error(struct hid_device *hid);
static int hid_submit_out(struct hid_device *hid);
@@ -300,10 +299,19 @@ static int hid_submit_out(struct hid_device *hid)
struct hid_report *report;
char *raw_report;
struct usbhid_device *usbhid = hid->driver_data;
+ int r;
report = usbhid->out[usbhid->outtail].report;
raw_report = usbhid->out[usbhid->outtail].raw_report;
+ r = usb_autopm_get_interface_async(usbhid->intf);
+ if (r < 0)
+ return -1;
+
+ /*
+ * if the device hasn't been woken, we leave the output
+ * to resume()
+ */
if (!test_bit(HID_REPORTED_IDLE, &usbhid->iofl)) {
usbhid->urbout->transfer_buffer_length = ((report->size - 1) >> 3) + 1 + (report->id > 0);
usbhid->urbout->dev = hid_to_usb_dev(hid);
@@ -314,16 +322,10 @@ static int hid_submit_out(struct hid_device *hid)
if (usb_submit_urb(usbhid->urbout, GFP_ATOMIC)) {
err_hid("usb_submit_urb(out) failed");
+ usb_autopm_put_interface_async(usbhid->intf);
return -1;
}
usbhid->last_out = jiffies;
- } else {
- /*
- * queue work to wake up the device.
- * as the work queue is freezeable, this is safe
- * with respect to STD and STR
- */
- queue_work(resumption_waker, &usbhid->restart_work);
}
return 0;
@@ -334,13 +336,16 @@ static int hid_submit_ctrl(struct hid_device *hid)
struct hid_report *report;
unsigned char dir;
char *raw_report;
- int len;
+ int len, r;
struct usbhid_device *usbhid = hid->driver_data;
report = usbhid->ctrl[usbhid->ctrltail].report;
raw_report = usbhid->ctrl[usbhid->ctrltail].raw_report;
dir = usbhid->ctrl[usbhid->ctrltail].dir;
+ r = usb_autopm_get_interface_async(usbhid->intf);
+ if (r < 0)
+ return -1;
if (!test_bit(HID_REPORTED_IDLE, &usbhid->iofl)) {
len = ((report->size - 1) >> 3) + 1 + (report->id > 0);
if (dir == USB_DIR_OUT) {
@@ -375,17 +380,11 @@ static int hid_submit_ctrl(struct hid_device *hid)
usbhid->cr->wValue, usbhid->cr->wIndex, usbhid->cr->wLength);
if (usb_submit_urb(usbhid->urbctrl, GFP_ATOMIC)) {
+ usb_autopm_put_interface_async(usbhid->intf);
err_hid("usb_submit_urb(ctrl) failed");
return -1;
}
usbhid->last_ctrl = jiffies;
- } else {
- /*
- * queue work to wake up the device.
- * as the work queue is freezeable, this is safe
- * with respect to STD and STR
- */
- queue_work(resumption_waker, &usbhid->restart_work);
}
return 0;
@@ -435,6 +434,7 @@ static void hid_irq_out(struct urb *urb)
clear_bit(HID_OUT_RUNNING, &usbhid->iofl);
spin_unlock_irqrestore(&usbhid->lock, flags);
+ usb_autopm_put_interface_async(usbhid->intf);
wake_up(&usbhid->wait);
}
@@ -481,11 +481,13 @@ static void hid_ctrl(struct urb *urb)
wake_up(&usbhid->wait);
}
spin_unlock(&usbhid->lock);
+ usb_autopm_put_interface_async(usbhid->intf);
return;
}
clear_bit(HID_CTRL_RUNNING, &usbhid->iofl);
spin_unlock(&usbhid->lock);
+ usb_autopm_put_interface_async(usbhid->intf);
wake_up(&usbhid->wait);
}
@@ -656,7 +658,7 @@ int usbhid_open(struct hid_device *hid)
mutex_lock(&hid_open_mut);
if (!hid->open++) {
res = usb_autopm_get_interface(usbhid->intf);
- /* the device must be awake to reliable request remote wakeup */
+ /* the device must be awake to reliably request remote wakeup */
if (res < 0) {
hid->open--;
mutex_unlock(&hid_open_mut);
@@ -856,18 +858,6 @@ static void usbhid_restart_queues(struct usbhid_device *usbhid)
usbhid_restart_ctrl_queue(usbhid);
}
-static void __usbhid_restart_queues(struct work_struct *work)
-{
- struct usbhid_device *usbhid =
- container_of(work, struct usbhid_device, restart_work);
- int r;
-
- r = usb_autopm_get_interface(usbhid->intf);
- if (r < 0)
- return;
- usb_autopm_put_interface(usbhid->intf);
-}
-
static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid)
{
struct usbhid_device *usbhid = hid->driver_data;
@@ -1205,7 +1195,6 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *
init_waitqueue_head(&usbhid->wait);
INIT_WORK(&usbhid->reset_work, hid_reset);
- INIT_WORK(&usbhid->restart_work, __usbhid_restart_queues);
setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid);
spin_lock_init(&usbhid->lock);
@@ -1240,7 +1229,6 @@ static void usbhid_disconnect(struct usb_interface *intf)
static void hid_cancel_delayed_stuff(struct usbhid_device *usbhid)
{
del_timer_sync(&usbhid->io_retry);
- cancel_work_sync(&usbhid->restart_work);
cancel_work_sync(&usbhid->reset_work);
}
@@ -1261,7 +1249,6 @@ static int hid_pre_reset(struct usb_interface *intf)
spin_lock_irq(&usbhid->lock);
set_bit(HID_RESET_PENDING, &usbhid->iofl);
spin_unlock_irq(&usbhid->lock);
- cancel_work_sync(&usbhid->restart_work);
hid_cease_io(usbhid);
return 0;
@@ -1460,9 +1447,6 @@ static int __init hid_init(void)
{
int retval = -ENOMEM;
- resumption_waker = create_freezeable_workqueue("usbhid_resumer");
- if (!resumption_waker)
- goto no_queue;
retval = hid_register_driver(&hid_usb_driver);
if (retval)
goto hid_register_fail;
@@ -1485,8 +1469,6 @@ hiddev_init_fail:
usbhid_quirks_init_fail:
hid_unregister_driver(&hid_usb_driver);
hid_register_fail:
- destroy_workqueue(resumption_waker);
-no_queue:
return retval;
}
@@ -1496,7 +1478,6 @@ static void __exit hid_exit(void)
hiddev_exit();
usbhid_quirks_exit();
hid_unregister_driver(&hid_usb_driver);
- destroy_workqueue(resumption_waker);
}
module_init(hid_init);
diff --git a/drivers/hid/usbhid/usbhid.h b/drivers/hid/usbhid/usbhid.h
index 89d2e84..1673cac 100644
--- a/drivers/hid/usbhid/usbhid.h
+++ b/drivers/hid/usbhid/usbhid.h
@@ -95,7 +95,6 @@ struct usbhid_device {
unsigned long stop_retry; /* Time to give up, in jiffies */
unsigned int retry_delay; /* Delay length in ms */
struct work_struct reset_work; /* Task context for resets */
- struct work_struct restart_work; /* waking up for output to be done in a task */
wait_queue_head_t wait; /* For sleeping */
int ledcount; /* counting the number of active leds */
};
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index cd88220..fbb988a 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -124,6 +124,19 @@ static inline int is_usb_device_driver(struct device_driver *drv)
for_devices;
}
+/* translate USB error codes to codes user space understands */
+static inline int usb_translate_errors(int error_code)
+{
+ switch (error_code) {
+ case 0:
+ case -ENOMEM:
+ case -ENODEV:
+ return error_code;
+ default:
+ return -EIO;
+ }
+}
+
/* for labeling diagnostics */
extern const char *usbcore_name;
--
1.7.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [RFT]patch to remove kernel thread for runtime pm from usbhid
[not found] ` <201010121000.50465.oneukum-l3A5Bk7waGM@public.gmane.org>
@ 2010-10-12 11:34 ` Maulik Mankad
[not found] ` <AANLkTi=AWMWPH7N035n0Tk+8PcWgu10LzGbLQfpSefO1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Maulik Mankad @ 2010-10-12 11:34 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-input, linux-pm-u79uwXL29TY76Z2rM5mHXA, USB list
On Tue, Oct 12, 2010 at 1:30 PM, Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org> wrote:
> Hi,
>
> this patch saves a kernel thread. It works with my mouse. Please test.
>
> Regards
> Oliver
>
> From 89cb25b186e336c04f74165f08bca6c934ebdfad Mon Sep 17 00:00:00 2001
> From: Oliver Neukum <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
> Date: Tue, 12 Oct 2010 09:28:11 +0200
> Subject: [PATCH] Input: usbhid: convert runtime pm to async API
>
> This patch removes the dedicated work queue and thus the kernel thread
> used to wake up USB HID devices. It is replaced with the use of
> the async API which didn't exist when runtime pm was introduced to
> usbhid.
>
> Signed-off-by: Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org>
> ---
Tested on OMAP4 SDP with USB Keyboard and USB Mouse using 'evtest' program.
Works fine.
Regards,
Maulik
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFT]patch to remove kernel thread for runtime pm from usbhid
[not found] ` <AANLkTi=AWMWPH7N035n0Tk+8PcWgu10LzGbLQfpSefO1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-10-12 11:39 ` Oliver Neukum
2010-10-12 12:10 ` Maulik Mankad
0 siblings, 1 reply; 10+ messages in thread
From: Oliver Neukum @ 2010-10-12 11:39 UTC (permalink / raw)
To: Maulik Mankad; +Cc: linux-input, linux-pm-u79uwXL29TY76Z2rM5mHXA, USB list
Am Dienstag, 12. Oktober 2010, 13:34:33 schrieb Maulik Mankad:
> On Tue, Oct 12, 2010 at 1:30 PM, Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org> wrote:
> > This patch removes the dedicated work queue and thus the kernel thread
> > used to wake up USB HID devices. It is replaced with the use of
> > the async API which didn't exist when runtime pm was introduced to
> > usbhid.
> >
> > Signed-off-by: Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org>
> > ---
>
> Tested on OMAP4 SDP with USB Keyboard and USB Mouse using 'evtest' program.
Thank you. Do both devices support remote wakeup? How much sleep time
was generated?
Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFT]patch to remove kernel thread for runtime pm from usbhid
2010-10-12 11:39 ` Oliver Neukum
@ 2010-10-12 12:10 ` Maulik Mankad
2010-10-12 14:40 ` Oliver Neukum
0 siblings, 1 reply; 10+ messages in thread
From: Maulik Mankad @ 2010-10-12 12:10 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-input, linux-pm, USB list
On Tue, Oct 12, 2010 at 5:09 PM, Oliver Neukum <oneukum@suse.de> wrote:
> Am Dienstag, 12. Oktober 2010, 13:34:33 schrieb Maulik Mankad:
>> On Tue, Oct 12, 2010 at 1:30 PM, Oliver Neukum <oneukum@suse.de> wrote:
>
>> > This patch removes the dedicated work queue and thus the kernel thread
>> > used to wake up USB HID devices. It is replaced with the use of
>> > the async API which didn't exist when runtime pm was introduced to
>> > usbhid.
>> >
>> > Signed-off-by: Oliver Neukum <oneukum@suse.de>
>> > ---
>>
>> Tested on OMAP4 SDP with USB Keyboard and USB Mouse using 'evtest' program.
>
> Thank you. Do both devices support remote wakeup? How much sleep time
> was generated?
>
Reading the wakeup node (as below) shows that its enabled.
cat /sys/bus/usb/devices/1-1/manufacturer
Dell
# cat /sys/bus/usb/devices/1-1/power/wakeup
enabled
My test was basically using the HID device post enumeration, and make
sure that data transfers work reliably.
I can test more if you provide steps as per your need.
Regards,
Maulik
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFT]patch to remove kernel thread for runtime pm from usbhid
2010-10-12 14:40 ` Oliver Neukum
@ 2010-10-12 12:59 ` Maulik Mankad
2010-10-12 13:39 ` Maulik Mankad
0 siblings, 1 reply; 10+ messages in thread
From: Maulik Mankad @ 2010-10-12 12:59 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-input, USB list
On Tue, Oct 12, 2010 at 8:10 PM, Oliver Neukum <oneukum@suse.de> wrote:
> Am Dienstag, 12. Oktober 2010, 14:10:42 schrieb Maulik Mankad:
>> On Tue, Oct 12, 2010 at 5:09 PM, Oliver Neukum <oneukum@suse.de> wrote:
>
>> > Thank you. Do both devices support remote wakeup? How much sleep time
>> > was generated?
>> >
>>
>> Reading the wakeup node (as below) shows that its enabled.
>>
>> cat /sys/bus/usb/devices/1-1/manufacturer
>> Dell
>>
>> # cat /sys/bus/usb/devices/1-1/power/wakeup
>> enabled
>>
>> My test was basically using the HID device post enumeration, and make
>> sure that data transfers work reliably.
>>
>> I can test more if you provide steps as per your need.
>
> Very good! Please do a
> echo "auto" >/sys/bus/usb/devices/1-1/power/level
> and do the test. After that I'd like to have the content of
> active_duration connected_duration runtime_active_time runtime_enabled runtime_status runtime_suspended_time runtime_usage wakeup_count
> in /sys/bus/usb/devices/1-1/power/
Below are some logs from my tests. I gave below two commands to suspend the bus.
(1) echo 0 > /sys/bus/usb/devices/1-1/power/autosuspend
(2) echo auto > /sys/bus/usb/devices/1-1/power/control
==========================================
usb usb1: usb wakeup-resume
usb usb1: usb auto-resume
hub 1-0:1.0: hub_resume
hub 1-0:1.0: port 1: status 0303 change 0004
hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000
usb 1-1: usb wakeup-resume
usb 1-1: finish resume
usb 1-1: usb auto-suspend
hub 1-0:1.0: resume on port 1, status 0
hub 1-0:1.0: port 1, status 0303, change 0004, 1.5 Mb/s
hub 1-0:1.0: hub_suspend
usb usb1: bus auto-suspend
musb_bus_suspend 2311: trying to suspend as a_host while active
usb usb1: bus suspend fail, err -16
hub 1-0:1.0: hub_resume
hub 1-0:1.0: port 1: status 0303 change 0004
hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000
usb 1-1: usb wakeup-resume
usb 1-1: finish resume
usb 1-1: usb auto-suspend
hub 1-0:1.0: resume on port 1, status 0
hub 1-0:1.0: port 1, status 0303, change 0004, 1.5 Mb/s
hub 1-0:1.0: hub_suspend
usb usb1: bus auto-suspend
musb_bus_suspend 2311: trying to suspend as a_host while active
usb usb1: bus suspend fail, err -16
hub 1-0:1.0: hub_resume
hub 1-0:1.0: port 1: status 0303 change 0004
hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000
usb 1-1: usb wakeup-resume
usb 1-1: finish resume
usb 1-1: usb auto-suspend
hub 1-0:1.0: resume on port 1, status 0
hub 1-0:1.0: port 1, status 0303, change 0004, 1.5 Mb/s
========================================================
Note that the bus keeps suspending and when I press a key on the
keyboard I see logs related to wakeup-resume.
Also I see the below entries under /sys/bus/usb/devices/1-1/power/
ls /sys/bus/usb/devices/1-1/power/
active_duration connected_duration level wakeup
autosuspend control persist
cat /sys/bus/usb/devices/1-1/power/active_duration
64289
cat /sys/bus/usb/devices/1-1/power/connected_duration
224015
cat /sys/bus/usb/devices/1-1/power/persist
1
cat /sys/bus/usb/devices/1-1/power/control
auto
I don't see the runtime entries. Any idea why is this so? I have
applied your patch to 2.6.35 kernel where my device works.
Has this something to do with the kernel version I am using / some
option to be turned on in menuconfig?
Regards,
Maulik
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFT]patch to remove kernel thread for runtime pm from usbhid
2010-10-12 12:59 ` Maulik Mankad
@ 2010-10-12 13:39 ` Maulik Mankad
[not found] ` <AANLkTin7k23LbW4Lj7qJM=FZLn+AbqEJYpm_ycVUBLFa-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Maulik Mankad @ 2010-10-12 13:39 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-input, USB list
On Tue, Oct 12, 2010 at 6:29 PM, Maulik Mankad <mankad.maulik@gmail.com> wrote:
> On Tue, Oct 12, 2010 at 8:10 PM, Oliver Neukum <oneukum@suse.de> wrote:
>> Am Dienstag, 12. Oktober 2010, 14:10:42 schrieb Maulik Mankad:
>>> On Tue, Oct 12, 2010 at 5:09 PM, Oliver Neukum <oneukum@suse.de> wrote:
>>
>>> > Thank you. Do both devices support remote wakeup? How much sleep time
>>> > was generated?
>>> >
>>>
>>> Reading the wakeup node (as below) shows that its enabled.
>>>
>>> cat /sys/bus/usb/devices/1-1/manufacturer
>>> Dell
>>>
>>> # cat /sys/bus/usb/devices/1-1/power/wakeup
>>> enabled
>>>
>>> My test was basically using the HID device post enumeration, and make
>>> sure that data transfers work reliably.
>>>
>>> I can test more if you provide steps as per your need.
>>
>> Very good! Please do a
>> echo "auto" >/sys/bus/usb/devices/1-1/power/level
>> and do the test. After that I'd like to have the content of
>> active_duration connected_duration runtime_active_time runtime_enabled runtime_status runtime_suspended_time runtime_usage wakeup_count
>> in /sys/bus/usb/devices/1-1/power/
>
> Below are some logs from my tests. I gave below two commands to suspend the bus.
>
> (1) echo 0 > /sys/bus/usb/devices/1-1/power/autosuspend
>
> (2) echo auto > /sys/bus/usb/devices/1-1/power/control
> ==========================================
> usb usb1: usb wakeup-resume
> usb usb1: usb auto-resume
> hub 1-0:1.0: hub_resume
> hub 1-0:1.0: port 1: status 0303 change 0004
> hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000
> usb 1-1: usb wakeup-resume
> usb 1-1: finish resume
> usb 1-1: usb auto-suspend
> hub 1-0:1.0: resume on port 1, status 0
> hub 1-0:1.0: port 1, status 0303, change 0004, 1.5 Mb/s
> hub 1-0:1.0: hub_suspend
> usb usb1: bus auto-suspend
> musb_bus_suspend 2311: trying to suspend as a_host while active
> usb usb1: bus suspend fail, err -16
> hub 1-0:1.0: hub_resume
> hub 1-0:1.0: port 1: status 0303 change 0004
> hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000
> usb 1-1: usb wakeup-resume
> usb 1-1: finish resume
> usb 1-1: usb auto-suspend
> hub 1-0:1.0: resume on port 1, status 0
> hub 1-0:1.0: port 1, status 0303, change 0004, 1.5 Mb/s
> hub 1-0:1.0: hub_suspend
> usb usb1: bus auto-suspend
> musb_bus_suspend 2311: trying to suspend as a_host while active
> usb usb1: bus suspend fail, err -16
> hub 1-0:1.0: hub_resume
> hub 1-0:1.0: port 1: status 0303 change 0004
> hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000
> usb 1-1: usb wakeup-resume
> usb 1-1: finish resume
> usb 1-1: usb auto-suspend
> hub 1-0:1.0: resume on port 1, status 0
> hub 1-0:1.0: port 1, status 0303, change 0004, 1.5 Mb/s
> ========================================================
>
> Note that the bus keeps suspending and when I press a key on the
> keyboard I see logs related to wakeup-resume.
>
> Also I see the below entries under /sys/bus/usb/devices/1-1/power/
>
> ls /sys/bus/usb/devices/1-1/power/
> active_duration connected_duration level wakeup
> autosuspend control persist
>
> cat /sys/bus/usb/devices/1-1/power/active_duration
> 64289
>
> cat /sys/bus/usb/devices/1-1/power/connected_duration
> 224015
>
> cat /sys/bus/usb/devices/1-1/power/persist
> 1
>
> cat /sys/bus/usb/devices/1-1/power/control
> auto
>
> I don't see the runtime entries. Any idea why is this so? I have
> applied your patch to 2.6.35 kernel where my device works.
>
> Has this something to do with the kernel version I am using / some
> option to be turned on in menuconfig?
>
Seems like the below commit added that support to sysfs.
commit 8d4b9d1bfef117862a2889dec4dac227068544c9
Author: Arjan van de Ven <arjan@linux.intel.com>
Date: Mon Jul 19 02:01:06 2010 +0200
PM / Runtime: Add runtime PM statistics (v3)
I will see if I can apply this to my kernel and provide the stats you need.
Regards,
Maulik
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFT]patch to remove kernel thread for runtime pm from usbhid
[not found] ` <AANLkTin7k23LbW4Lj7qJM=FZLn+AbqEJYpm_ycVUBLFa-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-10-12 14:26 ` Maulik Mankad
2010-10-12 14:29 ` Oliver Neukum
0 siblings, 1 reply; 10+ messages in thread
From: Maulik Mankad @ 2010-10-12 14:26 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-input, USB list
On Tue, Oct 12, 2010 at 7:09 PM, Maulik Mankad <mankad.maulik-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Seems like the below commit added that support to sysfs.
>
> commit 8d4b9d1bfef117862a2889dec4dac227068544c9
> Author: Arjan van de Ven <arjan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
> Date: Mon Jul 19 02:01:06 2010 +0200
>
> PM / Runtime: Add runtime PM statistics (v3)
>
> I will see if I can apply this to my kernel and provide the stats you need.
>
I applied the relevant patches to 2.6.35 related to runtime PM and
collected the below statistics.
cat /sys/bus/usb/devices/1-1/power/active_duration
120609
cat /sys/bus/usb/devices/1-1/power/autosuspend
0
cat /sys/bus/usb/devices/1-1/power/connected_duration
220398
cat /sys/bus/usb/devices/1-1/power/control
auto
cat /sys/bus/usb/devices/1-1/power/level
auto
cat /sys/bus/usb/devices/1-1/power/persist
1
cat /sys/bus/usb/devices/1-1/power/runtime_active_time
120523
cat /sys/bus/usb/devices/1-1/power/runtime_status
suspended
cat /sys/bus/usb/devices/1-1/power/runtime_suspended_time
159773
cat /sys/bus/usb/devices/1-1/power/wakeup
enabled
cat /sys/bus/usb/devices/1-1/power/wakeup_count
0
I am not familiar with the runtime pm statistics and can't interpret
the above values.
Let me know if this information is helpful and if you need anything else.
Regards,
Maulik
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFT]patch to remove kernel thread for runtime pm from usbhid
2010-10-12 14:26 ` Maulik Mankad
@ 2010-10-12 14:29 ` Oliver Neukum
2010-10-12 14:32 ` Maulik Mankad
0 siblings, 1 reply; 10+ messages in thread
From: Oliver Neukum @ 2010-10-12 14:29 UTC (permalink / raw)
To: Maulik Mankad; +Cc: linux-input, USB list
Am Dienstag, 12. Oktober 2010, 16:26:28 schrieb Maulik Mankad:
> I am not familiar with the runtime pm statistics and can't interpret
> the above values.
>
> Let me know if this information is helpful and if you need anything else.
>
Perfect. It works as it should. May I add your tested-by line?
Thank you
Oliver
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFT]patch to remove kernel thread for runtime pm from usbhid
2010-10-12 14:29 ` Oliver Neukum
@ 2010-10-12 14:32 ` Maulik Mankad
0 siblings, 0 replies; 10+ messages in thread
From: Maulik Mankad @ 2010-10-12 14:32 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-input, USB list
On Tue, Oct 12, 2010 at 7:59 PM, Oliver Neukum <oneukum@suse.de> wrote:
> Am Dienstag, 12. Oktober 2010, 16:26:28 schrieb Maulik Mankad:
>> I am not familiar with the runtime pm statistics and can't interpret
>> the above values.
>>
>> Let me know if this information is helpful and if you need anything else.
>>
>
> Perfect. It works as it should. May I add your tested-by line?
>
Thanks.Yes please.
Tested-by: Maulik Mankad <x0082077@ti.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFT]patch to remove kernel thread for runtime pm from usbhid
2010-10-12 12:10 ` Maulik Mankad
@ 2010-10-12 14:40 ` Oliver Neukum
2010-10-12 12:59 ` Maulik Mankad
0 siblings, 1 reply; 10+ messages in thread
From: Oliver Neukum @ 2010-10-12 14:40 UTC (permalink / raw)
To: Maulik Mankad; +Cc: linux-input, USB list
Am Dienstag, 12. Oktober 2010, 14:10:42 schrieb Maulik Mankad:
> On Tue, Oct 12, 2010 at 5:09 PM, Oliver Neukum <oneukum@suse.de> wrote:
> > Thank you. Do both devices support remote wakeup? How much sleep time
> > was generated?
> >
>
> Reading the wakeup node (as below) shows that its enabled.
>
> cat /sys/bus/usb/devices/1-1/manufacturer
> Dell
>
> # cat /sys/bus/usb/devices/1-1/power/wakeup
> enabled
>
> My test was basically using the HID device post enumeration, and make
> sure that data transfers work reliably.
>
> I can test more if you provide steps as per your need.
Very good! Please do a
echo "auto" >/sys/bus/usb/devices/1-1/power/level
and do the test. After that I'd like to have the content of
active_duration connected_duration runtime_active_time runtime_enabled runtime_status runtime_suspended_time runtime_usage wakeup_count
in /sys/bus/usb/devices/1-1/power/
Regards
Oliver
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-10-12 14:32 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-12 8:00 [RFT]patch to remove kernel thread for runtime pm from usbhid Oliver Neukum
[not found] ` <201010121000.50465.oneukum-l3A5Bk7waGM@public.gmane.org>
2010-10-12 11:34 ` Maulik Mankad
[not found] ` <AANLkTi=AWMWPH7N035n0Tk+8PcWgu10LzGbLQfpSefO1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-12 11:39 ` Oliver Neukum
2010-10-12 12:10 ` Maulik Mankad
2010-10-12 14:40 ` Oliver Neukum
2010-10-12 12:59 ` Maulik Mankad
2010-10-12 13:39 ` Maulik Mankad
[not found] ` <AANLkTin7k23LbW4Lj7qJM=FZLn+AbqEJYpm_ycVUBLFa-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-12 14:26 ` Maulik Mankad
2010-10-12 14:29 ` Oliver Neukum
2010-10-12 14:32 ` Maulik Mankad
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).