From patchwork Thu Jan 30 22:43:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoran Markovic X-Patchwork-Id: 23938 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CBA1520341 for ; Thu, 30 Jan 2014 22:50:06 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w8sf8062066qac.4 for ; Thu, 30 Jan 2014 14:50:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=hYv1uWqYIm+0ThRaBhvM5XfCrewEFh5+oHAE4u5M/C0=; b=T17OpkWeqTPjfi431vFrUq/3tX3yDzWx7t4OGNDPNOshNP7Pxv6QtzCNOdiEX5h3TG wzVkDEMNBZPd+N0XkgSH92BDLAAldaM8M9W3467PbjndxfGAukaaD1XpPawd6z5bdpSK PfDQOGb8fDgGff/4AKEfvW2h56VcqecM3WMJgZcwIdeOEjOzA+v0QN9dJcbA7i7HOv1H Kils1T8ZYhnISms//jrdlNRR+yvJwLIY5H9JPq2NgCED1qQn2FwQzRS8mP1Y3Rdd0zT4 4OdSdMwKAsO7BOKsOhW1HB84PMDZ+Cfbd6oMRiVNj6ZBhHnSdQ7a+c8B1fXAUjeRerZT tbCA== X-Gm-Message-State: ALoCoQkUYaCinhSz5huwEOh79MSVbTaCSk2Ncws/I1HMqIjkdOFlxF0i8PEfoSDDrIJnh8wPxrkL X-Received: by 10.236.36.39 with SMTP id v27mr6146792yha.5.1391122205627; Thu, 30 Jan 2014 14:50:05 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.24.49 with SMTP id 46ls725671qgq.21.gmail; Thu, 30 Jan 2014 14:50:05 -0800 (PST) X-Received: by 10.52.108.232 with SMTP id hn8mr3167595vdb.29.1391122205503; Thu, 30 Jan 2014 14:50:05 -0800 (PST) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx.google.com with ESMTPS id sq4si2645961vdc.2.2014.01.30.14.50.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Jan 2014 14:50:05 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.54 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.54; Received: by mail-vb0-f54.google.com with SMTP id w20so2545875vbb.27 for ; Thu, 30 Jan 2014 14:50:05 -0800 (PST) X-Received: by 10.58.200.168 with SMTP id jt8mr2854603vec.30.1391122205407; Thu, 30 Jan 2014 14:50:05 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp50466vcz; Thu, 30 Jan 2014 14:50:04 -0800 (PST) X-Received: by 10.66.163.2 with SMTP id ye2mr16994319pab.110.1391121861196; Thu, 30 Jan 2014 14:44:21 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yy4si8109869pbc.69.2014.01.30.14.44.12; Thu, 30 Jan 2014 14:44:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753930AbaA3WoG (ORCPT + 27 others); Thu, 30 Jan 2014 17:44:06 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:38351 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752118AbaA3WoE (ORCPT ); Thu, 30 Jan 2014 17:44:04 -0500 Received: by mail-pa0-f47.google.com with SMTP id kp14so3683673pab.6 for ; Thu, 30 Jan 2014 14:44:03 -0800 (PST) X-Received: by 10.68.44.71 with SMTP id c7mr7249301pbm.24.1391121843090; Thu, 30 Jan 2014 14:44:03 -0800 (PST) Received: from vb-linaro.ric.broadcom.com ([216.31.219.19]) by mx.google.com with ESMTPSA id qq5sm21000149pbb.24.2014.01.30.14.44.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Jan 2014 14:44:02 -0800 (PST) From: Zoran Markovic To: linux-kernel@vger.kernel.org Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Shaibal Dutta , Johannes Berg , "John W. Linville" , "David S. Miller" , Zoran Markovic Subject: [RFC PATCH] net: rfkill: move poll work to power efficient workqueue Date: Thu, 30 Jan 2014 14:43:34 -0800 Message-Id: <1391121814-6026-1-git-send-email-zoran.markovic@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zoran.markovic@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.54 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Shaibal Dutta 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: Johannes Berg Cc: "John W. Linville" Cc: "David S. Miller" Signed-off-by: Shaibal Dutta [zoran.markovic@linaro.org: Rebased to latest kernel, added commit message. Fixed workqueue selection after suspend/resume cycle.] Signed-off-by: Zoran Markovic --- net/rfkill/core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/net/rfkill/core.c b/net/rfkill/core.c index ed7e0b4..b3b16c0 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -789,7 +789,8 @@ void rfkill_resume_polling(struct rfkill *rfkill) if (!rfkill->ops->poll) return; - schedule_work(&rfkill->poll_work.work); + queue_delayed_work(system_power_efficient_wq, + &rfkill->poll_work, 0); } EXPORT_SYMBOL(rfkill_resume_polling); @@ -894,7 +895,8 @@ static void rfkill_poll(struct work_struct *work) */ 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)); } @@ -958,7 +960,8 @@ int __must_check rfkill_register(struct rfkill *rfkill) INIT_WORK(&rfkill->sync_work, rfkill_sync_work); 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)); if (!rfkill->persistent || rfkill_epo_lock_active) {