Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp686746pxu; Thu, 7 Jan 2021 15:54:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVpmGEgN7OiEdIELwJwcTOr2/KCMi0wBf9fEddKDIzZ7n85Fuj8Ng3T7b/ByivD+mj+0lt X-Received: by 2002:a17:907:389:: with SMTP id ss9mr929075ejb.158.1610063689671; Thu, 07 Jan 2021 15:54:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610063689; cv=none; d=google.com; s=arc-20160816; b=lrr5MeL0RmeFVGO1Av8NuqU3PDgUXATHeRt9g6tsP4taUl8JizOxfYYC8qOLBlw8Ci gUHae9BR4l2NevgqbyQhSbdjTN9hpO2KSi6PxqZqn+onzefjkCRD+VKZbPjF4u6egkn2 jQGmeOS4bTY6Zz96WbJRJvMWTbHA43D6i2yOif+yGNus9Az1jWKvkTIjG3SYzkVUWRY1 AjyyErn1wb3mDyUOGi5X1zpqWI7dnW6X77KNcP765TPcPuJWEEPk8XwC4dnqCOOGf5sy N3TcYKdXq6SCcuDd5SYaIBTFTFlWGaRPE+p6SbWAFi7BqHH/2Ml+a1WNj33c8EKKbvfB Hp8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=saxzFi2qg+LHi04jHDIQ3UvqFgOV5HAgl5X/y1F1t08=; b=sQtb2NTHwSQn0CkOnfB3R9hgrB0ZpuJ45V1ExgCU00X7IkrD5PCy2krgngSqYv7r6P nX3bbFUXOo3434jVzdULErYtg7eldahxohFCuxqkZrCRwgppmcHbKtwb70lMujVSUYwB wu0e+BGLe34xXJGmVhy6PMAVxylHiJsN3fsjoaXCrkn1NC/WhfiWIC5ADIbOJlaoHFh2 1ONv6AtaHVRdgw36ZWR26/HOiS2X3VrLZpRlbW0kz8CShZ1LtCPwEBlj6xuJNhWPPJ+N CwSBdM5sPPySvbkE3livzTOp2Mk59U2loF1e643VHl0fzM2tpjVIjAgX4dDN5MLUzVHv 8H9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="dL/mVSlv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id kd24si962888ejc.530.2021.01.07.15.54.25; Thu, 07 Jan 2021 15:54:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="dL/mVSlv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729301AbhAGXwW (ORCPT + 99 others); Thu, 7 Jan 2021 18:52:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728735AbhAGXwV (ORCPT ); Thu, 7 Jan 2021 18:52:21 -0500 Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 969B2C0612F5 for ; Thu, 7 Jan 2021 15:51:41 -0800 (PST) Received: by mail-vs1-xe31.google.com with SMTP id z16so4602594vsp.5 for ; Thu, 07 Jan 2021 15:51:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=saxzFi2qg+LHi04jHDIQ3UvqFgOV5HAgl5X/y1F1t08=; b=dL/mVSlvGXthCVPyZ6Pe+O48W73y116kleZpYbPxK++MAfqzp1qMmveKDKu/OAi4qP qFOvto+IkJa192coHUzkjlT5xp9P5i270Vo9+7gDcXnbhVypCb4BQLgETBusGpkVch3+ IR6xBKmCFQ9prL/01SEfafD6/FykeURCpL0Lk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=saxzFi2qg+LHi04jHDIQ3UvqFgOV5HAgl5X/y1F1t08=; b=M7tDjuSjenULt4jSvd+FGaCVpF5PwTe4AEUNBU8Th8C5S06P6ad6e1j/jIaoB1SHJs jtNJXoi1TdhrqT3+IK/V4KSPAl+kl0B/x0watz2Qg2oR9Pl+a6zAFCe9DxRigbRLhCFf yZzu5x8aleFsOZPipW1VowxkyG8W6+ZIHdWKOXWx32iQr3w+pT3s/PGNCC8YTHV9ouZD De0na6hU+ND3Q49H37M5TnE/G4YVFy78lHM1kEX5njX1vtG9I3BXJtbGOdyTMvWp2jjy xn1cfwmSOfqNoB3v3Nlf++K2rfHrf1H6LEZPWjqMUdCnrRw+CqhEXALZSHkFDGAbCCIa 0N7w== X-Gm-Message-State: AOAM533QwYlB/IzqhHfbatTqS5HWx40N8UDv0S2F57r1wtuF28uAeTce bEB7FCwsTqQG561fdMTilrnuJhvlCb6Lrzw81Yd2LA== X-Received: by 2002:a67:7993:: with SMTP id u141mr733890vsc.21.1610063500807; Thu, 07 Jan 2021 15:51:40 -0800 (PST) MIME-Version: 1.0 References: <20210105001119.2129559-1-drinkcat@chromium.org> <20210105081111.v6.3.I3af068abe30c9c85cabc4486385c52e56527a509@changeid> In-Reply-To: From: Nicolas Boichat Date: Fri, 8 Jan 2021 07:51:29 +0800 Message-ID: Subject: Re: [PATCH v6 3/4] drm/panfrost: devfreq: Disable devfreq when num_supplies > 1 To: Steven Price Cc: Rob Herring , Alyssa Rosenzweig , Hsin-Yi Wang , Kristian Kristensen , Fei Shao , Boris Brezillon , Daniel Vetter , David Airlie , Tomeu Vizoso , dri-devel , lkml Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 7, 2021 at 11:59 PM Steven Price wrote: > > On 05/01/2021 00:11, Nicolas Boichat wrote: > > GPUs with more than a single regulator (e.g. G-57 on MT8183) will > > require platform-specific handling, disable devfreq for now. > > Can you explain what actually goes wrong here? AFAICT the existing code > does support controlling multiple regulators - but clearly this is the > first platform that exercises that code with num_supplies>1. Sure, I should have expanded in the commit message, will do in v9. We have support for >1 supplies, and we need to enable them to get the GPU running _at all_ (and the default voltages should be safe by design). For devfreq though: 1. There are constraints on the voltage difference between the core and SRAM, we have this caterpillar logic downstream [1], so somebody will need to port it (TBH I don't think it's overly critical at this point, as Bifrost support is still not very mature from what I can see, and devfreq is purely a performance thing). 2. The core [2] does not support multiple regulators, so we'll need custom code anyway. Even if we didn't have constraints. [1] https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/heads/chromeos-4.19/drivers/gpu/arm/bifrost/platform/mediatek/mali_kbase_runtime_pm.c#367 [2] https://elixir.bootlin.com/linux/latest/source/drivers/opp/core.c#L679 > > Steve > > > > > Signed-off-by: Nicolas Boichat > > --- > > > > Changes in v6: > > - New change > > > > drivers/gpu/drm/panfrost/panfrost_devfreq.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > > index f44d28fad085..1f49043aae73 100644 > > --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c > > +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > > @@ -92,6 +92,15 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) > > struct thermal_cooling_device *cooling; > > struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; > > > > + if (pfdev->comp->num_supplies > 1) { > > + /* > > + * GPUs with more than 1 supply require platform-specific handling: > > + * continue without devfreq > > + */ > > + DRM_DEV_ERROR(dev, "More than 1 supply is not supported yet\n"); > > + return 0; > > + } > > + > > opp_table = dev_pm_opp_set_regulators(dev, pfdev->comp->supply_names, > > pfdev->comp->num_supplies); > > if (IS_ERR(opp_table)) { > > >