From patchwork Fri Jan 31 23:44:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoran Markovic X-Patchwork-Id: 23997 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 323C7202FA for ; Fri, 31 Jan 2014 23:53:21 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id jt11sf11990573pbb.2 for ; Fri, 31 Jan 2014 15:53:21 -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=bnrYU3J4sysd2dHXrFL60fL4MUbpK14irN359iTEw78=; b=Zw9JTNZ+Hv5PTwKSReIcx2O6F0uqrkwEbM24tygbaLk23zRYSJcQx38otXr/m9ZaL6 w0sz/L6h2ME8nbkBdYlsp5VwzxpmagR9bXVsW5sgduGzpAa2ZGd3jTaJHJiJ9z4gDf8u q/4stwHn1gJVv7d9NXDKQVOX3Ta+4cudolSNANs1ljCnuNi3+jfr40i4X8xCdBAggnk2 aRkJyA0OqjWvrWIVDMrg3HDdDOpoj5yUt8cdRu18WaeaIN4+V+N5eD8Ep+BF8zeLPnXs wZM3SiCPssMBwlVUuN/T09AzWhef23/ArSeScomUgnt6fJj9BYWilT33lf65LHEyRJ5n e9sw== X-Gm-Message-State: ALoCoQkwELr2vKM+bfvUkWo8JiZDYWqZ9kohvJWPcWvsDXvCtfZhOSinn/3k0Q+GGkpIWmz63ojI X-Received: by 10.66.189.228 with SMTP id gl4mr9159332pac.26.1391212400976; Fri, 31 Jan 2014 15:53:20 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.80 with SMTP id 74ls1182115qgo.61.gmail; Fri, 31 Jan 2014 15:53:20 -0800 (PST) X-Received: by 10.58.66.137 with SMTP id f9mr18259749vet.11.1391212400867; Fri, 31 Jan 2014 15:53:20 -0800 (PST) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id er6si4098240vdc.62.2014.01.31.15.53.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Jan 2014 15:53:20 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id im17so3385416vcb.19 for ; Fri, 31 Jan 2014 15:53:20 -0800 (PST) X-Received: by 10.52.236.132 with SMTP id uu4mr10166vdc.47.1391212400560; Fri, 31 Jan 2014 15:53:20 -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 u4csp139486vcz; Fri, 31 Jan 2014 15:53:20 -0800 (PST) X-Received: by 10.66.216.129 with SMTP id oq1mr23395910pac.75.1391212399680; Fri, 31 Jan 2014 15:53:19 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sd3si12154622pbb.312.2014.01.31.15.53.18; Fri, 31 Jan 2014 15:53:18 -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 S1754421AbaAaXwq (ORCPT + 27 others); Fri, 31 Jan 2014 18:52:46 -0500 Received: from mail-yk0-f175.google.com ([209.85.160.175]:58586 "EHLO mail-yk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753713AbaAaXwp (ORCPT ); Fri, 31 Jan 2014 18:52:45 -0500 X-Greylist: delayed 397 seconds by postgrey-1.27 at vger.kernel.org; Fri, 31 Jan 2014 18:52:45 EST Received: by mail-yk0-f175.google.com with SMTP id q200so27772224ykb.6 for ; Fri, 31 Jan 2014 15:52:44 -0800 (PST) X-Received: by 10.236.37.105 with SMTP id x69mr20803296yha.15.1391211968099; Fri, 31 Jan 2014 15:46:08 -0800 (PST) Received: from vb-linaro.ric.broadcom.com ([216.31.219.19]) by mx.google.com with ESMTPSA id q7sm31447154pbc.20.2014.01.31.15.46.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Jan 2014 15:46:07 -0800 (PST) From: Zoran Markovic To: linux-kernel@vger.kernel.org Cc: Shaibal Dutta , Ming Lei , Greg Kroah-Hartman , Zoran Markovic Subject: [RFC PATCH] firmware: use power efficient workqueue for unloading and aborting fw load Date: Fri, 31 Jan 2014 15:44:58 -0800 Message-Id: <1391211898-18776-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.220.174 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 Allow the scheduler to select the most appropriate CPU for running the firmware load timeout routine and delayed routine for firmware unload. This extends idle residency times and conserves power. This functionality is enabled when CONFIG_WQ_POWER_EFFICIENT is selected. Cc: Ming Lei Cc: Greg Kroah-Hartman Signed-off-by: Shaibal Dutta [zoran.markovic@linaro.org: Rebased to latest kernel, added commit message. Fixed code alignment.] Signed-off-by: Zoran Markovic --- drivers/base/firmware_class.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 8a97ddf..ae34219 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -900,7 +900,8 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, dev_set_uevent_suppress(f_dev, false); dev_dbg(f_dev, "firmware: requesting %s\n", buf->fw_id); if (timeout != MAX_SCHEDULE_TIMEOUT) - schedule_delayed_work(&fw_priv->timeout_work, timeout); + queue_delayed_work(system_power_efficient_wq, + &fw_priv->timeout_work, timeout); kobject_uevent(&fw_priv->dev.kobj, KOBJ_ADD); } @@ -1570,8 +1571,8 @@ static void device_uncache_fw_images_work(struct work_struct *work) */ static void device_uncache_fw_images_delay(unsigned long delay) { - schedule_delayed_work(&fw_cache.work, - msecs_to_jiffies(delay)); + queue_delayed_work(system_power_efficient_wq, &fw_cache.work, + msecs_to_jiffies(delay)); } static int fw_pm_notify(struct notifier_block *notify_block,