From patchwork Thu Feb 14 01:30:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10811559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ECDEB13A4 for ; Thu, 14 Feb 2019 01:31:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA4C32DF4C for ; Thu, 14 Feb 2019 01:31:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CECFB2DF4E; Thu, 14 Feb 2019 01:31:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 861D32DF4C for ; Thu, 14 Feb 2019 01:31:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731151AbfBNBay (ORCPT ); Wed, 13 Feb 2019 20:30:54 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:44065 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729672AbfBNBay (ORCPT ); Wed, 13 Feb 2019 20:30:54 -0500 Received: by mail-pl1-f195.google.com with SMTP id p4so2176749plq.11 for ; Wed, 13 Feb 2019 17:30:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oKV2+FrnhAHG8HfwAGfe/E7DaHLqiHL+qRM6QpM+8gE=; b=FBL3q63QX18QiYlcwkSrZVHEtt8kEQjnz1+ae05xjPlio+P/956cf7nAVzsr5C1R43 ZDFbO92Ck4BzCqk+ERDY+RySjDdXFEgHJEP9UzjOqMwxZnoKGHid1iUukW65kXZkk6xi Ep+QOh3Of6EHzFBjfZYp1Q3+1pTbQ/Z/4oXnc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oKV2+FrnhAHG8HfwAGfe/E7DaHLqiHL+qRM6QpM+8gE=; b=OUBJWb6eJr3lEItLpZde1jYyN6HaGxi9c+FOKTBc9oIsuyYKxT3DPn9THrIg3xaWBN YY8whQbxUY4e25Y502Ca2TAXjUaNIAq/Ogg4C77uWaoPYUCuHpoqM40SJh3WDd+Y3t10 aoEt6xjEPymzQ4cYye9qshc6ZPVFh7wKIeDK7fzugMVIRTeHZn1l2opm8IJm9A2IGXT3 6fSmGEb/gI2OOR6AHoimLyXnHurAOcJwFURpb6ElHNUw9wnH7Uu1MzoJShOZE+29CJlt jA2PaxYw3KvYv0tjgEI36/L4P+/DMzLI3jEtQ54XVAEMGURKlpzasNOdQwuqBRT14MYR 11IA== X-Gm-Message-State: AHQUAuY2DhlF/mmbkL2fizUMK3Fy3vzcdFRUivS2vJ6uK9JNn0kLvLNv 0znpuGDNXiR80ylF1w6lfktlSQ== X-Google-Smtp-Source: AHgI3IZJOAUNsUKFnq/K/WnvOtQf1XknnWWRhYXaS+GAejypGn2/jU9ApYIMx/1eJOMg3raEJ0ipxQ== X-Received: by 2002:a17:902:209:: with SMTP id 9mr1339679plc.288.1550107853302; Wed, 13 Feb 2019 17:30:53 -0800 (PST) Received: from mka.mtv.corp.google.com ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id p64sm811072pfi.56.2019.02.13.17.30.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 17:30:52 -0800 (PST) From: Matthias Kaehlcke To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Thierry Reding , Jonathan Hunter , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, Lukasz Luba Cc: Matthias Kaehlcke Subject: [PATCH 0/4] PM / devfreq: Refactor load monitoring Date: Wed, 13 Feb 2019 17:30:38 -0800 Message-Id: <20190214013042.254790-1-mka@chromium.org> X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a-goog MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The devfreq core currently expects governors to call specific load monitor functions on certain DEVFREQ_GOV_ events. Since the devfreq core itself invokes the event handler it can as well call the corresponding load monitor functions itself. This series refactors the code to do this for DEVFREQ_GOV_START/STOP/SUSPEND and RESUME. In the process it also moves some repeated code involved in starting and stopping the governor into helper functions. Unfortunately I could only do limited testing of this series with a 4.19 kernel and few rather inactive devfreq devices. In this sense additional testing would be appreciated. Thanks Matthias Matthias Kaehlcke (4): PM / devfreq: Track overall load monitor state instead of 'stop_polling' PM / devfreq: Handle monitor suspend/resume in the devfreq core PM / devfreq: Add devfreq_governor_start/stop() PM / devfreq: Handle monitor start/stop in the devfreq core drivers/devfreq/devfreq.c | 185 +++++++++++++--------- drivers/devfreq/governor.h | 4 - drivers/devfreq/governor_simpleondemand.c | 16 -- drivers/devfreq/tegra-devfreq.c | 4 - include/linux/devfreq.h | 4 +- 5 files changed, 111 insertions(+), 102 deletions(-)