From patchwork Tue Feb 24 09:54:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5871131 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 89AA79F373 for ; Tue, 24 Feb 2015 09:56:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B7BBE20652 for ; Tue, 24 Feb 2015 09:56:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAE6E2063C for ; Tue, 24 Feb 2015 09:56:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752868AbbBXJzk (ORCPT ); Tue, 24 Feb 2015 04:55:40 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:33484 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752364AbbBXJy6 (ORCPT ); Tue, 24 Feb 2015 04:54:58 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NK900DATT2BVM60@mailout3.w1.samsung.com>; Tue, 24 Feb 2015 09:58:59 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-f1-54ec49da61e2 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 38.34.26295.AD94CE45; Tue, 24 Feb 2015 09:52:26 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NK900GYNSVEJ350@eusync2.samsung.com>; Tue, 24 Feb 2015 09:54:55 +0000 (GMT) From: Krzysztof Kozlowski To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 4/5] power_supply: max17040: Use system efficient workqueues Date: Tue, 24 Feb 2015 10:54:46 +0100 Message-id: <1424771687-7976-4-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1424771687-7976-1-git-send-email-k.kozlowski@samsung.com> References: <1424771687-7976-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLJMWRmVeSWpSXmKPExsVy+t/xK7q3PN+EGDz+ZmAx6cl7ZouJKycz W7x+YWhxedccNovPvUcYLU7vLnFg89g56y67x+YVWh6bVnWyefRtWcXo8XmTXABrFJdNSmpO Zllqkb5dAlfGpLln2QvO8VScPdzD2MD4kKuLkZNDQsBEouP3OWYIW0ziwr31bF2MXBxCAksZ JZZ27mWBcPqYJOZMXA1WxSZgLLF5+RKwKhGB3YwSE6YuZwFJMAsYSvx894e9i5GDQ1jAR6Ln kDlImEVAVWLPiqmMIDavgJvElgkf2SG2yUmcPDaZFaScU8Bd4tvsIpCwEFDJjf4m5gmMvAsY GVYxiqaWJhcUJ6XnGukVJ+YWl+al6yXn525ihATR1x2MS49ZHWIU4GBU4uF9UPYqRIg1say4 MvcQowQHs5II7wLbNyFCvCmJlVWpRfnxRaU5qcWHGJk4OKUaGNtOP931Xmat2Oo+7wXe/9cL mujMvF0SXdj8fc4zA33xzCaR9BoZOSEGeaVbF289VjToW3zizearaldSOEO5FWdqWRWetHiy z2nGea9mMdvHmxf0n/+35YHX7TPl3fFvalwubf5+/Ghugq+foFfio6/+J3TCj+1182R3vJ8f snTe7A+yfSx7FyqxFGckGmoxFxUnAgB4oohWAAIAAA== Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The scheduled work in max17040_battery driver reads device parameters and stores them in memory. Any CPU could do that so use system efficient workqueues to limit unnecessary CPU wake ups. Signed-off-by: Krzysztof Kozlowski --- drivers/power/max17040_battery.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/power/max17040_battery.c b/drivers/power/max17040_battery.c index 14d44706327b..63ff3f705154 100644 --- a/drivers/power/max17040_battery.c +++ b/drivers/power/max17040_battery.c @@ -188,7 +188,8 @@ static void max17040_work(struct work_struct *work) max17040_get_online(chip->client); max17040_get_status(chip->client); - schedule_delayed_work(&chip->work, MAX17040_DELAY); + queue_delayed_work(system_power_efficient_wq, &chip->work, + MAX17040_DELAY); } static enum power_supply_property max17040_battery_props[] = { @@ -233,7 +234,8 @@ static int max17040_probe(struct i2c_client *client, max17040_get_version(client); INIT_DEFERRABLE_WORK(&chip->work, max17040_work); - schedule_delayed_work(&chip->work, MAX17040_DELAY); + queue_delayed_work(system_power_efficient_wq, &chip->work, + MAX17040_DELAY); return 0; } @@ -263,7 +265,8 @@ static int max17040_resume(struct device *dev) struct i2c_client *client = to_i2c_client(dev); struct max17040_chip *chip = i2c_get_clientdata(client); - schedule_delayed_work(&chip->work, MAX17040_DELAY); + queue_delayed_work(system_power_efficient_wq, &chip->work, + MAX17040_DELAY); return 0; }