Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp367295imu; Fri, 11 Jan 2019 01:43:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN51/9P8elKX/5hrJAyD6XSD1quAXMrRvCGVOYLQdZJ8uexb16C3AZSaYQuQmAlsEXXu3h6b X-Received: by 2002:a65:610d:: with SMTP id z13mr12890382pgu.427.1547199800203; Fri, 11 Jan 2019 01:43:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547199800; cv=none; d=google.com; s=arc-20160816; b=KL8YAT0rQwDRQq2TGOPC0klhe7A8SpVvN4Mgr2OiMxuYyQ+PCpGuzVhaPxxtHnQzUm Z4It/iPIaB05/wSR0ZBsb8DRCCPGxx6dQ9YEyA6F2euxIP3WhBn0l5RU8eJ6MfjHsGQU VbFz1OXgp+3Nap6NNdGjKMkZ5KWWeH3Op0m3Pshx7nBEjKE8UsQxxQ6nZQk5WCI0iIuP B91FuY7s9SHOXa23thEHEtcYW9T6P5XH91TTmxaxYEZGQjwB+eRb5/5+irx/ZocpqIF1 90kK8aFblxcxoy+/zCZZVbWeqGXOErkXotw//jlzm1NCNMvdNJwCg6Ya3RNLo8X0JsaA 9+yw== 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=nf1Cxl93+TDeJqg1IZ4ywOS6JJRpFtTfKwTX7G44kSw0NMsYAsIty+AVkTnlgGrGor HTXSIppeC4n5NgaiKL5/zRVjPSBo3a5gN8z7jVmBtfMMW5W/dxNdtY1uXhgoYlqfJPj7 Dg3HnYn5250uatMmjkZAM9UilQmUmnbf+pvL0j7ZmuSOHF1V1UClBXZeC7HQKaKtE5La sc0w6w3ReQHVowH0lIlQLnu/qkERNzxB5cgU7r0IhtXaBVztsoz+nubzqPTwyfHRMzYZ 2YUm7lcA0zXm8Ge6ijSXaeFynXYYZiq0bRRqEJT4noa99nZgTwT6si+X7IIE2Euc6KRo M2eg== 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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 i129si81614608pfb.32.2019.01.11.01.43.04; Fri, 11 Jan 2019 01:43:20 -0800 (PST) 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; 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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1731449AbfAKJSp (ORCPT + 99 others); Fri, 11 Jan 2019 04:18:45 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:46521 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730334AbfAKJSp (ORCPT ); Fri, 11 Jan 2019 04:18:45 -0500 Received: by mail-pl1-f193.google.com with SMTP id t13so6508844ply.13 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=PoWGr07h0L3fuIQUChPBNbLo6S6qlW5jAFideW2wMDKnFJE51KcuUckuvrnaF3dIQB TQwLgGt01nWhJhODmzZklChFLJeBMZGd37lgwKSrtlwF2LUTOSTiMDqLXHDjqcae1E4P +wqtJ25NWSu/6x+cN/mN1+sBSVvaJvbFmRz3fqG2J44UgeiTC9xFoqb6KRgGfknseNEO l70ylARxbTzBE3QJ1GhLN0h5MFHdZ0OFBBdrF7ulkTdiHKraIbRrQzKWb/VMe5x6PNrP piJcLYDmXBuWNY2WpJgkPfoBHv6jlPxmsMQtadT5NxXbkHXsfecVONbNyHLr7YMaEgcy dLgA== X-Gm-Message-State: AJcUukcyUdJCO5tkVFgVbkPinPpEQjjiOAIfHtMXYcfIGmLI6O5ZvWei 853EuTQlKi6zOdJ4gWc9g+6CwQ== 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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