Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp133433pxy; Tue, 20 Apr 2021 22:33:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfjmCZy2EVlpVje3PSu9mspagcLI56IWYAvVv7gm5uhUBIMTWtuHSJ/rwTrmTjTbk6QCpa X-Received: by 2002:a05:6402:34c2:: with SMTP id w2mr5817465edc.71.1618983220974; Tue, 20 Apr 2021 22:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618983220; cv=none; d=google.com; s=arc-20160816; b=zdUg5XgERc/gwDX0cYipXxUeQiG44v2mg7mCJUrvLCMNhtv60h1MuRf3FAL51eJMj0 UaJoOcnIIDONQ3a55bDwUOi078cnVuPx8hynaOqDmgVNcDJAh0tVyEYX3EJhiWPBS/41 46aqBhIvSJSYKBGncqZrW26Ys2w05nViXithsoroWjZWQ787qd9pV1yaf9TYDhplUD3T Y539dZyurmdia425eKHUKT6HNBVdkrzAkeGJfiHssvsNjWvTpkQoAkhFKW4PMn/KN/6T eg2RNDPnLv+sXRiQfgJbmn8Ey1d3znSZBDQgOdLfgHdmoAoteTVS/sItc6g1WBdB05R/ OkkA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S9cFyFhO9R2yAwKrT8XRyCRc7wvjemRTlbN3hfsszKw=; b=wX0JxI7OlI4QieW14OTwwOywaHYeciXYNYFVK5OhvsXEtKHmqzVrWXge0a2d1dByw+ ybNjioISlkoj0D6hSlqOdrk13gtDo6W9thgpfz8WvFbUR1CfSY/0yv4N5ppKSY4cPWv6 zgaIsXthjpjnNpjobqDm85jnHuVTO9Ht3LjhIdjCZF29J5foUMIcxNBtWILse3Ms7w5N e/oFWYie+vXrOiJdUxdVVVOF1ECdIGYiV7I4OwBVvxsDV/+vlqxqGj3UWyt+rrpk1UmC uRbe65e5O0w1H7esLLq0NVOstoi4J1wmsV/SwaM+9chs2JqSxLDNtE6NmRxsLbxUpqjk u8Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GT2Mj0sp; 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 p5si1211947edt.42.2021.04.20.22.33.17; Tue, 20 Apr 2021 22:33:40 -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=@chromium.org header.s=google header.b=GT2Mj0sp; 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 S235155AbhDUF3t (ORCPT + 99 others); Wed, 21 Apr 2021 01:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235143AbhDUF3p (ORCPT ); Wed, 21 Apr 2021 01:29:45 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A354AC06174A for ; Tue, 20 Apr 2021 22:29:12 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id z16so28659047pga.1 for ; Tue, 20 Apr 2021 22:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S9cFyFhO9R2yAwKrT8XRyCRc7wvjemRTlbN3hfsszKw=; b=GT2Mj0spMd/69rT4+Fhdj1pS4MN1vIrov8lSPUi/QFrEy7oGA7K7MmZZ1+0t07zuQZ 87Jy+zbUfAP3B0gYZYGYN4mBxnffj+twRcqVepho+einnzZUKjVnU37e3EoA6u+Gbmhf ydsF6en+tAM9NroZp8rB2CV9mTcPYkDO5modg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S9cFyFhO9R2yAwKrT8XRyCRc7wvjemRTlbN3hfsszKw=; b=febckLHgChz9LlqfYLQNt2hgO2/mFaXkVLCIZPTIpESlK8592J0tphFX7tb0AOf+CP SpchN+fxk8DS5DF+9pXvHNBvRTGnJYUH4JgasQYeIa1ta4pFTkoMv67BMnNTVYwq3ztZ dobPnmQnQkDx7M2crJ4UtvyPpSyHS+DrIioodaELBTDRDqKpAizSSXLlTYKMECZBcpRn as3nV/6jx+/DVJkeNMVzn6meaWUv+H+FlTtinvQEH7SxcIVX0V+txEoVdmE97myZAlQM FUX8iEzj4vZIXLOxaRsPfX0YCpGczcQigKoCBpj+swqOapXN0yFWXR7gRWBUcDuwbcji 53WA== X-Gm-Message-State: AOAM530Hs6Ofrq5JgJ2QS1lZyd6qj4jeutGK2RGh66VPFOm9C3VsWBuR QNbGq5nqGuwEkA7Bfzbuj1FNCw== X-Received: by 2002:aa7:9817:0:b029:25d:f866:4a71 with SMTP id e23-20020aa798170000b029025df8664a71mr16154245pfl.47.1618982952228; Tue, 20 Apr 2021 22:29:12 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:b3e5:49c0:4843:2bbe]) by smtp.gmail.com with ESMTPSA id b6sm602537pfa.185.2021.04.20.22.29.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 22:29:10 -0700 (PDT) From: Nicolas Boichat To: Rob Herring , Steven Price , Alyssa Rosenzweig Cc: fshao@chromium.org, hsinyi@chromium.org, hoegsberg@chromium.org, Tomeu Vizoso , Neil Armstrong , boris.brezillon@collabora.com, Nicolas Boichat , Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v13 3/4] drm/panfrost: devfreq: Disable devfreq when num_supplies > 1 Date: Wed, 21 Apr 2021 13:28:54 +0800 Message-Id: <20210421132841.v13.3.I3af068abe30c9c85cabc4486385c52e56527a509@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210421052855.1279713-1-drinkcat@chromium.org> References: <20210421052855.1279713-1-drinkcat@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Changes in v13: - devfreq: Fix conflict resolution mistake when rebasing, didn't even compile. Oops. Changes in v9: - Explain why devfreq needs to be disabled for GPUs with >1 regulators. Changes in v8: - Use DRM_DEV_INFO instead of ERROR Changes in v7: - Fix GPU ID in commit message Changes in v6: - devfreq: 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 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.31.1.368.gbe11c130af-goog