From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CED9CC43141 for ; Thu, 21 Jun 2018 01:52:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8CE4F20875 for ; Thu, 21 Jun 2018 01:52:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CE4F20875 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754309AbeFUBwz (ORCPT ); Wed, 20 Jun 2018 21:52:55 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:34210 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754184AbeFUBww (ORCPT ); Wed, 20 Jun 2018 21:52:52 -0400 Received: by mail-pl0-f66.google.com with SMTP id g20-v6so761933plq.1 for ; Wed, 20 Jun 2018 18:52:52 -0700 (PDT) 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; bh=w8BDp5JL4aMowVglDozyrmUCPvnt3YQiYP//w5pOsXE=; b=JSB2tKFwdPq1UN9X2KswMAFbF1RDNKxXS9GtQ2iUGyMicZO3E+7jRNOmPsE5kF8fOh YNKWD3KLoQvp9upPtPD+9peJxrr+Q8hsEql+6wuASO3eYkMIgpinpJyG/fkolhORFigc gfPhGzb6z2csOhiPgSC82SHHtfiTi1k3esS/efaMDI6H66b5/TNTKLAhmDn1jtP6WDsQ oTg+oWmvUXIqgNBt5PfanydzQ8Gs1LqN1gLQGLdQpqbSYD+6ytD++zqx2rBBCyybPaO9 4NCCDqlgiyJx/BvOm6x3ers2Ox4Eh+U+eSlRctx0XBiBtEPCsgBKMzdkpjF93ROjh9p9 OH4g== X-Gm-Message-State: APt69E3csDOPwo2IhnFyyYWb89Y2gwsQ7sxvs6mSk4OvqQ8UcG52qI0U Aag882WMzOMnUWA3yHGsF8e+Gw== X-Google-Smtp-Source: ADUXVKLkOja8RdTwbnrSL9enV5pNFVbvFsGbXRCXWrC+sTWDRUhsuLVZ25s0p4syAPUpMrtwHw0r2Q== X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr26184370plb.198.1529545971753; Wed, 20 Jun 2018 18:52:51 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id p12-v6sm6585877pfi.175.2018.06.20.18.52.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 18:52:50 -0700 (PDT) From: Matthias Kaehlcke To: MyungJoo Ham Cc: Kyungmin Park , Chanwoo Choi , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Norris , Douglas Anderson , Enric Balletbo i Serra , "Rafael J . Wysocki" , Viresh Kumar , Lee Jones , Benson Leung , Olof Johansson , Matthias Kaehlcke Subject: [PATCH v4 00/12] Add throttler driver for non-thermal throttling Date: Wed, 20 Jun 2018 18:52:25 -0700 Message-Id: <20180621015237.100100-1-mka@chromium.org> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds the throttler driver, for non-thermal throttling of CPUs and devfreq devices. A use case for non-thermal throttling could be the detection of a high battery discharge voltage, close to the over-current protection (OCP) limit of the battery. To support throttling of devfreq devices the series introduces the concept of a devfreq policy and the DEVFREQ_ADJUST notifier (similar to CPUFREQ_ADJUST). Further it includes some related devfreq bugfixes and improvements that change some of the code that is also touched by the policy changes. Matthias Kaehlcke (12): PM / devfreq: Init user limits from OPP limits, not viceversa PM / devfreq: Fix handling of min/max_freq == 0 PM / devfreq: Don't adjust to user limits in governors PM / devfreq: Add struct devfreq_policy PM / devfreq: Add support for policy notifiers PM / devfreq: Make update_devfreq() public PM / devfreq: export devfreq_class cpufreq: Add stub for cpufreq_update_policy() dt-bindings: PM / OPP: add opp-throttlers property misc: throttler: Add core support for non-thermal throttling misc: throttler: Add Chrome OS EC throttler mfd: cros_ec: Add throttler sub-device Documentation/devicetree/bindings/opp/opp.txt | 3 + MAINTAINERS | 7 + drivers/devfreq/devfreq.c | 222 ++++-- drivers/devfreq/governor.h | 6 +- drivers/devfreq/governor_passive.c | 4 +- drivers/devfreq/governor_performance.c | 5 +- drivers/devfreq/governor_powersave.c | 2 +- drivers/devfreq/governor_simpleondemand.c | 12 +- drivers/devfreq/governor_userspace.c | 16 +- drivers/mfd/cros_ec_dev.c | 19 + drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/throttler/Kconfig | 33 + drivers/misc/throttler/Makefile | 2 + drivers/misc/throttler/core.c | 705 ++++++++++++++++++ drivers/misc/throttler/cros_ec_throttler.c | 111 +++ include/linux/cpufreq.h | 1 + include/linux/devfreq.h | 113 ++- include/linux/throttler.h | 21 + 19 files changed, 1159 insertions(+), 125 deletions(-) create mode 100644 drivers/misc/throttler/Kconfig create mode 100644 drivers/misc/throttler/Makefile create mode 100644 drivers/misc/throttler/core.c create mode 100644 drivers/misc/throttler/cros_ec_throttler.c create mode 100644 include/linux/throttler.h -- 2.18.0.rc2.346.g013aa6912e-goog