Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2452974ybl; Thu, 9 Jan 2020 13:03:26 -0800 (PST) X-Google-Smtp-Source: APXvYqwV4GfCBx95yIwcuKCBO910JJTXaFONHamPF4dWG0399OJF7vlRM1bfbUPl6lTM342Jfos7 X-Received: by 2002:aca:2407:: with SMTP id n7mr4922196oic.14.1578603806844; Thu, 09 Jan 2020 13:03:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578603806; cv=none; d=google.com; s=arc-20160816; b=Kk3qaf+jCU83JpLNljQUe1Dqx5gNPjsHhnFPQOg3yez92FeuE5pJTQRAF0p/Uf4T1p dQZ3WxxZLSYH+4YrBD7PmxZOcdAJTKr9U5i3lxei1YvQYlnI2PoNd92yoaLF/b7M/n4S aiLXsGYWYBQfwoggME+jtDjzrf9BqeDrCnZoemaMYD9At3JuMbdTloutncC7OrHE5Uu+ STBYFa6qGct2EOKlWtLP25PNmBTQnNH9HGmicm7jDkjRkYcS/YxhlyVP1gc3JOYqCrlz nUpL/AOI++2TNfVqU1/FTXlsX4KAQ7gmF0wlxapefBrDflAtBy+YXGPM24iziNf/OGNA QKfw== 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; bh=HP5TnTJz70lKq4Wm0Slfrzc3NYiCbhlhtcM32JP5Ys4=; b=D8YrbdmeW8X4lNqikKxgZaJibFZ7+d0OGawgPbsZ01NRLmZO/SXH8TPo40cGj/EpGq QbFlfvvYTWi6ql6CpXblVpO7nSv5RGyWvoMEAyN97u/C/61Ob7NS6xPpK6CyK+X8xA5w rzJKL20ar0Kpvd+w4NbmWmxeRbedkPNS8ADpu2MQ+nKHkpi29tVpPjBmeDJsrIX9azYd D7YADliRcVq0Mdj8uNNELZNmylO7RV72sk7uRoLceDz8BzuR3c8dcB9fYJu5CVOCQqFE 0KHV1phGDT+GRmqjIb3ApULG1V/m0sY4aihnNE6FwB4gOCY9UV8Vw24De9CewXfxzpjU D09g== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h22si4849288otk.18.2020.01.09.13.03.15; Thu, 09 Jan 2020 13:03:26 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732382AbgAITtd (ORCPT + 99 others); Thu, 9 Jan 2020 14:49:33 -0500 Received: from foss.arm.com ([217.140.110.172]:36222 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730077AbgAITtd (ORCPT ); Thu, 9 Jan 2020 14:49:33 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2264531B; Thu, 9 Jan 2020 11:49:32 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9CFEA3F534; Thu, 9 Jan 2020 11:49:31 -0800 (PST) Date: Thu, 9 Jan 2020 19:49:30 +0000 From: Mark Brown To: Steven Price Cc: Mark Rutland , Devicetree List , Nicolas Boichat , Tomeu Vizoso , David Airlie , lkml , dri-devel@lists.freedesktop.org, Liam Girdwood , Rob Herring , "moderated list:ARM/Mediatek SoC support" , Alyssa Rosenzweig , Hsin-Yi Wang , Matthias Brugger , linux-arm Mailing List Subject: Re: [PATCH v2 4/7] drm/panfrost: Add support for a second regulator for the GPU Message-ID: <20200109194930.GD3702@sirena.org.uk> References: <20200108052337.65916-1-drinkcat@chromium.org> <20200108052337.65916-5-drinkcat@chromium.org> <20200108132302.GA3817@sirena.org.uk> <09ddfac3-da8d-c039-92a0-d0f51dc3fea5@arm.com> <20200109162814.GB3702@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pQhZXvAqiZgbeUkD" Content-Disposition: inline In-Reply-To: X-Cookie: Killing turkeys causes winter. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --pQhZXvAqiZgbeUkD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 09, 2020 at 04:53:02PM +0000, Steven Price wrote: > On 09/01/2020 16:28, Mark Brown wrote: > > On Thu, Jan 09, 2020 at 02:14:42PM +0000, Steven Price wrote: > > > I'm not sure if it's better, but could we just encode the list of > > > regulators into device tree. I'm a bit worried about special casing an > > > "sram" regulator given that other platforms might have a similar > > > situation but call the second regulator a different name. > > Obviously the list of regulators bound on a given platform is encoded in > > the device tree but you shouldn't really be relying on that to figure > > out what to request in the driver - the driver should know what it's > > expecting. > From a driver perspective we don't expect to have to worry about power > domains/multiple regulators - the hardware provides a bunch of power > registers to turn on/off various parts of the hardware and this should be > linked (in hardware) to a PDC which sorts it out. The GPU/PDC handles the > required sequencing. So it *should* be a case of turn power/clocks on and > go. Ah, the well abstracted and consistent hardware with which we are all so fortunate to work :) . More seriously perhaps the thing to do here is create a driver that provides a soft PDC and then push all the special case handling into that? It can then get instantiated based on the compatible or perhaps represented directly in the device tree if that makes sense. > However certain integrations may have quirks such that there are physically > multiple supplies. These are expected to all be turned on before using the > GPU. Quite how this is best represented is something I'm not sure about. If they're always on and don't ever change then that's really easy to represent in the DT without involving drivers, it's when you need to actively manage them that it's more effort. > > Bear in mind that getting regulator stuff wrong can result > > in physical damage to the system so it pays to be careful and to > > consider that platform integrators have a tendency to rely on things > > that just happen to work but aren't a good idea or accurate > > representations of the system. It's certainly *possible* to do > > something like that, the information is there, but I would not in any > > way recommend doing things that way as it's likely to not be robust. > > The possibility that the regulator setup may vary on other platforms > > (which I'd expect TBH) does suggest that just requesting a bunch of > > supply names optionally and hoping that we got all the ones that are > > important on a given platform is going to lead to trouble down the line. > Certainly if we miss a regulator the GPU isn't going to work properly (some > cores won't be able to power up successfully). However at the moment the > driver will happily do this if someone provides it with a DT which includes > regulators that it doesn't know about. So I'm not sure how adding special > case code for a SoC would help here. I thought this SoC neeed to vary the voltage on both rails as part of the power management? Things like that can lead to hardware damage if we go out of spec far enough for long enough - there can be requirements like keeping one rail a certain voltage above another or whatever. --pQhZXvAqiZgbeUkD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl4Xg8kACgkQJNaLcl1U h9DhIQf9HZ2Q1blNvGt1n4U2y9oZgTgphMEa0JMJU6uCB4DzokV/ki8co9SwPcFC feV+gosXXo6A98jenPsWIobEfWSUiwEYa5w3ClUYlcVrKLIwlUmThXvSiIS1+uva LEnxvF+4WP37piAr891qK5iZdpOoMniy8m1bBXSm75midArEGcV2rqCorXEStIih LNey+eFBxgweMQNmVL/FElCItrW6+x9HyxEGdBL4TLDMOpxC1cb/qyQUs9dAlRwQ evp+V1ZYh5rSuQqAF5XEJwA+f8k33X0VJki7BJ+Nh3IkQpVWtg0ORKW3e4hw5+DW B6Gvn1/3P+OYjc/Azm6w18G1USraiQ== =M45L -----END PGP SIGNATURE----- --pQhZXvAqiZgbeUkD--