From patchwork Fri Feb 12 13:28:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 8291021 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8CCC7BEEE5 for ; Fri, 12 Feb 2016 13:33:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A03E4203E9 for ; Fri, 12 Feb 2016 13:33:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA1DD203F3 for ; Fri, 12 Feb 2016 13:33:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752584AbcBLNcx (ORCPT ); Fri, 12 Feb 2016 08:32:53 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:48356 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752426AbcBLNcN (ORCPT ); Fri, 12 Feb 2016 08:32:13 -0500 Received: from agov216.neoplus.adsl.tpnet.pl (217.99.253.216) (HELO vostro.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer v0.80) id fc1e379c7dd57f5a; Fri, 12 Feb 2016 14:32:12 +0100 From: "Rafael J. Wysocki" To: Linux PM list Cc: Linux Kernel Mailing List , Viresh Kumar , Juri Lelli , Shilpasri G Bhat Subject: [PATCH 1/2] cpufreq: governor: Simplify gov_cancel_work() slightly Date: Fri, 12 Feb 2016 14:28:13 +0100 Message-ID: <2337921.T3qTZn9cXM@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.5.0-rc1+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <5225538.XnBMjjCp2q@vostro.rjw.lan> References: <5225538.XnBMjjCp2q@vostro.rjw.lan> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Rafael J. Wysocki The atomic work counter incrementation in gov_cancel_work() is not necessary any more, because work items won't be queued up after gov_clear_update_util() anyway, so drop it along with the comment about how it may be missed by the gov_clear_update_util(). Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/cpufreq_governor.c | 8 -------- 1 file changed, 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-pm/drivers/cpufreq/cpufreq_governor.c =================================================================== --- linux-pm.orig/drivers/cpufreq/cpufreq_governor.c +++ linux-pm/drivers/cpufreq/cpufreq_governor.c @@ -195,13 +195,6 @@ static inline void gov_clear_update_util static void gov_cancel_work(struct policy_dbs_info *policy_dbs) { - /* Tell dbs_update_util_handler() to skip queuing up work items. */ - atomic_inc(&policy_dbs->work_count); - /* - * If dbs_update_util_handler() is already running, it may not notice - * the incremented work_count, so wait for it to complete to prevent its - * work item from being queued up after the cancel_work_sync() below. - */ gov_clear_update_util(policy_dbs->policy); irq_work_sync(&policy_dbs->irq_work); cancel_work_sync(&policy_dbs->work); @@ -264,7 +257,6 @@ static void dbs_update_util_handler(stru * The work may not be allowed to be queued up right now. * Possible reasons: * - Work has already been queued up or is in progress. - * - The governor is being stopped. * - It is too early (too little time from the previous sample). */ if (atomic_inc_return(&policy_dbs->work_count) == 1) {