Commit 67235cbc authored by Shaibal Dutta's avatar Shaibal Dutta Committed by Johannes Berg

net: rfkill: move poll work to power efficient workqueue

This patch moves the rfkill poll_work to the power efficient workqueue.
This work does not have to be bound to the CPU that scheduled it, hence
the selection of CPU that executes it would be left to the scheduler.
Net result is that CPU idle times would be extended, resulting in power
savings.

This behaviour is enabled when CONFIG_WQ_POWER_EFFICIENT is selected.

Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: default avatarShaibal Dutta <shaibal.dutta@broadcom.com>
[zoran.markovic@linaro.org: Rebased to latest kernel, added commit message.
Fixed workqueue selection after suspend/resume cycle.]
Signed-off-by: default avatarZoran Markovic <zoran.markovic@linaro.org>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 845f3351
...@@ -789,7 +789,8 @@ void rfkill_resume_polling(struct rfkill *rfkill) ...@@ -789,7 +789,8 @@ void rfkill_resume_polling(struct rfkill *rfkill)
if (!rfkill->ops->poll) if (!rfkill->ops->poll)
return; return;
schedule_work(&rfkill->poll_work.work); queue_delayed_work(system_power_efficient_wq,
&rfkill->poll_work, 0);
} }
EXPORT_SYMBOL(rfkill_resume_polling); EXPORT_SYMBOL(rfkill_resume_polling);
...@@ -894,7 +895,8 @@ static void rfkill_poll(struct work_struct *work) ...@@ -894,7 +895,8 @@ static void rfkill_poll(struct work_struct *work)
*/ */
rfkill->ops->poll(rfkill, rfkill->data); rfkill->ops->poll(rfkill, rfkill->data);
schedule_delayed_work(&rfkill->poll_work, queue_delayed_work(system_power_efficient_wq,
&rfkill->poll_work,
round_jiffies_relative(POLL_INTERVAL)); round_jiffies_relative(POLL_INTERVAL));
} }
...@@ -958,7 +960,8 @@ int __must_check rfkill_register(struct rfkill *rfkill) ...@@ -958,7 +960,8 @@ int __must_check rfkill_register(struct rfkill *rfkill)
INIT_WORK(&rfkill->sync_work, rfkill_sync_work); INIT_WORK(&rfkill->sync_work, rfkill_sync_work);
if (rfkill->ops->poll) if (rfkill->ops->poll)
schedule_delayed_work(&rfkill->poll_work, queue_delayed_work(system_power_efficient_wq,
&rfkill->poll_work,
round_jiffies_relative(POLL_INTERVAL)); round_jiffies_relative(POLL_INTERVAL));
if (!rfkill->persistent || rfkill_epo_lock_active) { if (!rfkill->persistent || rfkill_epo_lock_active) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment