Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp30082imm; Fri, 25 May 2018 13:35:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo55WiK0s2QtdaUkw2KET/ZXsHBf+j02bzhVxt5ESGTw+25C9X7hnbVCD1KQe1sfOjnEH9a X-Received: by 2002:a63:803:: with SMTP id 3-v6mr3247714pgi.406.1527280541777; Fri, 25 May 2018 13:35:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527280541; cv=none; d=google.com; s=arc-20160816; b=D5zpTXXpXrT7RRyFaYiNPK/vTOFxLeWfk53Q9LO7rZm5iks+rXOqLSLialzQ60SW7g sqrEu0W2sCYMDqAs1/btb9hqGinmXV4H84dIcufUWt7jgnts6d3N3FcM3I3jca/uFak6 4p9NkpL5wwgNcFT+PQjM4BrTqtneUklR9sY9mnYGvW75AL5gMtFZeMpk07Np7LsDoxl6 r2IlBCcEjjHJCUM+/lu/yzYxM4LoFJBgchAzzY6XfndIhPvvLtlIAPjcZhhM0QLcSiTD KFFI1C+8buOLXr6fCLK9eP/HN9KdXq7kgGcWFEdqwXo6v9gOwUHEIEMJuZC8safwJyFg LsJg== 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=z6FeEQl/tyz2bnNwhkQWYEXYyT0htNWwKg0GDo8JbxI=; b=g8/7piE2qYekjhHzwejDspExSYksn30iC6hIiiarafuBHHydAIWH7aJGkWWhQ1DyFl 3vHCO8uKXUjlHxj06wZT5VAQLbKlgR5mbh7PuPUNovSfis97ClSD+9OPD0bKoNvwKdne +Relu/cC0st1dd8uMwXIIR7mRw8qWJ7N9sNCTjkM6atXZrIC9R2i87vragWgdqnx388z TRA+ULnH7XKtMgNRzLNbgb9FLLhGgzSu3Krz/iNt+cQpXSK3ya6iuaahH2e3puab5tu/ /Ybx7wbf7W1qgpO8LoabjhpePKCiYnsb6BqApY4f6RACS0jN2Fvo5qFl0HcD9Uav0no+ ZlMA== 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 b68-v6si23622872pfg.94.2018.05.25.13.35.27; Fri, 25 May 2018 13:35:41 -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 S968376AbeEYUbR (ORCPT + 99 others); Fri, 25 May 2018 16:31:17 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:38753 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968241AbeEYUbP (ORCPT ); Fri, 25 May 2018 16:31:15 -0400 Received: by mail-pl0-f67.google.com with SMTP id c11-v6so3759058plr.5 for ; Fri, 25 May 2018 13:31:15 -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=z6FeEQl/tyz2bnNwhkQWYEXYyT0htNWwKg0GDo8JbxI=; b=LuaNIDpOI1wd1+L1qXEZC6DPeDTW4HGYmePJWMC1Pl+Tr1IRm1MXOyaLyms9eXZCuQ b5hc7uPScN4hOgmiIoSoRJ5jxQcYz8+Se2pod4iaq+9qpRKPEGTkj2cM+Hsrbc6bCYVN rmNRNPL0jOEj9q1R6swnDkXMJ98AsuNQT4GI82NyNa7W2wVPWD+leMUukCXy6tv39EWA v7Q8y76Y3Psz4lj9SC7Oe/jlIzO+uBTLkn2yIEXgncx1uq3xmT40uZsXp4gryQeZ38ya 1aCPFjCe909oCnuC5yMwFfLzXoc86Ru5O21y0ctbiiarrcAat8ZTLDaa3iFWG9lf33qw pX6w== X-Gm-Message-State: ALKqPwcm24Qo4AesGY0NjBfdwGydUAkbI/42nzchAV5sQwvjWMV9D2k9 yok0oouooc9Xupm1PXG82RLrRw== X-Received: by 2002:a17:902:6181:: with SMTP id u1-v6mr3970701plj.369.1527280274738; Fri, 25 May 2018 13:31:14 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id p1-v6sm42912360pfp.137.2018.05.25.13.31.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 13:31:13 -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 , Matthias Kaehlcke Subject: [PATCH 00/11] Add throttler driver for non-thermal throttling Date: Fri, 25 May 2018 13:30:32 -0700 Message-Id: <20180525203043.249193-1-mka@chromium.org> X-Mailer: git-send-email 2.17.0.921.gf22659ad46-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 (11): PM / devfreq: Init user limits from OPP limits, not viceversa PM / devfreq: Fix handling of min/max_freq == 0 PM / devfreq: Remove check for df->max_freq == 0 from governors PM / devfreq: Remove redundant frequency adjustment from governors PM / devfreq: governors: Return device frequency limits instead of user limits PM / devfreq: Add struct devfreq_policy PM / devfreg: Add support policy notifiers PM / devfreq: Make update_devfreq() public misc: throttler: Add core support for non-thermal throttling dt-bindings: misc: add bindings for throttler misc/throttler: Add Chrome OS EC throttler .../devicetree/bindings/misc/throttler.txt | 41 ++ drivers/devfreq/devfreq.c | 203 ++++++---- drivers/devfreq/governor.h | 3 - drivers/devfreq/governor_passive.c | 4 +- drivers/devfreq/governor_performance.c | 5 +- drivers/devfreq/governor_powersave.c | 2 +- drivers/devfreq/governor_simpleondemand.c | 13 +- drivers/devfreq/governor_userspace.c | 16 +- drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/throttler/Kconfig | 28 ++ drivers/misc/throttler/Makefile | 2 + drivers/misc/throttler/core.c | 373 ++++++++++++++++++ drivers/misc/throttler/cros_ec_throttler.c | 122 ++++++ include/linux/devfreq.h | 112 +++++- include/linux/throttler.h | 10 + 16 files changed, 813 insertions(+), 123 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.17.0.921.gf22659ad46-goog