Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1043615imm; Thu, 31 May 2018 14:11:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKKPAQ3vC7VCeh3rfEix2DMWIOLBzOSwIjjdCkF+Abi1k41eFBaf+gtpMKQ243GcfJ/wfWs X-Received: by 2002:a63:7145:: with SMTP id b5-v6mr6762252pgn.45.1527801095605; Thu, 31 May 2018 14:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527801095; cv=none; d=google.com; s=arc-20160816; b=phsL9LIKEr5R+KmqwESAxi1ZYCmn642OiWKN/jNzdjRllvxLsW4q1JUzv1HrDY0r5j ap+A7r7TU+fPEnZqYy6Kb7BaiBtZNalHNUPDVI0oeR4DJW9+ZV8Cjwqkf1lXJKHY+b9b +U6vf28jtdXDhVkhwP67z2PS2c3PpSlELrC0UyO0llvbim63BkD6lEDlLs8mYdvjieq2 8+4QrvnfE0uO1UI9pbP9Rxul2UqJhDYybKGWxzPowDrbDcQzBGEtmvT45z2153J6/ilK 32+riAvz8RuIp9yZht2DIc2kI2zJERBtALx6bdhU4S8GWQdqimK6n8a+KN7gvXqgfM8r lVVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=A43YqjmKojzC0S74n7jsnUhKlwm7N0tyyk+YonhBaAM=; b=z/Tb7FTjW1IkYTDr1O7k/vwptOimu8Ru+h/MAJ9WqvZKw9kJH76E44IHycmj0eRmZV ALHTbCWVGyt2jd9nFBI3BTSXwY5jYPuglVFyhgdkamrZfUfOZDnzZet4c+hHac0cqYuI GjZZxcE9wHgJn29FKF1t7+gQykYNnRi/wptlDzV1E1oehnudwdsTwiXoXw/xgGVd3DUB A48gQeLRSzRdFvzipQ1YSxlN7TgLBDhu/THij+592ci6kPkvULAFsALwHjQwTIaNxEJc k+158LWPA86oq6bIldA7tMFJdGfyiO7fqrjy1iK2J8ycuU6Zu7OwNl/eZ8iNd4j/5ixA UtlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HY/jcF+Q; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6-v6si2397453pgk.256.2018.05.31.14.11.21; Thu, 31 May 2018 14:11:35 -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=@chromium.org header.s=google header.b=HY/jcF+Q; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751385AbeEaVKc (ORCPT + 99 others); Thu, 31 May 2018 17:10:32 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:40706 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135AbeEaVK1 (ORCPT ); Thu, 31 May 2018 17:10:27 -0400 Received: by mail-pg0-f65.google.com with SMTP id l2-v6so10241933pgc.7 for ; Thu, 31 May 2018 14:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=A43YqjmKojzC0S74n7jsnUhKlwm7N0tyyk+YonhBaAM=; b=HY/jcF+Q+1B9OVK5k3kglgFEZHfdtxWbB8THqXF718mzRiAHirhPdi9J/JPSjCs4C1 z+uNTryu+pDgT1CRs3VKvwD9FJYOJScLXR+R0thEboylIJ2DLxdKNrENHTBhTT3ar1l6 qQG/meWMzsKNNNYdVmXj8LdkxW36Sh22wjvmc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=A43YqjmKojzC0S74n7jsnUhKlwm7N0tyyk+YonhBaAM=; b=dTLM8Zw/jjeWBPewPn+kBBM0IJB1Y0G537VURuaxVtGhWPX3kxHU+sufKd+qpYebN9 GP7IlYiof1Ui89EUKekuaKAipZctXQ6hjWcHpQURGoVflhvOXh7mrOdwek8oOwfMIsVF 2OG0/eWjOm5n2S1oHu0ck68CnfSpVMDbxLvN9wVat/HRQ1yb1/iJfNMWcSFU/03Mwa3g aLzV6j5vyZdpIx9IHkhaswjJxRfHOgXCihZmXKuSZRCCKG7xvsWunrRaTKfu0f6qdke3 duM0JXGi0dpAV81XnVGS7wGihbr0STnTRZYZtB2zexy7/9S7+BlCxcFtraQTI7AJKFtD s7OQ== X-Gm-Message-State: ALKqPwcNITc6WMWeMx7oPDAAvMqZlyVFzwyhyGhLuO1bt+uZHNh9fXCy C7pbgBNcsd5ZjUetMTyJ7PCMrQ== X-Received: by 2002:a63:3581:: with SMTP id c123-v6mr2099649pga.217.1527801027204; Thu, 31 May 2018 14:10:27 -0700 (PDT) Received: from localhost ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id u9-v6sm73244203pfi.60.2018.05.31.14.10.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 May 2018 14:10:26 -0700 (PDT) Date: Thu, 31 May 2018 14:10:25 -0700 From: Matthias Kaehlcke To: Rob Herring 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 Subject: Re: [PATCH 10/11] dt-bindings: misc: add bindings for throttler Message-ID: <20180531211025.GC88063@google.com> References: <20180525203043.249193-1-mka@chromium.org> <20180525203043.249193-11-mka@chromium.org> <20180531163159.GA4369@rob-hp-laptop> <20180531183404.GB88063@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) 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 03:04:18PM -0500, Rob Herring wrote: > 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 can try, though it's not exclusively in my hands, depends on what the devfreq maintainers think about it. > > 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? The Chrome OS Embedded Controller is a MCU that communicates with Linux over SPI or I2C. The low-level communication with the EC is handled by drivers/mfd/cros_ec* and then there are multiple drivers representing 'remote devices' on top of this (rtc-cros-ec.c, extcon-usbc-cros-ec.c, pwm-cros-ec.c, ...). cros_ec_throttler is a similar 'device' that responds to signals from the EC with frequency adjustments.