Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2173532ybl; Thu, 9 Jan 2020 08:07:10 -0800 (PST) X-Google-Smtp-Source: APXvYqyG6mBkXwfMyBLJeddUIwirkjUWiak2BT0m9RXY9kazXLM56V1XAK7x7ADzP/ArQA6Qgt49 X-Received: by 2002:a9d:7f11:: with SMTP id j17mr9375223otq.281.1578586030648; Thu, 09 Jan 2020 08:07:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578586030; cv=none; d=google.com; s=arc-20160816; b=Y4D+uF57PGku8WXSuLK/v02Wx6qaL0XRTN+zwsygsioZolXrDuO3DXyBxuSEOq9DtJ 9c+m9lUBfjErxQlz6ksZvUF28WIeZ0Zh5K/q0YY9vXcAe4cwcUfwNU70blM2gPT4LQSo 900OLMFtwQyN77DNkax9Iew1DkEztMaMpC9k5kkZWU4OY6qXggJmRPnAJu409WJ4zGem 00wTZvw4zuuuhFNwIUWq9LgjyQWNZgDKDt8JnmYeNNM1+lQpn3xKBSOw3WGwT4BLoIPr 25evnVi4kta7heZZ1opWumPpgivSn9kTC0H3gfcdrbtQZcmysEWd4NsFToZ67oVw+fuH Ux3Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=xfWkYSkPsarnY42OAP+aSSPb8puE3wH9NfTsNK7WL+E=; b=gxB1G93pX4bwrmhEa3q1bWoipansYiSNIdLu8iH9gLNAFd1FjB8ut4Z2GCmgS3GKBL NDqOupZS33lj7C0sjIrCW2zYojO3uPHwzOe3st8AjoNu1djCqHKg1ekYhb5NRfVW9uS5 gqC5r5uZZDZYMwsS1Dcd489hRF5tQaOZd+DOFtqHGcza5wV+qZbprSI+CqZIM1WCX28M vKgywjRl2ngPGMlShWJWm3ISg7QjKnNhx6YvFbYw9EAoNaInAn9hmWcsR4wwdrdyYtd4 isaYk57l4Od3oX7d74jiYzmySoBperzYP7qy3/xVv2yjxKj3U3XbigAukhzagZzWTUDB qwIg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si3982939oie.17.2020.01.09.08.06.57; Thu, 09 Jan 2020 08:07:10 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731575AbgAIOOr (ORCPT + 99 others); Thu, 9 Jan 2020 09:14:47 -0500 Received: from foss.arm.com ([217.140.110.172]:59928 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731559AbgAIOOr (ORCPT ); Thu, 9 Jan 2020 09:14:47 -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 D33C81FB; Thu, 9 Jan 2020 06:14:46 -0800 (PST) Received: from [10.1.27.38] (unknown [10.1.27.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 254C93F534; Thu, 9 Jan 2020 06:14:43 -0800 (PST) Subject: Re: [PATCH v2 4/7] drm/panfrost: Add support for a second regulator for the GPU To: Nicolas Boichat , Mark Brown Cc: Mark Rutland , Devicetree List , Tomeu Vizoso , David Airlie , lkml , Liam Girdwood , dri-devel@lists.freedesktop.org, Rob Herring , "moderated list:ARM/Mediatek SoC support" , Alyssa Rosenzweig , Hsin-Yi Wang , Matthias Brugger , linux-arm Mailing List References: <20200108052337.65916-1-drinkcat@chromium.org> <20200108052337.65916-5-drinkcat@chromium.org> <20200108132302.GA3817@sirena.org.uk> From: Steven Price Message-ID: <09ddfac3-da8d-c039-92a0-d0f51dc3fea5@arm.com> Date: Thu, 9 Jan 2020 14:14:42 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/01/2020 22:52, Nicolas Boichat wrote: > On Wed, Jan 8, 2020 at 9:23 PM Mark Brown wrote: >> >> On Wed, Jan 08, 2020 at 01:23:34PM +0800, Nicolas Boichat wrote: >> >>> Some GPUs, namely, the bifrost/g72 part on MT8183, have a second >>> regulator for their SRAM, let's add support for that. >> >>> + pfdev->regulator_sram = devm_regulator_get_optional(pfdev->dev, "sram"); >>> + if (IS_ERR(pfdev->regulator_sram)) { >> >> This supply is required for the devices that need it so I'd therefore >> expect the driver to request the supply non-optionally based on the >> compatible string rather than just hoping that a missing regulator isn't >> important. > > That'd be a bit awkward to match, though... Currently all bifrost > share the same compatible "arm,mali-bifrost", and it'd seem > weird/wrong to match "mediatek,mt8183-mali" in this driver? I have no > idea if any other Mali implementation will require a second regulator, > but with the MT8183 we do need it, see below. > >> Though I do have to wonder given the lack of any active >> management of the supply if this is *really* part of the GPU or if it's >> more of a SoC thing, it's not clear what exactly adding this code is >> achieving. > > Well if devfreq was working (see patch 7 > https://patchwork.kernel.org/patch/11322851/ for a partial > implementation), it would adjust both mali and sram regulators, see > the OPP table in patch 2 > (https://patchwork.kernel.org/patch/11322825/): SRAM voltage needs to > be increased for frequencies >=698Mhz. > > Now if you have some better idea how to implement this, I'm all ears! 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. Steve > Thanks. > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel >