mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
usb: move hub init and LED blink work to power efficient workqueue
Allow the scheduler to select the best CPU to handle hub initalization and LED blinking work. This extends idle residency times on idle CPUs and conserves power. This functionality is enabled when CONFIG_WQ_POWER_EFFICIENT is selected. [zoran.markovic@linaro.org: Rebased to latest kernel. Added commit message. Changed reference from system to power efficient workqueue for LEDs in check_highspeed() and hub_port_connect_change().] Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Xenia Ragiadakou <burzalodowa@gmail.com> Cc: Julius Werner <jwerner@chromium.org> Cc: Krzysztof Mazur <krzysiek@podlesie.net> Cc: Matthias Beyer <mail@beyermatthias.de> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Mathias Nyman <mathias.nyman@linux.intel.com> Cc: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Shaibal Dutta <shaibal.dutta@broadcom.com> Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cdc0f46618
commit
f6ff72282a
1 changed files with 13 additions and 6 deletions
|
@ -511,7 +511,8 @@ static void led_work (struct work_struct *work)
|
|||
changed++;
|
||||
}
|
||||
if (changed)
|
||||
schedule_delayed_work(&hub->leds, LED_CYCLE_PERIOD);
|
||||
queue_delayed_work(system_power_efficient_wq,
|
||||
&hub->leds, LED_CYCLE_PERIOD);
|
||||
}
|
||||
|
||||
/* use a short timeout for hub/port status fetches */
|
||||
|
@ -1085,7 +1086,8 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
|
|||
goto init2;
|
||||
#endif
|
||||
PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func2);
|
||||
schedule_delayed_work(&hub->init_work,
|
||||
queue_delayed_work(system_power_efficient_wq,
|
||||
&hub->init_work,
|
||||
msecs_to_jiffies(delay));
|
||||
|
||||
/* Suppress autosuspend until init is done */
|
||||
|
@ -1257,7 +1259,8 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
|
|||
/* Don't do a long sleep inside a workqueue routine */
|
||||
if (type == HUB_INIT2) {
|
||||
PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func3);
|
||||
schedule_delayed_work(&hub->init_work,
|
||||
queue_delayed_work(system_power_efficient_wq,
|
||||
&hub->init_work,
|
||||
msecs_to_jiffies(delay));
|
||||
device_unlock(hub->intfdev);
|
||||
return; /* Continues at init3: below */
|
||||
|
@ -1272,7 +1275,8 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
|
|||
if (status < 0)
|
||||
dev_err(hub->intfdev, "activate --> %d\n", status);
|
||||
if (hub->has_indicators && blinkenlights)
|
||||
schedule_delayed_work(&hub->leds, LED_CYCLE_PERIOD);
|
||||
queue_delayed_work(system_power_efficient_wq,
|
||||
&hub->leds, LED_CYCLE_PERIOD);
|
||||
|
||||
/* Scan all ports that need attention */
|
||||
kick_khubd(hub);
|
||||
|
@ -4508,7 +4512,8 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1)
|
|||
/* hub LEDs are probably harder to miss than syslog */
|
||||
if (hub->has_indicators) {
|
||||
hub->indicator[port1-1] = INDICATOR_GREEN_BLINK;
|
||||
schedule_delayed_work (&hub->leds, 0);
|
||||
queue_delayed_work(system_power_efficient_wq,
|
||||
&hub->leds, 0);
|
||||
}
|
||||
}
|
||||
kfree(qual);
|
||||
|
@ -4737,7 +4742,9 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
|
|||
if (hub->has_indicators) {
|
||||
hub->indicator[port1-1] =
|
||||
INDICATOR_AMBER_BLINK;
|
||||
schedule_delayed_work (&hub->leds, 0);
|
||||
queue_delayed_work(
|
||||
system_power_efficient_wq,
|
||||
&hub->leds, 0);
|
||||
}
|
||||
status = -ENOTCONN; /* Don't retry */
|
||||
goto loop_disable;
|
||||
|
|
Loading…
Reference in a new issue