Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp990808imm; Thu, 31 May 2018 13:05:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLiE7bUEaY2AKElFESJVhLmIG1vSG8hmi3LQjZm59tTalzYgt8lWe3Szz1+dnloCMhxQdyp X-Received: by 2002:a17:902:bd4c:: with SMTP id b12-v6mr8497534plx.242.1527797125262; Thu, 31 May 2018 13:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527797125; cv=none; d=google.com; s=arc-20160816; b=aaIik1vHFoZrYHn8GnzzSl8IMseGrGwG9jyy0VYHUX5+UX3hnASvRGXDlayKeX9j1Y +eylv9hVdjSHlqPfxNWI7ATlKBVaLDRAnUr5WWXbWMl4XxOMa2EZtSXioLhNM55DxOaS NpFOVRVr2mq4ihqRhs1lYQGKLj+XlpFfwc0SyJeSXehasy5V4KV7dZAGC7an8/bxplce RNkhgqfnzyh6nRWLcy/Ug+am4SckgXDdPIN0H01r3IqjKJp5L5SLHVLuHhiau6sxvjNE SxZxKMp5e7+ivhXO6YNuHS7GSzBaFu5XSzhFADgO8O9Da89XjhHpCIWP6HaRbLnWbYxz uVpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=iu//+IcsMxY6ACXNyreHLr+SqILrHkqRagk564Xux+o=; b=BD7rJJXCK6uAMe/Dzf2h/LazPcFSVQwrvD5+HozpLSwgus8X0vozH1YlQX37mGl42V ZHLtExD2xNerAuv4aW3HFznuUYL3kphTSP5tquoyzfwzzIz7Fr1Ih7ehkY6gOYE/j2e0 otUrsmFHnREIsJx6Lt8O73i+WV+jdOPMUnBRzPWiMAKTQ4IYJXdOIpVgnQNCFQ7ZuuEL F3+baBrug6jxAdaTcgVlDKelT+2go/rXgdYCdBqXkZoN0aIkO2/bkON1TvqylDVuXL7u MWtltoIi/vAr08WebzaHMtCo1cikeEjTmh7GAT5VROfUvJc63qtwdnzHTOrb/ri2DrCq AHdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h3wYemzZ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7-v6si939183pgr.76.2018.05.31.13.05.10; Thu, 31 May 2018 13:05:25 -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; dkim=pass header.i=@kernel.org header.s=default header.b=h3wYemzZ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754253AbeEaUEm (ORCPT + 99 others); Thu, 31 May 2018 16:04:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:44194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754071AbeEaUEk (ORCPT ); Thu, 31 May 2018 16:04:40 -0400 Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com [209.85.220.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7EAD9208B1; Thu, 31 May 2018 20:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527797079; bh=35U0sSz7ZPGBH7t/8SyPrVhWQK0JTCNVbg9u/ESu/F0=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=h3wYemzZXZzE+wenHWxostcHcIbZvIxCjWz7fjXuFMDIPzr8pxxxSHK78Y0jVWlyM HrqgURBqGFUR3fi2EX27V/MjQhScPDTKElsy8ETtnGG7tenotoMKItUqQxnEFFTfDk 4EAm2P86r5p0hNTW60JQdmG50sxBkrDyVNppXEaE= Received: by mail-qk0-f173.google.com with SMTP id h7-v6so11015299qkm.0; Thu, 31 May 2018 13:04:39 -0700 (PDT) X-Gm-Message-State: APt69E3XemajwygMRen6GIkZa9wG1Lyyf1ohPCzMEMGzRFUHG+J+yYJF qCc0HYb0f6Abo3gVB/aUHnfq7KmmuN9WjIEpZA== X-Received: by 2002:a37:17c5:: with SMTP id 66-v6mr7335772qkx.375.1527797078661; Thu, 31 May 2018 13:04:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9b02:0:0:0:0:0 with HTTP; Thu, 31 May 2018 13:04:18 -0700 (PDT) In-Reply-To: <20180531183404.GB88063@google.com> References: <20180525203043.249193-1-mka@chromium.org> <20180525203043.249193-11-mka@chromium.org> <20180531163159.GA4369@rob-hp-laptop> <20180531183404.GB88063@google.com> From: Rob Herring Date: Thu, 31 May 2018 15:04:18 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 10/11] dt-bindings: misc: add bindings for throttler To: Matthias Kaehlcke Cc: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Arnd Bergmann , Greg Kroah-Hartman , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Brian Norris , Douglas Anderson Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 31, 2018 at 1:34 PM, Matthias Kaehlcke wrote: > Hi Rob, > > On Thu, May 31, 2018 at 11:31:59AM -0500, Rob Herring wrote: >> On Fri, May 25, 2018 at 01:30:42PM -0700, Matthias Kaehlcke wrote: >> >> Commit msg? > > Will add some more info in the next revision. > >> > Signed-off-by: Matthias Kaehlcke >> > --- >> > .../devicetree/bindings/misc/throttler.txt | 41 +++++++++++++++++++ >> > 1 file changed, 41 insertions(+) >> > create mode 100644 Documentation/devicetree/bindings/misc/throttler.txt >> > >> > diff --git a/Documentation/devicetree/bindings/misc/throttler.txt b/Documentation/devicetree/bindings/misc/throttler.txt >> > new file mode 100644 >> > index 000000000000..92f13e94451a >> > --- /dev/null >> > +++ b/Documentation/devicetree/bindings/misc/throttler.txt >> > @@ -0,0 +1,41 @@ >> > +Throttler driver >> > + >> > +The Throttler is used for non-thermal throttling of system components like >> > +CPUs or devfreq devices. >> >> This all looks very Linux specific and not a h/w device. Perhaps you can >> add hint properties to OPP tables as to what entries can be used for >> throttling, but otherwise this doesn't belong in DT. > > My idea is to allow multiple throttlers, which might operate on > different throttling devices or use different OPPs for the same > device. To support this a simple boolean hint that the OPP can be used > for throttling would not be sufficient. > > What should work is a property with an array of phandles of the > throttlers that use a given OPP. > > AFAIK it is currently not possible to enumerate the devfreq devices in > the system, so besides the info in the OPPs the throttler itself would > still need a phandle to the devfreq device(s) it uses. Why don't you fix that OS problem instead of working around it in DT? > > I envision something like this: > > gpu_opp_table: opp-table2 { > compatible = "operating-points-v2"; > > opp00 { > opp-hz = /bits/ 64 <200000000>; > opp-microvolt = <800000>; > }; > opp01 { > opp-hz = /bits/ 64 <297000000>; > opp-microvolt = <800000>; > opp-throttlers = <&cros_ec_throttler>; > }; > ... > }; > > cros_ec_throttler: cros-ec-throttler { > compatible = "google,cros-ec-throttler"; Is this an actual h/w device? > > devfreq-devices = <&gpu>; > }; > > Would this be acceptable? > > Thanks > > Matthias