Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp188698imm; Tue, 3 Jul 2018 16:51:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJX3S/9WtUwWEBcbaxjOaGe54xUHMzpEy/iaHDVxtVuazln8kecndBxB6XPScXAtFlzBiBc X-Received: by 2002:a17:902:6b4c:: with SMTP id g12-v6mr31780621plt.159.1530661902939; Tue, 03 Jul 2018 16:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530661902; cv=none; d=google.com; s=arc-20160816; b=txsxpUFZJdv+p59iD8JZ/22yBV4rFuPO4TlcOqNVYKBhbQd3jidJTIoEbNQvnkUbDX 695ZrAoRo1Yidxi+5GYI6Y79FV1G/Adbv0QVrw9p1YqCwume7HsX0MYaViAP9r1Qv1HO NNTBhPswX/MgTU/hmAYeVhZNQwhkk/7k+6gFRM7+q8iALpQsUvfC4HoyN6qbcJifT2Yi bcrdPJ32ueQOTWlTWmyxbZCi25lbNwHzBlD0rQT8TnPoDKyNhRy+mYMVtYSx5QI5q/e2 Fsh2JLAiSSAPLbQVfZXQpwmoIjm89ev/Z5G+3k+3dOdc+f/jN/NJzuTOI8SOUiTB+e5+ hMgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=BymC1kqxcORFbtkpj9cjjI0biLLHJb08PTzx1P5UV/U=; b=lvNHDj2xaFIP4zRHWi2WFEmlBeiicbqmyVOkVSKZWLl82kQIPxy5w5fs+TSf4LaMyf t1wW0ETYgXWNXoU7HsCKvedGM5MTHBmD9sms44Io2hZ/V10lsYSqfqvKNgg4UZRgD3B4 tITiSyWrZaaZkeUwgL/+SD3p4xMXgeD8iDfZ1LQNgzJbjZ/X2chZUCHJdcA7+UVw+tBy Fnq+42o2NxAvN0a1/KyQQgOVV2ZtkEWJfuXWMYUzgAxdaKnBZ83DuGCLCRYbmjqKI+2U AYk28K/bh8asXMA0TtPUtZrM0gqJQTX+NGHhpDDbnwyIcdWoDd9Jhcma92Zh9+PLUvem YATA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20-v6si1901822pgl.594.2018.07.03.16.51.28; Tue, 03 Jul 2018 16:51:42 -0700 (PDT) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753074AbeGCXrZ (ORCPT + 99 others); Tue, 3 Jul 2018 19:47:25 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:37740 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752216AbeGCXrW (ORCPT ); Tue, 3 Jul 2018 19:47:22 -0400 Received: by mail-pg0-f68.google.com with SMTP id n15-v6so1646279pgv.4 for ; Tue, 03 Jul 2018 16:47:22 -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=BymC1kqxcORFbtkpj9cjjI0biLLHJb08PTzx1P5UV/U=; b=k7dg6hDZG1zsPUNFKHdz49hoRVfVUmSGLeLuyc/my1gY7HBaLWdVN3XiM9KQeuj5Ip pKzTOGOjj/huq+u2Ud0ujjyhLM1RqMfyBor0dpkjsFQeNiQJtMJXQgNZecccOKsT8aFX fbuZb8W1pOFIZf/RkKSR673KUb2lw79f7Xnp7RtENF4A7G1K9kNXh6kvosy4k+LGQnSA Yc8NTKScsDDwiuXeIhpMo77iF17UrEIylKVGXzW0tp02L6ZsI4BroLotT+x2AfV4Y3sY tFa42Jqi5EcYIVV1BlaTsmmDHok3IJl2Gd0VzfEVJzG9Y5stRYN3d7Y7o0BjvpBL887+ L6wQ== X-Gm-Message-State: APt69E1J5XtE4BQkM9WvAjJ+jiHLy1o7ifinpU8YzInRgzDbiyGABril UXEeDP41YpllWskkW5ZvVrsJCw== X-Received: by 2002:a63:b445:: with SMTP id n5-v6mr23351764pgu.104.1530661642122; Tue, 03 Jul 2018 16:47:22 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id l85-v6sm6608562pfk.79.2018.07.03.16.47.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 16:47:21 -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 v5 00/12] Add throttler driver for non-thermal throttling Date: Tue, 3 Jul 2018 16:46:53 -0700 Message-Id: <20180703234705.227473-1-mka@chromium.org> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-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 current, 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: misc: add bindings for throttler misc: throttler: Add core support for non-thermal throttling misc: throttler: Add Chrome OS EC throttler mfd: cros_ec: Add throttler sub-device .../devicetree/bindings/misc/throttler.txt | 13 + 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 | 697 ++++++++++++++++++ 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, 1161 insertions(+), 125 deletions(-) create mode 100644 Documentation/devicetree/bindings/misc/throttler.txt 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.203.gfac676dfb9-goog