Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2255789rwl; Sat, 1 Apr 2023 04:56:08 -0700 (PDT) X-Google-Smtp-Source: AKy350YyCrGGOkZissFdXKkz7NdzlZH0vASpsCYd1VNBaVirBMkinfREODwaxDFxK4ughpyHEWWK X-Received: by 2002:a17:906:ca56:b0:921:7e42:2777 with SMTP id jx22-20020a170906ca5600b009217e422777mr33365094ejb.69.1680350168445; Sat, 01 Apr 2023 04:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680350168; cv=none; d=google.com; s=arc-20160816; b=rMsAxOdJcXekazsclQfL2dCHY5A0SWaQysd9iB4ZwNz2FhyTWuEjt9Vh6C9B/Q1Osb aIvjbtyg8IZBLE+4dwBl2WGKqK7bmniXjAh2WF/E6EOE2sp9bHldkWGIOpT/wkN7CheJ TE2TLjNkS2QVAso6KA7QXQBPUI5WNXAdx4LvEyA+W0pntwFA0hGRvD/pJyGVb+9PynbD 4kIY7rzzRZ6P7D1z5I84/ph0aSMXiRXk6KbCZIxbQyPamRyP7cGrnLib6fT81bGxFEw7 ISLY+4Jnf7xUNTK+cXvY+0VoMS/64ohxIDJTrw1bQl97u34XwCUiqnGXXPnLCDEKUVQp cZXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ctHnqMHZO0pzp/yb6Z2dEorUTEc6FXrEYWhX8iD6OjI=; b=uoUGSjL66smedjti2NqjX+OcNkfnjHlZ27CDcnJAjf3sV2pHzFyybGPjEiZNKGn124 HNF5jNTFBy/ppYdtbOothYok8VdUi4ye2yPPXVvtiP3EoxD7CA7Yf9q/XpI65RGqIl6s 5feCXqNbkZwGRryJIrfiwadJ9QPoAjOvHPxgeWyC3HdevPfMLw6xQdedS1m/zjABNvqM iHOvK3B3kz3bTMoSI1NvPtYHhr2MHNUqvjnFMKpojvNUYFIPJP7kWHKCtU+fzd5nUPX3 zyoKK+KHdKHnLI2WWKuu75gjBFPGO/5Q1K6ORcroKad3IZ8hW9y9zaJ5o4rbQA4W1kmM Kv4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aVGHIcDw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020aa7c1c4000000b004ab41ef87c3si4228057edp.442.2023.04.01.04.55.43; Sat, 01 Apr 2023 04:56:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aVGHIcDw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229804AbjDALy5 (ORCPT + 99 others); Sat, 1 Apr 2023 07:54:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbjDALyz (ORCPT ); Sat, 1 Apr 2023 07:54:55 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29ED01C1CD for ; Sat, 1 Apr 2023 04:54:53 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id q16so32197807lfe.10 for ; Sat, 01 Apr 2023 04:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680350091; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ctHnqMHZO0pzp/yb6Z2dEorUTEc6FXrEYWhX8iD6OjI=; b=aVGHIcDwAhHEbX8rTDGY5Rb7qR+M8HNPK1MH/vfK/lO55HbWywTqJdioncURcXv74e uYUfZxuRkvuzEdG+Y8CDvm9LahtJQPUhWh5yf/HJm6EfXfTLdNdesGBE5Or4MSIVY+xE orjq0j64cZMqQrb0MWijoKzQ+mVpMQ4EDd1EL0NcOEm6OgjcOsBEuBe5a3+A8XaXz7Zh q7V2dWHDmHmbL29R0wg+Ti3q6nM7B4pV6Z5BYUz0MbC+L8Rp79e7uV7bangEAU3uTgVf Qhz0JiukPVUgwnO6F2/EQv5JbXJNJh2pcpZyuERJB7pJNJILCGqm5SyDjg6nJ1JQS18d 2heA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680350091; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ctHnqMHZO0pzp/yb6Z2dEorUTEc6FXrEYWhX8iD6OjI=; b=Tkl8xkxHv5eETFh5xK7FJnxMbx4Tnz2oj+eXZ2s3DTiiXDohyfXcqvKWVqD6Ffr57U r6wG5iE96z8dG1cqF7zNM6V/m46o2K/hYXxs8d6yKJIAU5EmfbU68UcVHWDFmLJBY8xz 2Mn3sgmayx1sNZu81aHV3cozkYFLkcbx+kLSte7Ls25MmrAxLAE77HdLtJNfdku/I6Xz c1sAipTXB/ihg8l+YW7+IK+28HpL2zB88r2FbwwJ/NkkPw8EbArKd9ZfSwAgOGWOx89r pQz/iRaQngXBvlRDYmas7SzQ1EQnN6VkPyz400NW81H+EGYWzX1Fci0SnhYr84nSy2mY fDUQ== X-Gm-Message-State: AAQBX9fGmFfJsDhfVUfWRdihalHsGq/6mtA6emWYHi8G1Jz+e4CTSaxO LtB4O36nr7jqV9/UJWDdUnto/A== X-Received: by 2002:ac2:5972:0:b0:4db:3847:12f0 with SMTP id h18-20020ac25972000000b004db384712f0mr9567501lfp.50.1680350091424; Sat, 01 Apr 2023 04:54:51 -0700 (PDT) Received: from [192.168.1.101] (abxj225.neoplus.adsl.tpnet.pl. [83.9.3.225]) by smtp.gmail.com with ESMTPSA id w8-20020ac254a8000000b004e83f386878sm786737lfk.153.2023.04.01.04.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Apr 2023 04:54:51 -0700 (PDT) From: Konrad Dybcio Date: Sat, 01 Apr 2023 13:54:38 +0200 Subject: [PATCH v6 01/15] drm/msm/adreno: adreno_gpu: Don't set OPP scaling clock w/ GMU MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230223-topic-gmuwrapper-v6-1-2034115bb60c@linaro.org> References: <20230223-topic-gmuwrapper-v6-0-2034115bb60c@linaro.org> In-Reply-To: <20230223-topic-gmuwrapper-v6-0-2034115bb60c@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Bjorn Andersson , Konrad Dybcio , Akhil P Oommen Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Clark , Marijn Suijten , Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680350084; l=2082; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=uLNnu/k+L1QbWFWkCWE2U/K/JWVJJaw9MSaaSbA5pkE=; b=c69tvTZp+eIVVV5kmR4XL9hM2jDTb2CKHbPZwbWjhYEMNXj783BF9pyz0eHWUGzzmv+6khEclsDI yYPF1Uk6C03PYld7+6ehn4/5kGtJCEAZhtxsV29rkQPqEQgn8BZv X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recently I contributed the switch to OPP API for all Adreno generations. I did however also skip over the fact that GPUs with a GMU don't specify a core clock of any kind in the GPU node. While that didn't break anything, it did introduce unwanted spam in the dmesg: adreno 5000000.gpu: error -ENOENT: _opp_set_clknames: Couldn't find clock with name: core_clk Guard the entire logic so that it's not used with GMU-equipped GPUs. Fixes: 9f251f934012 ("drm/msm/adreno: Use OPP for every GPU generation") Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index bb38e728864d..6934cee07d42 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -1074,18 +1074,22 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, u32 speedbin; int ret; - /* - * This can only be done before devm_pm_opp_of_add_table(), or - * dev_pm_opp_set_config() will WARN_ON() - */ - if (IS_ERR(devm_clk_get(dev, "core"))) { + /* Only handle the core clock when GMU is not in use */ + if (config->rev.core < 6) { /* - * If "core" is absent, go for the legacy clock name. - * If we got this far in probing, it's a given one of them exists. + * This can only be done before devm_pm_opp_of_add_table(), or + * dev_pm_opp_set_config() will WARN_ON() */ - devm_pm_opp_set_clkname(dev, "core_clk"); - } else - devm_pm_opp_set_clkname(dev, "core"); + if (IS_ERR(devm_clk_get(dev, "core"))) { + /* + * If "core" is absent, go for the legacy clock name. + * If we got this far in probing, it's a given one of + * them exists. + */ + devm_pm_opp_set_clkname(dev, "core_clk"); + } else + devm_pm_opp_set_clkname(dev, "core"); + } adreno_gpu->funcs = funcs; adreno_gpu->info = adreno_info(config->rev); -- 2.40.0