Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp713745pxv; Thu, 15 Jul 2021 14:13:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzugwMw/K6fTk37jFAOl9OdOdlG+IzssmZ4RS4qJ3Cwa6jKDLbBG2c1Ab5akgDYpfzx3nn0 X-Received: by 2002:a17:907:7709:: with SMTP id kw9mr7854934ejc.68.1626383582160; Thu, 15 Jul 2021 14:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383582; cv=none; d=google.com; s=arc-20160816; b=flTPPcpPj9fjr8F2iAhHxzRL2N+HuuB5KHpFlKObkWZ2ys2oV77Wtm9Ca0sVgnlZQN DEmx8mXe1c5s3Vau5mR54H6OIjpbq7Ek8WcJ3VXwZC/TPXKsLxc1+PeO72zCmRWpZGVf a1MrLA8V09bTiEjV5SKC0ONri15c4HCadSSg7ep54vAHceDbLZieDtIe7HwYT4MBUah7 LR9uemN7GvpG57kfmQFZMBuXNgzDPWLxVFSX2SvVshCwc4a5scidjH864Oz1iCdre0bU 5P8UJkmEi3IKqaeOY5jKeTYgqGNQC2HH2gwuSqpfgwFZQb/t0dBPI4Qq7G1r/7WZf/fM it6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=v/4GhaaC4zUoeUiK2XAukUAzxlz7FMdN9W5hls09J48=; b=eGnjWOHKDV+ixsGDfOrzxG983Tgpy+g+3sHlNPr48uVtUu+yfA8BAEpjReOShcjPUF sbzy3b5h8+SiUfcSUZz1IQmiuZ/apIp8OUYZX8UoG2qRbvpMIxqdnPXiFTXeDWnDUBm6 +sqBmEDnMOdx/fjsJf4FVHALkEo5xltWiyyiRDvzfIUsqJwfxhjwHAiz92Bnm/ODixCc NQOyDO2qTqoJQ/5MekRIHHgKb9kpxMs/QkJ2EpX7/a7uLWU+SWUkMQsZ8xRNqkObIE4H 7XONc+f0XZ3wJzhs8ETPs0B4oPqtR4i8s4gmPoYqL1QIpO707K2qafMaH+HMFJaBtA23 QpJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yrVyrDGR; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb26si11001695ejc.401.2021.07.15.14.12.39; Thu, 15 Jul 2021 14:13:02 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=yrVyrDGR; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345048AbhGOTal (ORCPT + 99 others); Thu, 15 Jul 2021 15:30:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:46122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241072AbhGOTIe (ORCPT ); Thu, 15 Jul 2021 15:08:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 47ED6613ED; Thu, 15 Jul 2021 19:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375857; bh=S9VUqqUxP5x+jTKZE7p+pVTUqhUjDBrgfdDQIXg5el4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yrVyrDGRjszFphX5vsX6nEDHv0CN4TWMvXcqacZ5sW3gW0H1B4eVRsfuible/3RiN ZpVUuXmF0uQfFqgg0gd8auXRU9ZOSo+k5TiyHjH8aVZKgNw5cFUhjFYURL4ccFqh0N wyZcsOLEk4VpYG1JbCHQpYcBphRzYPRE23QMJEfI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolas Boichat , Tomeu Vizoso , Steven Price , Sasha Levin Subject: [PATCH 5.13 023/266] drm/panfrost: devfreq: Disable devfreq when num_supplies > 1 Date: Thu, 15 Jul 2021 20:36:18 +0200 Message-Id: <20210715182618.069126471@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Boichat [ Upstream commit 09da3191827f2fd326205fb58881838e6ea36fb7 ] GPUs with more than a single regulator (e.g. G72 on MT8183) will require platform-specific handling for devfreq, for 2 reasons: 1. The opp core (drivers/opp/core.c:_generic_set_opp_regulator) does not support multiple regulators, so we'll need custom handlers. 2. Generally, platforms with 2 regulators have platform-specific constraints on how the voltages should be set (e.g. minimum/maximum voltage difference between them), so we should not just create generic handlers that simply change the voltages without taking care of those constraints. Disable devfreq for now on those GPUs. Signed-off-by: Nicolas Boichat Reviewed-by: Tomeu Vizoso Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210421132841.v13.3.I3af068abe30c9c85cabc4486385c52e56527a509@changeid Signed-off-by: Sasha Levin --- 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 47d27e54a34f..3644652f726f 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_INFO(dev, "More than 1 supply is not supported yet\n"); + return 0; + } + ret = devm_pm_opp_set_regulators(dev, pfdev->comp->supply_names, pfdev->comp->num_supplies); if (ret) { -- 2.30.2