From patchwork Fri Jan 11 09:18:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 155308 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp347791jaa; Fri, 11 Jan 2019 01:18:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN7uaPVXiUxIqrUmz6ijVQdOPjY+qqjqaEHH6D1tsmA+DZNBwUrYKqohlpH3++e7r9xH6yTp X-Received: by 2002:a62:fb07:: with SMTP id x7mr13696382pfm.71.1547198327146; Fri, 11 Jan 2019 01:18:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547198327; cv=none; d=google.com; s=arc-20160816; b=tSvv+6OF91BAAeUkLFOiVOaB0ZNgBQvhUAT1wx17A+4eCEQKWaX3LbE542sL8fGW4T 3/LAJU/IJP8W7aLykOv1bdwbI+x526wiXOiWnB/fhzlCC7xgeZN8kPmiaMUq5Qw1ilFv gJ1u++5w3SUk7NThKvcpRRYG9wrwNX+HM1GjOi2kbP5KA2WT15nXhXPkXC0sTWTWi15S 3x9T3Ty/yUExe9w9y70jzx74ds7PG09RGeFDz01tma7qSm8eKssYO9a18/r/Cwug3qxc JimLsNgjUGgYhn015dLNlRpkcHrM/M4UVLCnCZJXH9arHQb6ZDv263Rw1mzIdzVWcgd7 Q9cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CatBFT4UD3UyYIzL57sVRGcnSjILPik9Oqm2Ih2xguA=; b=pYANFANR/GyOkdDZEpblj4caayGompwd+7JqEf2ESdiDcCPwio3gbxSgSU3yhrezgd OhFbn7IP3/cYYgnk+K7AGkYP3VblxTx7wIWWyfQGaiXURjdBB/N2hsAICDNdmn/FJN6v m5HT3HzriDE+HPivtPCvlMyiGGJ2svyAk/3nEGYa/1UfUhX43tQzNQ1D8ThOCcvhDefv ExNCN7L0nje+gZV1xhva5q9aDC0eLN3QtVhXsscH+zSSQraq7Ko5v+4EkUtV4stWPhlH q2wiyzYudY9DboOOO0/jcumfJ22cfQbt4KyNnzXpNZoQ5QTobHk51FOMOxjdaNVYlcLp +WCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Wt3/0n+E"; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si14340826plr.378.2019.01.11.01.18.46; Fri, 11 Jan 2019 01:18:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Wt3/0n+E"; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731172AbfAKJSp (ORCPT + 11 others); Fri, 11 Jan 2019 04:18:45 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45353 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730954AbfAKJSp (ORCPT ); Fri, 11 Jan 2019 04:18:45 -0500 Received: by mail-pl1-f194.google.com with SMTP id a14so6505654plm.12 for ; Fri, 11 Jan 2019 01:18:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CatBFT4UD3UyYIzL57sVRGcnSjILPik9Oqm2Ih2xguA=; b=Wt3/0n+EhKiKAvBx6BJt93aNhktO+0l+BxYn97S5zoIiuRDAIGrYV8xFZY4dlPD/xm 066GdBmLTwmF92bdvKxnUWFvn3lpqVoPRaL1N/Hm3hQsV6kpLdLr9iIW2onXIBVKiUXX wnKidE/7JKiOclW5/lu1sFCEVj26cAtweLzzw= 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=CatBFT4UD3UyYIzL57sVRGcnSjILPik9Oqm2Ih2xguA=; b=eU75v8QGnFXkj7l5vrSpqaOYEzyRZw3mfBtD5gqevOQlOEH9MCeqS3DHG/eTuLlYAz O62aJ3ZQbBvNsGMPBZplQkIsgiSecpVCmrbSvkooQbOIEgUcBGm69W9V4SO+ih/mxGW/ Q99ksJ+2y9CSfS2wI7GMLQ99I3nkc/tLyCV7TuZHPelttuxZEvbJPvFPfn6/9AVthtbS cisaY2OBZZP0Rtq1PUzH7zbDtMvsMz4mD2y6BCXUz3jrxjLl+H3us6scgX/Aj1Tmen8+ 3ij7hEopQpQoJN7W7WB97tf1uJKRAaKBY0K4NEDQuQPsQJ8QVNBXlP7T0R4tbUQsrXbl ckcA== X-Gm-Message-State: AJcUukf3+vTiUrpiNQEmMZ1R35JdKmrheHCdRmjD6FeXvyod3TE8NQOK ajIsWrSKQ1YkDYGmyoIp6iUq4Q== X-Received: by 2002:a17:902:14e:: with SMTP id 72mr13986222plb.287.1547198323885; Fri, 11 Jan 2019 01:18:43 -0800 (PST) Received: from localhost ([122.172.34.203]) by smtp.gmail.com with ESMTPSA id h82sm137490651pfa.105.2019.01.11.01.18.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jan 2019 01:18:43 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Greg Kroah-Hartman , "Rafael J. Wysocki" , Viresh Kumar Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , mka@chromium.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] drivers: Frequency constraint infrastructure Date: Fri, 11 Jan 2019 14:48:33 +0530 Message-Id: X-Mailer: git-send-email 2.20.1.321.g9e740568ce00 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi, This commit introduces the frequency constraint infrastructure, which provides a generic interface for parts of the kernel to constraint the working frequency range of a device. The primary users of this are the cpufreq and devfreq frameworks. The cpufreq framework already implements such constraints with help of notifier chains (for thermal and other constraints) and some local code (for user-space constraints). The devfreq framework developers have also shown interest [1] in such a framework, which may use it at a later point of time. The idea here is to provide a generic interface and get rid of the notifier based mechanism. Only one constraint is added for now for the cpufreq framework and the rest will follow after this stuff is merged. Matthias Kaehlcke was involved in the preparation of the first draft of this work and so I have added him as Co-author to the first patch. Thanks Matthias. FWIW, This doesn't have anything to do with the boot-constraints framework [2] I was trying to upstream earlier :) -- viresh [1] lore.kernel.org/lkml/20181002220625.GJ22824@google.com [2] lore.kernel.org/lkml/cover.1519380923.git.viresh.kumar@linaro.org Viresh Kumar (3): drivers: base: Add frequency constraint infrastructure cpufreq: Implement freq-constraint callback cpufreq: Implement USER constraint MAINTAINERS | 8 + drivers/base/Kconfig | 5 + drivers/base/Makefile | 1 + drivers/base/freq_constraint.c | 633 ++++++++++++++++++++++++++++++++++++++++ drivers/cpufreq/Kconfig | 1 + drivers/cpufreq/cpufreq.c | 92 ++++-- include/linux/cpufreq.h | 8 +- include/linux/freq_constraint.h | 45 +++ 8 files changed, 756 insertions(+), 37 deletions(-) create mode 100644 drivers/base/freq_constraint.c create mode 100644 include/linux/freq_constraint.h -- 2.7.4