From patchwork Sun May 10 16:55:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539793 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C13C1912 for ; Mon, 11 May 2020 07:18:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9EEC82080C for ; Mon, 11 May 2020 07:18:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LgVoPKRX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EEC82080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D6186E20E; Mon, 11 May 2020 07:17:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6FD4989F8E for ; Sun, 10 May 2020 16:55:44 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id x17so7960123wrt.5 for ; Sun, 10 May 2020 09:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SCZR0RDMG3XJhGAGRvblpDgemNbadL77Ape7/cMT2Jk=; b=LgVoPKRXtKyWOqYktFWRpIfKlpXdA950wCd2yJkk1y6mRWG9CgvwhxCh+VLXpXYi8G isZlsRVnB2AJfLgDpBf5IwLL+F+xLLm+vLe5V8dfFZ1lZ5XxiQN1M+euNM0cjj8s6dxT 4y3jVmrE0FzRMojZ1yZZw1dT+gmZ7jPBZFO7tFnCMJhrHGQSd9XmAV4gGs0aLissqb98 UiLnV2bb5HGcSGff55PmCb2b9neSqsPsctfKOJWOLJBxeLc0n/RMBYmAzW2bxvzZ1o7G ca7cOJPGz/1a4XLT6HD1Y0EKIZy2oDbA8DL6NGUCyrNQm5rMurIRCp1EksMFjVRmDR1V 77tA== 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=SCZR0RDMG3XJhGAGRvblpDgemNbadL77Ape7/cMT2Jk=; b=eLhBPop3xHwRvg+GnMCIJ9Z9iBo0iYefNILwrApl7xJVypORxV+J01FUFmfJwNb363 GFIjkbR3RFEF0I9fCRddO4AJGsQz3A9SDv4YELLtRyn4flKatYF6jXWZA8eT9rCDFnYq Sg6RaQHfB3k6278OoOH6H2i/WnyRjvSacuwmkPtprnoJhP9Rb08pI9UCiLlbHaly4wGL gdI0HqVwEQsFFOqjzO9fKnqDjUqZfuGzzZtYtVjXzj42Mg1HoGnA6R7aVYTx78yJzJQ3 XTIf+ArSoQTlcbXqqZb0HLzFNFk22+E6UMxY2P5PYZA5yrxS6V7EEzIfejQixunN/guQ Rlpg== X-Gm-Message-State: AGi0Pub1pnEJJFpHRvA9RN3M7EdxJc2y4TkWPeLCrQ9fZuil3cKJUTpZ mHan+1dfbGtvUuMKx+ODFbE= X-Google-Smtp-Source: APiQypKtLpPlZkPTEpuhPfSdLDXG2WtCWVp/p+U2lL9gCsx/HvonVK58WW19yileLXj8XmEnrOCQcQ== X-Received: by 2002:adf:afd6:: with SMTP id y22mr13959393wrd.417.1589129743009; Sun, 10 May 2020 09:55:43 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:42 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 01/15] drm/panfrost: avoid static declaration Date: Sun, 10 May 2020 18:55:24 +0200 Message-Id: <20200510165538.19720-2-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This declaration can be avoided so change it. Signed-off-by: Clément Péron Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 38 ++++++++++----------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 413987038fbf..1b560b903ea6 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -14,7 +14,24 @@ #include "panfrost_gpu.h" #include "panfrost_regs.h" -static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev); +static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev) +{ + ktime_t now; + ktime_t last; + + if (!pfdev->devfreq.devfreq) + return; + + now = ktime_get(); + last = pfdev->devfreq.time_last_update; + + if (atomic_read(&pfdev->devfreq.busy_count) > 0) + pfdev->devfreq.busy_time += ktime_sub(now, last); + else + pfdev->devfreq.idle_time += ktime_sub(now, last); + + pfdev->devfreq.time_last_update = now; +} static int panfrost_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) @@ -139,25 +156,6 @@ void panfrost_devfreq_suspend(struct panfrost_device *pfdev) devfreq_suspend_device(pfdev->devfreq.devfreq); } -static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev) -{ - ktime_t now; - ktime_t last; - - if (!pfdev->devfreq.devfreq) - return; - - now = ktime_get(); - last = pfdev->devfreq.time_last_update; - - if (atomic_read(&pfdev->devfreq.busy_count) > 0) - pfdev->devfreq.busy_time += ktime_sub(now, last); - else - pfdev->devfreq.idle_time += ktime_sub(now, last); - - pfdev->devfreq.time_last_update = now; -} - void panfrost_devfreq_record_busy(struct panfrost_device *pfdev) { panfrost_devfreq_update_utilization(pfdev); From patchwork Sun May 10 16:55:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4762912 for ; Mon, 11 May 2020 07:18:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A20F4207FF for ; Mon, 11 May 2020 07:18:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EDkMYRXi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A20F4207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0FC9C6E1DE; Mon, 11 May 2020 07:17:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7459589F8E for ; Sun, 10 May 2020 16:55:45 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id w19so1556065wmc.1 for ; Sun, 10 May 2020 09:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t8UE18pCOZAfJo/w5THwQJ6FMg6LICrZ1Evr9g3xVdI=; b=EDkMYRXi7wtLjEhK2L0/ce9M37GzwRQ+JciCHsBHDqE8BSg395qaMTKehVjyf3wERr lHpTMZpUeL7LiZMTKM23Q6B9IxKp/OjcOamFqu/FTiAIvIgHKSi7ZDAyI2gNwhqyEjQv 3KNolQxMevQ7uSA/y/XtAU/pDqsY4xetoZEySMxoZ0sszpktEn+vBcLM+EsIbo8mPcIb LbjWBB7Kqv0+AFyVwIJRM/y7KvUMeScFkmF/hq3XQzrS1wt7vqhAlzMZZitbR0X6tlaz +lgdw3cO8PZVFimCOHSTMxVQNDe+YLumbioRF+i6XkvkJjwvmhGZ9o8+8cQUU9S6PW+E rpOA== 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=t8UE18pCOZAfJo/w5THwQJ6FMg6LICrZ1Evr9g3xVdI=; b=ngiSn/ruO0/N/l/XGQUvgH7M1/01BJCRwkoed662tQEdX8NvE02O+TT5FcqEHG1NXw dg3BoTr5nEXg8nvSAEFb8vLWe3LjUeBKVL3WTCBTYfGqXBfkS/gp3owcKiYC8QOSCuLU 7WuLPPCwyN8afKC9fV/gG4CJ7kxiKZNs8V9OpUioGV5H9auVkFDDFlEuxOf4cDrB9Aj5 SmETzDFizJPbiWlQo89Jhu1qvE5oKDVKaD9JN28WfLs9HCAXYvHo19Cghl6zwhX/zws9 tEN8VPUGnZM8mqCdNUBowFnrb/nqOUTMz9pvAbOozxl4hrqnM5AEd8170JGi5KxyLms5 oyjw== X-Gm-Message-State: AGi0PuYcTAJHK7Wrz+inlwEBLw3UoxwSnh0rW/6idQo0uYCdiTzBgaIO BRE0I/D5aG/2o36Aj7y9RM0= X-Google-Smtp-Source: APiQypJJwRD+VbQWR/BDoQEXOHxwwcjQSwAjkeW+rRkHkwxah1eAHal5gfV7ivYVJ81DX7eY5fpRIg== X-Received: by 2002:a1c:f416:: with SMTP id z22mr27009245wma.32.1589129744055; Sun, 10 May 2020 09:55:44 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:43 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 02/15] drm/panfrost: clean headers in devfreq Date: Sun, 10 May 2020 18:55:25 +0200 Message-Id: <20200510165538.19720-3-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Don't include not required headers and sort them. Signed-off-by: Clément Péron Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 1b560b903ea6..df7b71da9a84 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -1,18 +1,14 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright 2019 Collabora ltd. */ + +#include #include #include #include #include -#include -#include #include "panfrost_device.h" #include "panfrost_devfreq.h" -#include "panfrost_features.h" -#include "panfrost_issues.h" -#include "panfrost_gpu.h" -#include "panfrost_regs.h" static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev) { From patchwork Sun May 10 16:55:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539799 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 281E815E6 for ; Mon, 11 May 2020 07:18:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 068152082E for ; Mon, 11 May 2020 07:18:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XyIHXFLd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 068152082E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CAE456E228; Mon, 11 May 2020 07:17:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 906FD89F9F for ; Sun, 10 May 2020 16:55:46 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id m12so10523215wmc.0 for ; Sun, 10 May 2020 09:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HSgv1QfgHBl9OVDnkQxlixfpsorIFLdZ30raefsXV+Y=; b=XyIHXFLdPmo8XDR2EbD3f4LZKJvpR5nEjFLo2fHm7OiGnG1ZLTm7Y0Oqst5lSmU0QS /y7AqDLRzclVlEMWXeq0rjRPYYkoOo7zwaS+KEkf6uXXNZINFC/4iPQhjuo2BnMETZzE wSYI/AcnCrIDVX0B7UbmAFsZXGSIsk81fU6g++gjF0nWQnqsCb5ydFeApKAzvuC0FeXx N+NL+tZ0IgmH1OvNDxVj1EOQhq3VpgJsJtAY+mgxn97HB2ZXVdl+eGZeBQyDurOC+x63 SbyHVZN1A7Daz0F5JS1Vi6kJ8PbJW8mqh7aZ3s80bL5i9DjpNvzRKN0f6IEBH0yADLiQ P8GQ== 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=HSgv1QfgHBl9OVDnkQxlixfpsorIFLdZ30raefsXV+Y=; b=tKhqelprqaZ7aqm27/k93sbpAHeoQl4ENZaB46f0olycN4mckaYuuRTzBwVOvkr9g5 Sa1OfgLBImsKM7KDP6cv4mnIENRtAh2R4c4p26YvPt95yBLRGH1HGUp2FnM4S5rpjx8R 1GcMg4D3UXBbM8C01pzQm3CkD9sVt0nJtsXIk2y67jYRYqjWcUXiPGqAQe095IPZN+S/ s20pYxxKSUcgJkxAdabKHfWObOa6s9F8Az9H05ef1Jst6kSnta8Cv95A6LMMkJl2+Bk5 PvSe+BDe6d9dCto6L3bWCUMyiOi5nXWnWAwUaOHmHvY1l54cMnE0tQFavzNdmJ6/30/s rl+A== X-Gm-Message-State: AGi0PuYC9QReNSM+EQ8xRJ9de4V/q0icc+H8bVbvoFaOXzZ8x7oq1ksP CARK4RHU3cd/gi0HucRtIK8= X-Google-Smtp-Source: APiQypIWZQXaykOe/sU/+MafA9q+T0VrOldhVw/hxI89FHnJ1WJoeR0FXFCU0WtQj9v6kb2KkDqi7w== X-Received: by 2002:a05:600c:3cd:: with SMTP id z13mr7798860wmd.159.1589129745048; Sun, 10 May 2020 09:55:45 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:44 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 03/15] drm/panfrost: don't use pfdevfreq.busy_count to know if hw is idle Date: Sun, 10 May 2020 18:55:26 +0200 Message-Id: <20200510165538.19720-4-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This use devfreq variable that will be lock with spinlock in future patches. We should either introduce a function to access this one but as devfreq is optional let's just remove it. Signed-off-by: Clément Péron Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_job.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index 7914b1570841..63e32a9f2749 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c @@ -581,10 +581,6 @@ int panfrost_job_is_idle(struct panfrost_device *pfdev) struct panfrost_job_slot *js = pfdev->js; int i; - /* Check whether the hardware is idle */ - if (atomic_read(&pfdev->devfreq.busy_count)) - return false; - for (i = 0; i < NUM_JOB_SLOTS; i++) { /* If there are any jobs in the HW queue, we're not idle */ if (atomic_read(&js->queue[i].sched.hw_rq_count)) From patchwork Sun May 10 16:55:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0119B15E6 for ; Mon, 11 May 2020 07:18:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D37FA207FF for ; Mon, 11 May 2020 07:18:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V62G+u1l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D37FA207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D51A6E214; Mon, 11 May 2020 07:17:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id A192F89FAC for ; Sun, 10 May 2020 16:55:47 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id w19so1556199wmc.1 for ; Sun, 10 May 2020 09:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cqhTQ4MchRrdMC/BErUr60iLjR/HsqACJkfzfIXlaXE=; b=V62G+u1luSo+Ix3z5FHQl0QdgvamzUNfd1AuAbg4gRQSqahvoPLcR0S0OfuhI11QlJ WzTl+DgDpYzPWIU+e7/9ncnJMXdgiAI2G0512J/Yx1nDVs4v7ur/mddJJDoNHbiRkSNB 5tjNRIvZpzVUuC8uHgCHu8x1XYFMRf3wZfgTbeN0BBhlUuBsthhMIDjIswvAYfEnaU7n wseW6iLOUeHDb7dDlFImdVsxpXoHNttIgNmxGFufGFq1yY6Qc9bIe1cc+vYx7r5/ZhQi FsroW/oPp24gU42C+p2VMzTjgWFHYBEcMH8MivYvUgnj74p3bFX24TMrQizBxg+sd5hx x/6A== 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=cqhTQ4MchRrdMC/BErUr60iLjR/HsqACJkfzfIXlaXE=; b=jSMGW3h9oZ3cIbWmsOXvJWeZf2in0WjMr3LuglFPSGyUu+EZAisV82TN8X7tE+GIl9 qFCzHui/jrHizzESHNWIbY/X8seDEMTnUHYNHoqskY57iEhzM4sJjz2dM8IVnbAxnglR 4KLbkwNr4c1qSilFGYP4NnBRc8XE5Hs5bad30PRxF9/wFhdFLNVX1dRki2I9d2elPZNc 2b5ZqL6CfxT9gzz8UMQs/7hzkCFe2KssTzP81YC2jhaYeaxKcInd+5QPtKFSafNKK6K3 KQpaErEDqgl8pbz8AitM0d4osWKSY/ikpTTWOglNH6I+a98ValXHbDfDR1Jj8qmP+hbN GOAA== X-Gm-Message-State: AGi0Puac7z75QLhjT/d9C7dtqE1AbecIIa601iF2zC0I5BMU/aAzRpak gq+okJtXXdM4FO9+nJM5YNs= X-Google-Smtp-Source: APiQypKlEMxaQkxeNQk0/8XJuhC1XFXi+rP9ETXhIwa29YdNlFoAqrx0BPXMUhDYfTFsJO+bb3V39g== X-Received: by 2002:a1c:5502:: with SMTP id j2mr28711768wmb.56.1589129746230; Sun, 10 May 2020 09:55:46 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:45 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 04/15] drm/panfrost: introduce panfrost_devfreq struct Date: Sun, 10 May 2020 18:55:27 +0200 Message-Id: <20200510165538.19720-5-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:27 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Introduce a proper panfrost_devfreq to deal with devfreq variables. Signed-off-by: Clément Péron Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 76 ++++++++++++--------- drivers/gpu/drm/panfrost/panfrost_devfreq.h | 20 +++++- drivers/gpu/drm/panfrost/panfrost_device.h | 11 +-- drivers/gpu/drm/panfrost/panfrost_job.c | 6 +- 4 files changed, 66 insertions(+), 47 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index df7b71da9a84..962550363391 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -10,23 +10,23 @@ #include "panfrost_device.h" #include "panfrost_devfreq.h" -static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev) +static void panfrost_devfreq_update_utilization(struct panfrost_devfreq *pfdevfreq) { ktime_t now; ktime_t last; - if (!pfdev->devfreq.devfreq) + if (!pfdevfreq->devfreq) return; now = ktime_get(); - last = pfdev->devfreq.time_last_update; + last = pfdevfreq->time_last_update; - if (atomic_read(&pfdev->devfreq.busy_count) > 0) - pfdev->devfreq.busy_time += ktime_sub(now, last); + if (atomic_read(&pfdevfreq->busy_count) > 0) + pfdevfreq->busy_time += ktime_sub(now, last); else - pfdev->devfreq.idle_time += ktime_sub(now, last); + pfdevfreq->idle_time += ktime_sub(now, last); - pfdev->devfreq.time_last_update = now; + pfdevfreq->time_last_update = now; } static int panfrost_devfreq_target(struct device *dev, unsigned long *freq, @@ -47,30 +47,31 @@ static int panfrost_devfreq_target(struct device *dev, unsigned long *freq, return 0; } -static void panfrost_devfreq_reset(struct panfrost_device *pfdev) +static void panfrost_devfreq_reset(struct panfrost_devfreq *pfdevfreq) { - pfdev->devfreq.busy_time = 0; - pfdev->devfreq.idle_time = 0; - pfdev->devfreq.time_last_update = ktime_get(); + pfdevfreq->busy_time = 0; + pfdevfreq->idle_time = 0; + pfdevfreq->time_last_update = ktime_get(); } static int panfrost_devfreq_get_dev_status(struct device *dev, struct devfreq_dev_status *status) { struct panfrost_device *pfdev = dev_get_drvdata(dev); + struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; - panfrost_devfreq_update_utilization(pfdev); + panfrost_devfreq_update_utilization(pfdevfreq); status->current_frequency = clk_get_rate(pfdev->clock); - status->total_time = ktime_to_ns(ktime_add(pfdev->devfreq.busy_time, - pfdev->devfreq.idle_time)); + status->total_time = ktime_to_ns(ktime_add(pfdevfreq->busy_time, + pfdevfreq->idle_time)); - status->busy_time = ktime_to_ns(pfdev->devfreq.busy_time); + status->busy_time = ktime_to_ns(pfdevfreq->busy_time); - panfrost_devfreq_reset(pfdev); + panfrost_devfreq_reset(pfdevfreq); - dev_dbg(pfdev->dev, "busy %lu total %lu %lu %% freq %lu MHz\n", status->busy_time, - status->total_time, + dev_dbg(pfdev->dev, "busy %lu total %lu %lu %% freq %lu MHz\n", + status->busy_time, status->total_time, status->busy_time / (status->total_time / 100), status->current_frequency / 1000 / 1000); @@ -91,6 +92,7 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) struct device *dev = &pfdev->pdev->dev; struct devfreq *devfreq; struct thermal_cooling_device *cooling; + struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; ret = dev_pm_opp_of_add_table(dev); if (ret == -ENODEV) /* Optional, continue without devfreq */ @@ -98,7 +100,7 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) else if (ret) return ret; - panfrost_devfreq_reset(pfdev); + panfrost_devfreq_reset(pfdevfreq); cur_freq = clk_get_rate(pfdev->clock); @@ -116,53 +118,59 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) dev_pm_opp_of_remove_table(dev); return PTR_ERR(devfreq); } - pfdev->devfreq.devfreq = devfreq; + pfdevfreq->devfreq = devfreq; cooling = of_devfreq_cooling_register(dev->of_node, devfreq); if (IS_ERR(cooling)) DRM_DEV_INFO(dev, "Failed to register cooling device\n"); else - pfdev->devfreq.cooling = cooling; + pfdevfreq->cooling = cooling; return 0; } void panfrost_devfreq_fini(struct panfrost_device *pfdev) { - if (pfdev->devfreq.cooling) - devfreq_cooling_unregister(pfdev->devfreq.cooling); + struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; + + if (pfdevfreq->cooling) + devfreq_cooling_unregister(pfdevfreq->cooling); dev_pm_opp_of_remove_table(&pfdev->pdev->dev); } void panfrost_devfreq_resume(struct panfrost_device *pfdev) { - if (!pfdev->devfreq.devfreq) + struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; + + if (!pfdevfreq->devfreq) return; - panfrost_devfreq_reset(pfdev); + panfrost_devfreq_reset(pfdevfreq); - devfreq_resume_device(pfdev->devfreq.devfreq); + devfreq_resume_device(pfdevfreq->devfreq); } void panfrost_devfreq_suspend(struct panfrost_device *pfdev) { - if (!pfdev->devfreq.devfreq) + struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; + + if (!pfdevfreq->devfreq) return; - devfreq_suspend_device(pfdev->devfreq.devfreq); + devfreq_suspend_device(pfdevfreq->devfreq); } -void panfrost_devfreq_record_busy(struct panfrost_device *pfdev) +void panfrost_devfreq_record_busy(struct panfrost_devfreq *pfdevfreq) { - panfrost_devfreq_update_utilization(pfdev); - atomic_inc(&pfdev->devfreq.busy_count); + panfrost_devfreq_update_utilization(pfdevfreq); + atomic_inc(&pfdevfreq->busy_count); } -void panfrost_devfreq_record_idle(struct panfrost_device *pfdev) +void panfrost_devfreq_record_idle(struct panfrost_devfreq *pfdevfreq) { int count; - panfrost_devfreq_update_utilization(pfdev); - count = atomic_dec_if_positive(&pfdev->devfreq.busy_count); + panfrost_devfreq_update_utilization(pfdevfreq); + count = atomic_dec_if_positive(&pfdevfreq->busy_count); WARN_ON(count < 0); } diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.h b/drivers/gpu/drm/panfrost/panfrost_devfreq.h index 0611beffc8d0..0697f8d5aa34 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.h +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.h @@ -4,13 +4,29 @@ #ifndef __PANFROST_DEVFREQ_H__ #define __PANFROST_DEVFREQ_H__ +#include + +struct devfreq; +struct thermal_cooling_device; + +struct panfrost_device; + +struct panfrost_devfreq { + struct devfreq *devfreq; + struct thermal_cooling_device *cooling; + ktime_t busy_time; + ktime_t idle_time; + ktime_t time_last_update; + atomic_t busy_count; +}; + int panfrost_devfreq_init(struct panfrost_device *pfdev); void panfrost_devfreq_fini(struct panfrost_device *pfdev); void panfrost_devfreq_resume(struct panfrost_device *pfdev); void panfrost_devfreq_suspend(struct panfrost_device *pfdev); -void panfrost_devfreq_record_busy(struct panfrost_device *pfdev); -void panfrost_devfreq_record_idle(struct panfrost_device *pfdev); +void panfrost_devfreq_record_busy(struct panfrost_devfreq *devfreq); +void panfrost_devfreq_record_idle(struct panfrost_devfreq *devfreq); #endif /* __PANFROST_DEVFREQ_H__ */ diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index c30c719a8059..2efa59c9d1c5 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h @@ -13,6 +13,8 @@ #include #include +#include "panfrost_devfreq.h" + struct panfrost_device; struct panfrost_mmu; struct panfrost_job_slot; @@ -107,14 +109,7 @@ struct panfrost_device { struct list_head shrinker_list; struct shrinker shrinker; - struct { - struct devfreq *devfreq; - struct thermal_cooling_device *cooling; - ktime_t busy_time; - ktime_t idle_time; - ktime_t time_last_update; - atomic_t busy_count; - } devfreq; + struct panfrost_devfreq pfdevfreq; }; struct panfrost_mmu { diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index 63e32a9f2749..a67f3eac6a58 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c @@ -155,7 +155,7 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js) } cfg = panfrost_mmu_as_get(pfdev, &job->file_priv->mmu); - panfrost_devfreq_record_busy(pfdev); + panfrost_devfreq_record_busy(&pfdev->pfdevfreq); job_write(pfdev, JS_HEAD_NEXT_LO(js), jc_head & 0xFFFFFFFF); job_write(pfdev, JS_HEAD_NEXT_HI(js), jc_head >> 32); @@ -415,7 +415,7 @@ static void panfrost_job_timedout(struct drm_sched_job *sched_job) } spin_unlock_irqrestore(&pfdev->js->job_lock, flags); - panfrost_devfreq_record_idle(pfdev); + panfrost_devfreq_record_idle(&pfdev->pfdevfreq); panfrost_device_reset(pfdev); for (i = 0; i < NUM_JOB_SLOTS; i++) @@ -478,7 +478,7 @@ static irqreturn_t panfrost_job_irq_handler(int irq, void *data) pfdev->jobs[j] = NULL; panfrost_mmu_as_put(pfdev, &job->file_priv->mmu); - panfrost_devfreq_record_idle(pfdev); + panfrost_devfreq_record_idle(&pfdev->pfdevfreq); dma_fence_signal_locked(job->done_fence); pm_runtime_put_autosuspend(pfdev->dev); From patchwork Sun May 10 16:55:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539789 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF55B15E6 for ; Mon, 11 May 2020 07:18:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DD462080C for ; Mon, 11 May 2020 07:18:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mLvzjf9t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DD462080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E94476E22A; Mon, 11 May 2020 07:17:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id D110889FC3 for ; Sun, 10 May 2020 16:55:48 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id f134so3271198wmf.1 for ; Sun, 10 May 2020 09:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6bippylaynVEVx7ObrNiT6Ic+rvbOlStPyxBgQ4ebR4=; b=mLvzjf9tyqQOA4JT25otf9u7qVKUd1UcbrKeHtJApUClHF7AEI7Btsb3RJ4GVO/2sk ktyl18CUMbEGy9VaD/qGgN2wHFrY34/q7rClkTx7Pa+7/eprkylosBV8BioMtELEhfOv lJ6qv7+IjYVDYaMcOTzrrdGijHMojoZY2hM2BWRDc2Do+dSOwOKL64ro1c/3ZvmXj/Sb D3FmGkt5MAAZPRJuc0nHiTx9DKbiBeqW/D6qdzHy3wsX9Q6fPB0V2kZdf9gurNii+aCF BOutcFU5kmDCshJ92TLZBRTCU5ny3S0nr591ba9a+BBjkBT7co8mCNftzjNhXIFlaP76 gLtg== 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=6bippylaynVEVx7ObrNiT6Ic+rvbOlStPyxBgQ4ebR4=; b=SUF9138j7Qfxt0MdQJ6eGDQ/2UV5rmGvOeCoclc6EGu1Ra7rzCvOCKgjlr+EWABWEl 5yxK5RZoWHzdxzm5umtOt8ZEjdbsU2tbIAirzRauJePRUL/FyfVdgBVj5iqG+9O3HZ0U 0PqOOyRYQ0Yjx76KTONCiFfOChzoOOwtpfLayE2WXpqCq7BpB+0uAv1r6S8WEzxG6V77 cCNmzj6QcsDbpjw2LW/AWEveTviTgfp+y0RPeUDFULDiJ+gOmhaZGBgaKK+JEFgb1Ky+ /fcWo+57sNt+6Spxhh9MEIWyYFcmOKj1Oce3Srel9rP1GF97wdMjGg5u8j0eCTZeKmPN mCLQ== X-Gm-Message-State: AGi0Pub89x+GmrVoYKUVYcTTbXW/fQyBS9rsQfRs0/SSKdfTlH4zcwGH XPxInCqztxri5k9+ISSzmOA= X-Google-Smtp-Source: APiQypK1sVn497y747i37PmqhIarjI1oQjofRU/MP5nQq4b9qjEU+Ptfl9Qu65MLYywulAZddB4xNw== X-Received: by 2002:a05:600c:243:: with SMTP id 3mr22975979wmj.73.1589129747378; Sun, 10 May 2020 09:55:47 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:46 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 05/15] drm/panfrost: use spinlock instead of atomic Date: Sun, 10 May 2020 18:55:28 +0200 Message-Id: <20200510165538.19720-6-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Convert busy_count to a simple int protected by spinlock. Signed-off-by: Clément Péron Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 43 +++++++++++++++------ drivers/gpu/drm/panfrost/panfrost_devfreq.h | 10 ++++- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 962550363391..78753cfb59fb 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -12,16 +12,12 @@ static void panfrost_devfreq_update_utilization(struct panfrost_devfreq *pfdevfreq) { - ktime_t now; - ktime_t last; - - if (!pfdevfreq->devfreq) - return; + ktime_t now, last; now = ktime_get(); last = pfdevfreq->time_last_update; - if (atomic_read(&pfdevfreq->busy_count) > 0) + if (pfdevfreq->busy_count > 0) pfdevfreq->busy_time += ktime_sub(now, last); else pfdevfreq->idle_time += ktime_sub(now, last); @@ -59,10 +55,14 @@ static int panfrost_devfreq_get_dev_status(struct device *dev, { struct panfrost_device *pfdev = dev_get_drvdata(dev); struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; + unsigned long irqflags; + + status->current_frequency = clk_get_rate(pfdev->clock); + + spin_lock_irqsave(&pfdevfreq->lock, irqflags); panfrost_devfreq_update_utilization(pfdevfreq); - status->current_frequency = clk_get_rate(pfdev->clock); status->total_time = ktime_to_ns(ktime_add(pfdevfreq->busy_time, pfdevfreq->idle_time)); @@ -70,6 +70,8 @@ static int panfrost_devfreq_get_dev_status(struct device *dev, panfrost_devfreq_reset(pfdevfreq); + spin_unlock_irqrestore(&pfdevfreq->lock, irqflags); + dev_dbg(pfdev->dev, "busy %lu total %lu %lu %% freq %lu MHz\n", status->busy_time, status->total_time, status->busy_time / (status->total_time / 100), @@ -100,6 +102,8 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) else if (ret) return ret; + spin_lock_init(&pfdevfreq->lock); + panfrost_devfreq_reset(pfdevfreq); cur_freq = clk_get_rate(pfdev->clock); @@ -162,15 +166,32 @@ void panfrost_devfreq_suspend(struct panfrost_device *pfdev) void panfrost_devfreq_record_busy(struct panfrost_devfreq *pfdevfreq) { + unsigned long irqflags; + + if (!pfdevfreq->devfreq) + return; + + spin_lock_irqsave(&pfdevfreq->lock, irqflags); + panfrost_devfreq_update_utilization(pfdevfreq); - atomic_inc(&pfdevfreq->busy_count); + + pfdevfreq->busy_count++; + + spin_unlock_irqrestore(&pfdevfreq->lock, irqflags); } void panfrost_devfreq_record_idle(struct panfrost_devfreq *pfdevfreq) { - int count; + unsigned long irqflags; + + if (!pfdevfreq->devfreq) + return; + + spin_lock_irqsave(&pfdevfreq->lock, irqflags); panfrost_devfreq_update_utilization(pfdevfreq); - count = atomic_dec_if_positive(&pfdevfreq->busy_count); - WARN_ON(count < 0); + + WARN_ON(--pfdevfreq->busy_count < 0); + + spin_unlock_irqrestore(&pfdevfreq->lock, irqflags); } diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.h b/drivers/gpu/drm/panfrost/panfrost_devfreq.h index 0697f8d5aa34..e6629900a618 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.h +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.h @@ -4,6 +4,7 @@ #ifndef __PANFROST_DEVFREQ_H__ #define __PANFROST_DEVFREQ_H__ +#include #include struct devfreq; @@ -14,10 +15,17 @@ struct panfrost_device; struct panfrost_devfreq { struct devfreq *devfreq; struct thermal_cooling_device *cooling; + ktime_t busy_time; ktime_t idle_time; ktime_t time_last_update; - atomic_t busy_count; + int busy_count; + /* + * Protect busy_time, idle_time, time_last_update and busy_count + * because these can be updated concurrently, for example by the GP + * and PP interrupts. + */ + spinlock_t lock; }; int panfrost_devfreq_init(struct panfrost_device *pfdev); From patchwork Sun May 10 16:55:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539813 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0ACDC15E6 for ; Mon, 11 May 2020 07:18:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DCDF9207FF for ; Mon, 11 May 2020 07:18:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uWFCvxF1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCDF9207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D17F6E1F9; Mon, 11 May 2020 07:17:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 049EE89FC3 for ; Sun, 10 May 2020 16:55:50 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id m24so5817590wml.2 for ; Sun, 10 May 2020 09:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OhYrh9YhlYXknPmBF+ROBsUhxioXF1DIWp34Pf3t1c4=; b=uWFCvxF1Ru/RGFcBDvfix2QN6IlvVfJ0XwlpC94V8PK8wf0/7u9FsV9Hx59AqRdgiD Zw5rG2gT0hrmXdzL9Wg8t+sIcXdaqmOM32JJEHmBFvhpSNeixDE0AZjR/ftWAwdxBnuc aIQzdHgHrQndEauKrELV33RiLhbUzIf5x510r+vtym5PmJpiegUFiSa4oAGXxODnLPzZ l2bJ1CVPNeilrCg1fi7i15n3+5YWtXJXjdaJqrRbuiaS52d/M88E6na9EVQbeFODrbtG Bno5L3b+KxhcdlT3+RqwJvqxZUJwg94bkW10lihfmyKjNI2I5QFjGZwTi46B08UiNs8I Nqgw== 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=OhYrh9YhlYXknPmBF+ROBsUhxioXF1DIWp34Pf3t1c4=; b=gaVeVNuclVQA/XIT7ynwozyrjbt+04adMiYO2oB9mx4iTEOxmM8l+zlGpllWzjaPVG n2B0TOHM+hjcUVkeprQovGLRU8rUMEZvoDCoNppEWr//Xio28Rk4OrgabPJD76EsVV+6 eavHSIlzI/HNcSmPIz8KmxC98M6PwxP3kKx5HM2e/jBjS3Q+oYaicfNdwHGzpr1pZdgk NqY616D1iZNnkdn5io/j/RnReTnLZBO/Agn02APyyqclOCbkGsfzdajGH6ua5g0jjtEr CwpMcQ1/VvHhmLhPLvlQF2V0lKjrFii5YJJJ5MXkj+luB/3k0pTYDtooDTUWFPtQoXWf SjPA== X-Gm-Message-State: AGi0Pub5hX31KZU7YJROIJ9sVeQxnNqVNkMArPINO2asBwBa5RdbZZQw hdwaeSLSXCmqn7BsdKEVzos= X-Google-Smtp-Source: APiQypKjmziT9fWp0qUklBNq8R4p9Hwvegfvv4DkG4skFkpovhpchfUnzNa2oCnZERscnArbLvpCnw== X-Received: by 2002:a1c:e903:: with SMTP id q3mr26041414wmc.76.1589129748553; Sun, 10 May 2020 09:55:48 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:47 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 06/15] drm/panfrost: properly handle error in probe Date: Sun, 10 May 2020 18:55:29 +0200 Message-Id: <20200510165538.19720-7-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Introduce a boolean to know if opp table has been added. With this, we can call panfrost_devfreq_fini() in case of error and release what has been initialised. Signed-off-by: Clément Péron Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 25 ++++++++++++++++----- drivers/gpu/drm/panfrost/panfrost_devfreq.h | 1 + 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 78753cfb59fb..d9007f44b772 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -101,6 +101,7 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) return 0; else if (ret) return ret; + pfdevfreq->opp_of_table_added = true; spin_lock_init(&pfdevfreq->lock); @@ -109,8 +110,10 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) cur_freq = clk_get_rate(pfdev->clock); opp = devfreq_recommended_opp(dev, &cur_freq, 0); - if (IS_ERR(opp)) - return PTR_ERR(opp); + if (IS_ERR(opp)) { + ret = PTR_ERR(opp); + goto err_fini; + } panfrost_devfreq_profile.initial_freq = cur_freq; dev_pm_opp_put(opp); @@ -119,8 +122,8 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL); if (IS_ERR(devfreq)) { DRM_DEV_ERROR(dev, "Couldn't initialize GPU devfreq\n"); - dev_pm_opp_of_remove_table(dev); - return PTR_ERR(devfreq); + ret = PTR_ERR(devfreq); + goto err_fini; } pfdevfreq->devfreq = devfreq; @@ -131,15 +134,25 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) pfdevfreq->cooling = cooling; return 0; + +err_fini: + panfrost_devfreq_fini(pfdev); + return ret; } void panfrost_devfreq_fini(struct panfrost_device *pfdev) { struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; - if (pfdevfreq->cooling) + if (pfdevfreq->cooling) { devfreq_cooling_unregister(pfdevfreq->cooling); - dev_pm_opp_of_remove_table(&pfdev->pdev->dev); + pfdevfreq->cooling = NULL; + } + + if (pfdevfreq->opp_of_table_added) { + dev_pm_opp_of_remove_table(&pfdev->pdev->dev); + pfdevfreq->opp_of_table_added = false; + } } void panfrost_devfreq_resume(struct panfrost_device *pfdev) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.h b/drivers/gpu/drm/panfrost/panfrost_devfreq.h index e6629900a618..add203cb00c2 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.h +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.h @@ -15,6 +15,7 @@ struct panfrost_device; struct panfrost_devfreq { struct devfreq *devfreq; struct thermal_cooling_device *cooling; + bool opp_of_table_added; ktime_t busy_time; ktime_t idle_time; From patchwork Sun May 10 16:55:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539773 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA8E915E6 for ; Mon, 11 May 2020 07:17:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 892D52080C for ; Mon, 11 May 2020 07:17:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uiAh446Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 892D52080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E86C46E1F8; Mon, 11 May 2020 07:17:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 108E289FC8 for ; Sun, 10 May 2020 16:55:51 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id l18so7932686wrn.6 for ; Sun, 10 May 2020 09:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hYaO3vIFzjPS+OfApN0NYSAANmGhGDH0gcx3AO0sLnU=; b=uiAh446YfKtgnRC1fQcABQkMfbqSQvqvqmPuS8O26UEmq/dcUXoHl3BYwBQ1bqoeDk lzpm+0QFhTRLE5YzGMKlaQBoEXO2Xqo/Lm9lWaN7ZoL2k1x97RG65AvnDp7PuK1e1Waj jq2osBsVEmu6irLO0dkRnNqkhV/4mHhZr/aEupDm9Wvh6Npc9eluv3hSWCfmukrX66m2 a8Ji6vS1BCHQmz4h8NqcXjbrCwFFZmLV3TVPifVI54WSgy5j1RJsQ6cUO8RNN88WPS1R pqlm8rAmkuLvdL5CLpQaR++IHipHx360nAQqQdwnV9HT8rbSs0JX7kLhsYv3U3Og/S+C gjjA== 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=hYaO3vIFzjPS+OfApN0NYSAANmGhGDH0gcx3AO0sLnU=; b=dWSwMOKHZ0vWHOQoFykgE52uiOSaHrpVD0hhC76OHBfZCK0iALaTAcC1wmTGwOugmi kOWzYeV0FzgoOrswAJW01cbqj3Hq0pCnFrO4j3vcpNDw/4plrHj2G8dZOy4V6j7oXN08 ykn//WCIf/ywNygUsNOMGmLYmK7qzg7brpjoyiraWWsuBfFBb4koK0O78SDvxNC5SmJJ W9N2s8g30QoxwWXjpRTxdQd4yK7wvFcV3hQj7h4FTEa8FpgDpTN79sVIlj9aU32t5QzN 2xzOJuSZ8PRqR//u0dgnYmHm23cLafC15HyJoPAm56g+nmS2JV9Ympiq2fVe0zjz8mG1 tuqg== X-Gm-Message-State: AGi0PuYHpB468BNG75udpHVKqfPiLObPvFw3SqnVgOkXuNCnhzYFDJxN WUcdgZSJZ+YAmMC8B2JVm0g= X-Google-Smtp-Source: APiQypIW4OiL8jyn7DImLpe0ow+y3YcsSLrPBYX2kzMMClad8smYzUnb3uZIPJ1/AW7spP8aYpKVLQ== X-Received: by 2002:a05:6000:12c2:: with SMTP id l2mr2556186wrx.133.1589129749565; Sun, 10 May 2020 09:55:49 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:48 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 07/15] drm/panfrost: use device_property_present to check for OPP Date: Sun, 10 May 2020 18:55:30 +0200 Message-Id: <20200510165538.19720-8-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of expecting an error from dev_pm_opp_of_add_table() do a simple device_property_present() check. Signed-off-by: Clément Péron --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index d9007f44b772..fce21c682414 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -96,15 +96,19 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) struct thermal_cooling_device *cooling; struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; - ret = dev_pm_opp_of_add_table(dev); - if (ret == -ENODEV) /* Optional, continue without devfreq */ + if (!device_property_present(dev, "operating-points-v2")) + /* Optional, continue without devfreq */ return 0; - else if (ret) - return ret; - pfdevfreq->opp_of_table_added = true; spin_lock_init(&pfdevfreq->lock); + ret = dev_pm_opp_of_add_table(dev); + if (ret) { + DRM_DEV_ERROR(dev, "Couldn't add OPP table\n"); + goto err_fini; + } + pfdevfreq->opp_of_table_added = true; + panfrost_devfreq_reset(pfdevfreq); cur_freq = clk_get_rate(pfdev->clock); From patchwork Sun May 10 16:55:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539787 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5EEA2912 for ; Mon, 11 May 2020 07:17:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D3962080C for ; Mon, 11 May 2020 07:17:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fyrpJtPg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D3962080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 810AC6E21E; Mon, 11 May 2020 07:17:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1420889FC9 for ; Sun, 10 May 2020 16:55:52 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id s8so7936723wrt.9 for ; Sun, 10 May 2020 09:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MuMQv3TQjzWt0xJoCSiQfhuulnnGfideK7v9jTFs0HY=; b=fyrpJtPgFlcuvkPOW5j1/lp3g5iSo+9OUeH0bx+WR5wQrt065deyEwRAZAIiP4QDHh l05jlqveetvPYT3qYFdt1AFfz1c0c248txugCWMoglvRmKOoOwxa1kVUVBq2/kbLrgd7 LqAsaszQO0AUmkCBS05LFzSY7OgZY4kwklq4SlR9FzZiIu32Pc6DKSzq2M+oJa4cFclQ Yo02ZOomugp+YuW/rL+dKJR2/f7/6hoSJnH24YIqrt/xv1d0/7JJjQredljULXeczIVn DbSfHXahnDECsQERLAMw73eQuNo1dPEB11NFgjqm9V+Azayp5UEyBPD8fI03fqhpwXqS 9suA== 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=MuMQv3TQjzWt0xJoCSiQfhuulnnGfideK7v9jTFs0HY=; b=BDuwiKnhQnqa4jq/OL1lsuoPEJZx1pMv8JzBp5hYYG3ZilL9zzqUUb+0w1rPpK6mDI IGTaY19nICi7XuLanFi2MXsp+X39CWFcMvy40ApenoZvR2ViV8EVEYY7lMEd8g9btxby Vsyl3aExvo/JEBUA/TZmJTdQLSjzJJ20MTWnHYpcsynkhP6quxT2UZrUeKRt/2npL9Ey YRo+LUmLQ3zYw+pMUs9zw6V4HmZUy++oftGUVaImX2wp9AtSj3magZbqUwnYsmIF3+Hw BHXguuCM/i98YRRLI7ODO786m3PgleaSxTbBVYy34x7f4nuAw8I3GABXUWUZjvdEyoim K1GA== X-Gm-Message-State: AGi0PuZDiybfyQ4G1QdzXwyyBtN7c9+GBKzAkAGdc1PtFicEWBi3wQpF kduwzeVE7pRHC37UhdoMmHk= X-Google-Smtp-Source: APiQypJodrcduJhPQ3zVroQSWDBWm48ib5AjP1g8GZC5uLIlDPvSPS+1i5tb3xOxIgjp+i1tXZwetQ== X-Received: by 2002:adf:8403:: with SMTP id 3mr13603230wrf.186.1589129750653; Sun, 10 May 2020 09:55:50 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:49 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 08/15] drm/panfrost: move devfreq_init()/fini() in device Date: Sun, 10 May 2020 18:55:31 +0200 Message-Id: <20200510165538.19720-9-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Later we will introduce devfreq probing regulator if they are present. As regulator should be probe only one time we need to get this logic in the device_init(). panfrost_device is already taking care of devfreq_resume() and devfreq_suspend(), so it's not totally illogic to move the devfreq_init() and devfreq_fini() here. Signed-off-by: Clément Péron --- drivers/gpu/drm/panfrost/panfrost_device.c | 37 ++++++++++++++-------- drivers/gpu/drm/panfrost/panfrost_drv.c | 15 ++------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c index 8136babd3ba9..f480127205d6 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.c +++ b/drivers/gpu/drm/panfrost/panfrost_device.c @@ -212,59 +212,67 @@ int panfrost_device_init(struct panfrost_device *pfdev) return err; } + err = panfrost_devfreq_init(pfdev); + if (err) { + dev_err(pfdev->dev, "devfreq init failed %d\n", err); + goto err_out0; + } + err = panfrost_regulator_init(pfdev); if (err) { dev_err(pfdev->dev, "regulator init failed %d\n", err); - goto err_out0; + goto err_out1; } err = panfrost_reset_init(pfdev); if (err) { dev_err(pfdev->dev, "reset init failed %d\n", err); - goto err_out1; + goto err_out2; } err = panfrost_pm_domain_init(pfdev); if (err) - goto err_out2; + goto err_out3; res = platform_get_resource(pfdev->pdev, IORESOURCE_MEM, 0); pfdev->iomem = devm_ioremap_resource(pfdev->dev, res); if (IS_ERR(pfdev->iomem)) { dev_err(pfdev->dev, "failed to ioremap iomem\n"); err = PTR_ERR(pfdev->iomem); - goto err_out3; + goto err_out4; } err = panfrost_gpu_init(pfdev); if (err) - goto err_out3; + goto err_out4; err = panfrost_mmu_init(pfdev); if (err) - goto err_out4; + goto err_out5; err = panfrost_job_init(pfdev); if (err) - goto err_out5; + goto err_out6; err = panfrost_perfcnt_init(pfdev); if (err) - goto err_out6; + goto err_out7; return 0; -err_out6: +err_out7: panfrost_job_fini(pfdev); -err_out5: +err_out6: panfrost_mmu_fini(pfdev); -err_out4: +err_out5: panfrost_gpu_fini(pfdev); -err_out3: +err_out4: panfrost_pm_domain_fini(pfdev); -err_out2: +err_out3: panfrost_reset_fini(pfdev); -err_out1: +err_out2: panfrost_regulator_fini(pfdev); +err_out1: + panfrost_devfreq_fini(pfdev); err_out0: panfrost_clk_fini(pfdev); return err; @@ -278,6 +286,7 @@ void panfrost_device_fini(struct panfrost_device *pfdev) panfrost_gpu_fini(pfdev); panfrost_pm_domain_fini(pfdev); panfrost_reset_fini(pfdev); + panfrost_devfreq_fini(pfdev); panfrost_regulator_fini(pfdev); panfrost_clk_fini(pfdev); } diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 882fecc33fdb..4dda68689015 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -14,7 +14,6 @@ #include #include "panfrost_device.h" -#include "panfrost_devfreq.h" #include "panfrost_gem.h" #include "panfrost_mmu.h" #include "panfrost_job.h" @@ -606,13 +605,6 @@ static int panfrost_probe(struct platform_device *pdev) goto err_out0; } - err = panfrost_devfreq_init(pfdev); - if (err) { - if (err != -EPROBE_DEFER) - dev_err(&pdev->dev, "Fatal error during devfreq init\n"); - goto err_out1; - } - pm_runtime_set_active(pfdev->dev); pm_runtime_mark_last_busy(pfdev->dev); pm_runtime_enable(pfdev->dev); @@ -625,16 +617,14 @@ static int panfrost_probe(struct platform_device *pdev) */ err = drm_dev_register(ddev, 0); if (err < 0) - goto err_out2; + goto err_out1; panfrost_gem_shrinker_init(ddev); return 0; -err_out2: - pm_runtime_disable(pfdev->dev); - panfrost_devfreq_fini(pfdev); err_out1: + pm_runtime_disable(pfdev->dev); panfrost_device_fini(pfdev); err_out0: drm_dev_put(ddev); @@ -650,7 +640,6 @@ static int panfrost_remove(struct platform_device *pdev) panfrost_gem_shrinker_cleanup(ddev); pm_runtime_get_sync(pfdev->dev); - panfrost_devfreq_fini(pfdev); panfrost_device_fini(pfdev); pm_runtime_put_sync_suspend(pfdev->dev); pm_runtime_disable(pfdev->dev); From patchwork Sun May 10 16:55:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539775 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B391815E6 for ; Mon, 11 May 2020 07:17:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91C932080C for ; Mon, 11 May 2020 07:17:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iGe+4boF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91C932080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F8236E207; Mon, 11 May 2020 07:17:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 29DD289FCC for ; Sun, 10 May 2020 16:55:53 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id x17so7960431wrt.5 for ; Sun, 10 May 2020 09:55:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J2NZIexCjyou0gnqYIxLphqp5NvK6vqVAKw4e0qfsGY=; b=iGe+4boFyoyEwgcr1y1fulRfHhw6r8Ulz+Va19XbTLSKAXEQJY/VLrxeMxnXkekHgB pcFdEzlQC5SWySsC5piU84siiG2iBeGEz7zQQCszq4bE6p/+hn42Is2oNoJ5JrOwf1pu Xj0eYH2DDv6JABQd00ejfmGxJBCCXkB+3mchmx6J4YnWtWt6cm/d7Lhyi5DH3Yn3foHl cpKUvarDGiHQYzCTDFLFkPf4Ab0zVJjpjnjcnoysLFWLjcg8+LgJ+6zxNti88Mh65j0A QFCFeR9nL1AWmNiFjGdm6TJJ/pZQi0kdqkDWNbMaiytGy2G2yxo4MIrU/wrS6fbua3po B8Lw== 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=J2NZIexCjyou0gnqYIxLphqp5NvK6vqVAKw4e0qfsGY=; b=haFJVgY017DQpxlA0KfyDSfrQt5YlG0gKdYuts9DWFo9bXS1QHnXPYKyyBJ7aM2JHH J8hQaFn5V8C1ctVMN2uDOKg3ssnAlLNJNpHx9YQQXpZHDwFYVYkr2rHlFlA5gpCZuBDC zIIiJs8SGHXsUyA1jEebKKqqazhsPUzvDU+4mQeRLzt6gHUHLZUaV1iHuR6SjdDp0kGh 1YlTeF2X7ZHYvi7zCJneXKSShqzhNExqNSiWR2efIW2nfdo0hRbnwvgjL66OpYEka5kE dk4g5iK+i+LafQFKzsD8XUJ0Yq/cLCEY0ESWzNN5uaFwH1G8pGihhSs7+h6CcU8IABh3 BrbA== X-Gm-Message-State: AGi0PubejiZDnTiDo5zHnQMvGev6VrUj/B0QrOnM6XvHAbknKgEOd/eG bXVK4eLYZ3hngpJL+aWqpcU= X-Google-Smtp-Source: APiQypKuHzFrSqsTFi5saBMKe2/BUEXB5RxULRmhIUQ8PWuoFXrEHmx2Phfsf7zofiPwkCYLAdGceA== X-Received: by 2002:a5d:68cb:: with SMTP id p11mr13857358wrw.349.1589129751769; Sun, 10 May 2020 09:55:51 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:51 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 09/15] drm/panfrost: dynamically alloc regulators Date: Sun, 10 May 2020 18:55:32 +0200 Message-Id: <20200510165538.19720-10-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We will later introduce regulators managed by OPP. Only alloc regulators when it's needed. This also help use to release the regulators only when they are allocated. Signed-off-by: Clément Péron Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_device.c | 14 +++++++++----- drivers/gpu/drm/panfrost/panfrost_device.h | 3 +-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c index f480127205d6..67eedf64e82d 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.c +++ b/drivers/gpu/drm/panfrost/panfrost_device.c @@ -90,9 +90,11 @@ static int panfrost_regulator_init(struct panfrost_device *pfdev) { int ret, i; - if (WARN(pfdev->comp->num_supplies > ARRAY_SIZE(pfdev->regulators), - "Too many supplies in compatible structure.\n")) - return -EINVAL; + pfdev->regulators = devm_kcalloc(pfdev->dev, pfdev->comp->num_supplies, + sizeof(*pfdev->regulators), + GFP_KERNEL); + if (!pfdev->regulators) + return -ENOMEM; for (i = 0; i < pfdev->comp->num_supplies; i++) pfdev->regulators[i].supply = pfdev->comp->supply_names[i]; @@ -117,8 +119,10 @@ static int panfrost_regulator_init(struct panfrost_device *pfdev) static void panfrost_regulator_fini(struct panfrost_device *pfdev) { - regulator_bulk_disable(pfdev->comp->num_supplies, - pfdev->regulators); + if (!pfdev->regulators) + return; + + regulator_bulk_disable(pfdev->comp->num_supplies, pfdev->regulators); } static void panfrost_pm_domain_fini(struct panfrost_device *pfdev) diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index 2efa59c9d1c5..953f7536a773 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h @@ -22,7 +22,6 @@ struct panfrost_job; struct panfrost_perfcnt; #define NUM_JOB_SLOTS 3 -#define MAX_REGULATORS 2 #define MAX_PM_DOMAINS 3 struct panfrost_features { @@ -81,7 +80,7 @@ struct panfrost_device { void __iomem *iomem; struct clk *clock; struct clk *bus_clock; - struct regulator_bulk_data regulators[MAX_REGULATORS]; + struct regulator_bulk_data *regulators; struct reset_control *rstc; /* pm_domains for devices with more than one. */ struct device *pm_domain_devs[MAX_PM_DOMAINS]; From patchwork Sun May 10 16:55:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539819 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C77C5912 for ; Mon, 11 May 2020 07:18:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A5988207FF for ; Mon, 11 May 2020 07:18:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Wwq94eZf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5988207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC84C6E22E; Mon, 11 May 2020 07:17:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2DDDA89FCC for ; Sun, 10 May 2020 16:55:54 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id l11so2040568wru.0 for ; Sun, 10 May 2020 09:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UBcArp9z+dOkkmJwdzsA1OSuQPmhGv0QOxoFlPBuJwQ=; b=Wwq94eZf1awZPhOOpjkFV8onGcsTP4j6JSoLaP1hv/NsRtIKa3v2QYtSzINIdVMh9F 9gj5aW/rjEbnu43zvkMt5q0Mi3qX3UYW/KTPlRdVCuAMXoJWervwJp2DQza7Vrl8mGd/ yGgPBiUtYNpHlRsyfgBLkOBi3yTsXsxDj+rECDUwN1aLqQbY+yiyQsu4FR8tauyMS+O6 P/AEJuLJSWL8WD+wjnBkYhT1IyqpHwIFnDOReKeuw8XRW2RCLvPp7NF7YZYGniIoBH6q KyX4poSnD139MRUGIyGlGwn/AZ3xO+vsghXfTPKnL0tOL/BBksP8ee0sxeW/RNec/rpj 95bQ== 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=UBcArp9z+dOkkmJwdzsA1OSuQPmhGv0QOxoFlPBuJwQ=; b=qUU1Bcr0dNzvg98XNIGb8bvmcDf2snsSoetNjFExX8I+z/Ivap5R0hBtFE2A4ymiVr mM7f+1g9y+xk4kkv1kPZ+j5zUgnQlPYtXP5fwmq93rmA33gVgHkKbYu/5jHQu0ly+wf5 R6OFYt847iEPHroivJhwX1PcJj45IZYvU9swEUPjI5VaLZemiAaRdMk6Fit+JZBneNcK 8sdcyAuJHn40YyLP99rw9g5ZRWO1VYOu+EUZSQt6a51WPwgB7n7UKcK44yVy7bg8B1wt Du7Aiv5vmE7O81SoZ61E+EQtKVDMi2cKeUPfJ0m1HS0j0AyzlY2IEW4zRBJsNOe0TrUM ob0g== X-Gm-Message-State: AGi0PubErSatcgEuvJfHWpm83hqkCTGQvD1aEBT8MYo8gCVjucux0YhZ 7f2KPDucQsL2W0jI0ItJyEI= X-Google-Smtp-Source: APiQypKYWnQjWfAFe8Sh1wPAmn7ij3fKLm9ouithCNi1zPtZuofz2+9xQFanf+kmHfZ+CzFF3krFgQ== X-Received: by 2002:a5d:460d:: with SMTP id t13mr14831054wrq.280.1589129752787; Sun, 10 May 2020 09:55:52 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:52 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 10/15] drm/panfrost: add regulators to devfreq Date: Sun, 10 May 2020 18:55:33 +0200 Message-Id: <20200510165538.19720-11-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:27 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some OPP tables specify voltage for each frequency. Devfreq can handle these regulators but they should be get only 1 time to avoid issue and know who is in charge. If OPP table is probe don't init regulator. Signed-off-by: Clément Péron Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 19 +++++++++++++++++++ drivers/gpu/drm/panfrost/panfrost_devfreq.h | 2 ++ drivers/gpu/drm/panfrost/panfrost_device.c | 11 +++++++---- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index fce21c682414..9ffea0d4a087 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -93,6 +93,7 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) unsigned long cur_freq; struct device *dev = &pfdev->pdev->dev; struct devfreq *devfreq; + struct opp_table *opp_table; struct thermal_cooling_device *cooling; struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; @@ -102,6 +103,19 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) spin_lock_init(&pfdevfreq->lock); + opp_table = dev_pm_opp_set_regulators(dev, pfdev->comp->supply_names, + pfdev->comp->num_supplies); + if (IS_ERR(opp_table)) { + ret = PTR_ERR(opp_table); + /* Continue if the optional regulator is missing */ + if (ret != -ENODEV) { + DRM_DEV_ERROR(dev, "Couldn't set OPP regulators\n"); + goto err_fini; + } + } else { + pfdevfreq->regulators_opp_table = opp_table; + } + ret = dev_pm_opp_of_add_table(dev); if (ret) { DRM_DEV_ERROR(dev, "Couldn't add OPP table\n"); @@ -157,6 +171,11 @@ void panfrost_devfreq_fini(struct panfrost_device *pfdev) dev_pm_opp_of_remove_table(&pfdev->pdev->dev); pfdevfreq->opp_of_table_added = false; } + + if (pfdevfreq->regulators_opp_table) { + dev_pm_opp_put_regulators(pfdevfreq->regulators_opp_table); + pfdevfreq->regulators_opp_table = NULL; + } } void panfrost_devfreq_resume(struct panfrost_device *pfdev) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.h b/drivers/gpu/drm/panfrost/panfrost_devfreq.h index add203cb00c2..347cde4786cf 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.h +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.h @@ -8,12 +8,14 @@ #include struct devfreq; +struct opp_table; struct thermal_cooling_device; struct panfrost_device; struct panfrost_devfreq { struct devfreq *devfreq; + struct opp_table *regulators_opp_table; struct thermal_cooling_device *cooling; bool opp_of_table_added; diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c index 67eedf64e82d..8b17fb2e3369 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.c +++ b/drivers/gpu/drm/panfrost/panfrost_device.c @@ -222,10 +222,13 @@ int panfrost_device_init(struct panfrost_device *pfdev) goto err_out0; } - err = panfrost_regulator_init(pfdev); - if (err) { - dev_err(pfdev->dev, "regulator init failed %d\n", err); - goto err_out1; + /* OPP will handle regulators */ + if (!pfdev->pfdevfreq.opp_of_table_added) { + err = panfrost_regulator_init(pfdev); + if (err) { + dev_err(pfdev->dev, "regulator init failed %d\n", err); + goto err_out1; + } } err = panfrost_reset_init(pfdev); From patchwork Sun May 10 16:55:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75B9D15E6 for ; Mon, 11 May 2020 07:18:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 54328207FF for ; Mon, 11 May 2020 07:18:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="moB/WcAp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54328207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E02A6E23B; Mon, 11 May 2020 07:17:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 421D289FDB for ; Sun, 10 May 2020 16:55:55 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id j5so7964486wrq.2 for ; Sun, 10 May 2020 09:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UGtRSx0M1H2sciVoOm/cuTNsMxGSi9E0CIv7gSphJdg=; b=moB/WcApqXpplDXdnr9T7REGok5c63lnlOe5MLGjckrRBKnIWwEiMeEqNq/Ku2Ixgl a5aUidJAP1BSgquxga6sidNtyZ00U5NR7JLvdS7UoPuhDqQliDguzuxc3BZGJmuVExqE JgSYBt7oDjmW88qF4l+dKQOaswcczrNLYT37B9AU+xFEftA4Rhr1FmCmBPOgfj9fN9wZ WEvROQktO7JyOqpEtW83RPd54M3mn1roeo8boJgOrG0Bik7OTKB0QsWU0Nn9s57rdlqw KeH2TaiHbx1LmzzDyWoyeEy7Bkj66NcNiwwjRg9XUXY3lufrrYj0LV7V3QqXB5ZSOBCL XQuQ== 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=UGtRSx0M1H2sciVoOm/cuTNsMxGSi9E0CIv7gSphJdg=; b=EyzARJ+2bgMIia+QMK+HMWexd1uKiqCb3v9/n56gO0wVbtXyguEjxdtS2F8VZoBFGa jpb3032EyhTYkFT9Z0qQFDvje1SiBPkFSQVziUYNTJiw0rnqYuHPtkJAd5rTCRVO6553 bW6zlNtw7ogpSWjvp/Mkes01YZfylYoY5sPyOetH6Aroky4CMEn4DfKNtABwBpElFaB4 fpYXzSLlBIXlLaTaWcDbK+7gnc4bI6JUf0P2SdRF1Rbpmg81PKYxVZjTQeH2X2+6xdiF j8htezqRxsgSWaEKAEn4nl5Pv0EcqeN8gWM0VDUSoklQiObQIrMmpwfhhV7hPdygNNu2 a5Eg== X-Gm-Message-State: AGi0PuZdO+N0wmYLKua6d3r/Rd7ma/eNlZNe+nKjrNbPOID8AkUrd/DY 3GsCP4sCVolRsIH1o9330jY= X-Google-Smtp-Source: APiQypJb2TSWzqq6njqmcEA/TOqYHZSFpZoZ7VDbi6n/FR3lppFw2NBiQ/cKffersHlcaOfO6TPUTg== X-Received: by 2002:adf:a118:: with SMTP id o24mr13650480wro.330.1589129753836; Sun, 10 May 2020 09:55:53 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:53 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 11/15] drm/panfrost: set devfreq clock name Date: Sun, 10 May 2020 18:55:34 +0200 Message-Id: <20200510165538.19720-12-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:27 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some SoCs have several clocks defined and the OPP core needs to know the exact name of the clk to use. Set the clock name to "core". Signed-off-by: Clément Péron --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 13 +++++++++++++ drivers/gpu/drm/panfrost/panfrost_devfreq.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 9ffea0d4a087..6bf3541b4d53 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -103,6 +103,14 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) spin_lock_init(&pfdevfreq->lock); + opp_table = dev_pm_opp_set_clkname(dev, "core"); + if (IS_ERR(opp_table)) { + ret = PTR_ERR(opp_table); + goto err_fini; + } + + pfdevfreq->clkname_opp_table = opp_table; + opp_table = dev_pm_opp_set_regulators(dev, pfdev->comp->supply_names, pfdev->comp->num_supplies); if (IS_ERR(opp_table)) { @@ -176,6 +184,11 @@ void panfrost_devfreq_fini(struct panfrost_device *pfdev) dev_pm_opp_put_regulators(pfdevfreq->regulators_opp_table); pfdevfreq->regulators_opp_table = NULL; } + + if (pfdevfreq->clkname_opp_table) { + dev_pm_opp_put_clkname(pfdevfreq->clkname_opp_table); + pfdevfreq->clkname_opp_table = NULL; + } } void panfrost_devfreq_resume(struct panfrost_device *pfdev) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.h b/drivers/gpu/drm/panfrost/panfrost_devfreq.h index 347cde4786cf..1f2475e1d034 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.h +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.h @@ -16,6 +16,7 @@ struct panfrost_device; struct panfrost_devfreq { struct devfreq *devfreq; struct opp_table *regulators_opp_table; + struct opp_table *clkname_opp_table; struct thermal_cooling_device *cooling; bool opp_of_table_added; From patchwork Sun May 10 16:55:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539807 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B9C78912 for ; Mon, 11 May 2020 07:18:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97B43207FF for ; Mon, 11 May 2020 07:18:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="henRzJnu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97B43207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 53EE76E216; Mon, 11 May 2020 07:17:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 61D6889FDB for ; Sun, 10 May 2020 16:55:56 +0000 (UTC) Received: by mail-wm1-x32f.google.com with SMTP id m24so5817851wml.2 for ; Sun, 10 May 2020 09:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QVJ+1fAj4aJcfIzG7KLUGxoLD4NHFj6b20tXq5SEIa4=; b=henRzJnuYReSCrFO8dT8/0yYkackqR7nMOzx+CWB4oeFTv+AEszy5e9EDWTTCZQRpu uXNji3zyuyRcjh6FpWhtXxFTODH/BlKbRc8ad91BkmERYkTJZXs1TUCg1YV2dQ6h798p o77l3IGx2Fv0gJ36qFihNpy/RYpdw1TT4FDh49jdB4Evh6940qKAV+Bmx97B2kSe7BnI dCFjplGGED5nzeXyp08yRQ2NxSlyPU1UC7Kwi8lu9Bn/mjRrz3tj3jtNxdd+Mo026ucw aeW8Re/ql4XxYQSuHsC6lLidLn8xVp6oKGL1AumKlgVuNfsPyG8aOhDVtXeBGQBqGVQW wJ4Q== 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=QVJ+1fAj4aJcfIzG7KLUGxoLD4NHFj6b20tXq5SEIa4=; b=IUeS8dk2y2XktabZwUweE6cej1fw6sgHlpcE9zhi1zhcRW5e7srHSLEyKYiZdEmgVR 5KXT/v0HEb8Aek4TwJZiaG/h5mj310GR6z9nhmrIcP5otLMhoZszDKu0mIggj90/+2G6 GZmthIX4UsTJhHn9Bfl1qiNE2Xx4E+GVngzCbbgNf+8CZDY1rGjJFfJ0hKsO+5JyhUwV EcK1KY1mWRrU1SZNdJjATh/vQOCCB0jxP6R+fJ+tUO5SO+4T1Lm4a6587DmR7tyv9KTR CAo8VMWz8BFLZDrsGtaBY46ufZMQQVcEwkgM9MhbvDFJ3o78iCWTDL9f0+ZWH1QMmTdO wVAQ== X-Gm-Message-State: AGi0PuYa2wewv1iE8Bnlis6RF0rk+V153vPA//193BKWywnRp3XQbqS5 SY6LHANHCszrArwRG6NK5dY= X-Google-Smtp-Source: APiQypK2evGKLkliWXP4Ao/8KEZGZEAKSrvQQOjhvUGgeRvZRYLGZZbaiAPW9psfNBrE9jGOqSgWnA== X-Received: by 2002:a1c:4304:: with SMTP id q4mr28949907wma.152.1589129754970; Sun, 10 May 2020 09:55:54 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:54 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 12/15] arm64: defconfig: Enable devfreq cooling device Date: Sun, 10 May 2020 18:55:35 +0200 Message-Id: <20200510165538.19720-13-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:27 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Devfreq cooling device framework is used in Panfrost to throttle GPU in order to regulate its temperature. Enable this driver for ARM64 SoC. Signed-off-by: Clément Péron --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 66941024418c..42d85c2c0945 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -496,6 +496,7 @@ CONFIG_SENSORS_INA2XX=m CONFIG_SENSORS_INA3221=m CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y CONFIG_CPU_THERMAL=y +CONFIG_DEVFREQ_THERMAL=y CONFIG_THERMAL_EMULATION=y CONFIG_QORIQ_THERMAL=m CONFIG_SUN8I_THERMAL=y From patchwork Sun May 10 16:55:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539827 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E6DE912 for ; Mon, 11 May 2020 07:18:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4BA31207FF for ; Mon, 11 May 2020 07:18:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hkGNQyc/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BA31207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A1C96E266; Mon, 11 May 2020 07:18:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6F7E389FDB for ; Sun, 10 May 2020 16:55:57 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id x17so7960589wrt.5 for ; Sun, 10 May 2020 09:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=msywohSuGh6swONibcP6F+70WAKAL/uMsF9k7te5F+k=; b=hkGNQyc/x4KmNhR09Y2373rMJ+tldHIgVAtQ5VwfCBsP8haDn+N554iEOj/zvNyHXG 2apeoK0tQG+mCZe97atPSgr5GjCqVes/Vgfs61/9MXW6B0/NaycoQm9quf+iHnLJpxfn EdOP0OBpcI+8rSXiKPOUWE1n30U81mOmraEgodeYJpyKJu38h+3/GKIkcd+Szc6UV9qd NQf0r9ZCLRFpAZHtAhEpxwT/l5YlSSP94UTc2Z/IWWgFz2c4CA1+Z3ZT+t/8dGPIe+ac 33uMRKEFmjB204J9WZxdHkaJp9PZ0z38gHVu99IcR/xD1X804ASAGwRe1OlbaHnF1ljh H3QA== 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=msywohSuGh6swONibcP6F+70WAKAL/uMsF9k7te5F+k=; b=hYZhE3BB2/Q6sP34qIyedoMSuYDyAsUv/NX3ynSfRDAJZtXgcC+/THPIe0g5rtO/r0 Th0UUOdAUJSX5dvY8YgbHIhLrLHhmHAPRKQqTsZ3msP4r2BILMO8BEYgj2iK3ntw5Kpj Q84Aknmvr/IUGC8LOrKsJ0NjgYihDDOk5pE+fq6ly1SSv/5d7CqTF3oJkudma7/bHJOl R2+ixc0Xpja8yFByFHnWwBeEAIusK3E8M9/uysFdFgZ/LjpsER0LQGORJaJSE/ZugGbL 03bX4Dpy3E+2MSGEyyczZbdGWTIzWFqVQ8mCVfGIVB6I61Dfb8NohKY2Ukdmln2RPHYW to2g== X-Gm-Message-State: AGi0PublHjP50NDPMDWVtgoOCgaQjyxjneqzjhffqAPHILki/JjHR2Gy WwVBeEdM9qZeAzJvqwma+wo= X-Google-Smtp-Source: APiQypJQLiGZ3inhyarOnjxz5H8I+2somPxs9/69ewsW1D9UgAjT/OiP3usqGH5auhmMYmhn3EFEJA== X-Received: by 2002:a5d:69c3:: with SMTP id s3mr13817785wrw.305.1589129756050; Sun, 10 May 2020 09:55:56 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:55 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 13/15] arm64: dts: allwinner: h6: Add cooling map for GPU Date: Sun, 10 May 2020 18:55:36 +0200 Message-Id: <20200510165538.19720-14-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:27 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a simple cooling map for the GPU. Signed-off-by: Clément Péron --- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi index 2e31632c6ca8..b26f735201c7 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi @@ -173,6 +173,7 @@ clocks = <&ccu CLK_GPU>, <&ccu CLK_BUS_GPU>; clock-names = "core", "bus"; resets = <&ccu RST_BUS_GPU>; + #cooling-cells = <2>; status = "disabled"; }; @@ -1002,6 +1003,27 @@ polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 1>; + + trips { + gpu_alert: gpu-alert { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + + gpu-crit { + temperature = <100000>; + hysteresis = <0>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&gpu_alert>; + cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; }; }; }; From patchwork Sun May 10 16:55:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539831 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 71567912 for ; Mon, 11 May 2020 07:18:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FDBB206D5 for ; Mon, 11 May 2020 07:18:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CsDrppTO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FDBB206D5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B383F6E23F; Mon, 11 May 2020 07:18:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 67ED389FED for ; Sun, 10 May 2020 16:55:58 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id i15so7924095wrx.10 for ; Sun, 10 May 2020 09:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K/boFoUXaAgzs/9YRn/4qwyX/v1A/ZjToMiKSYzOwF0=; b=CsDrppTOIM1X8NLMAVH0m3CI9obn/4avW1sQrIKdscbA7S1vz0D5jaYiKPtt8AFN2c TPZ/3TRlrdUr+GRjCbCwJCWYOxOzw/IhiVFQp+KP/VPrKJXeOYNPQ+aZuC6zm3Sd65KR rhkc7cs3FBbPQAaAJ+Uq4k95gzdIX+zjTtGitOybYxTQE4qzEOcrr9p016MOfFfWVPFB C+vvtj6cGmwKoo8lxNEEcny94OGwyjQsjSAPjNm7HzL6rm69KqHLZtKOyUYEIBNBiB4i zja+XFUgqvVVDW12fow/JWywZgPXmBqDNL1bX/yR/61o9SwY8fcV03uALOl2ojejgG5C +E5g== 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=K/boFoUXaAgzs/9YRn/4qwyX/v1A/ZjToMiKSYzOwF0=; b=jyOeayxDEn/xpKz5x9p9HzFYts9s8szSRJnaPj50EFGpmxL4BRpDmo4fWIHRZ+fOSx sP+l912yN/ifnoJ47EcIqDc0BT7jTk0W7ffUvNripDkZm8IR5f+/1DBI8FnuHBSuzj11 llTEa3dFjU/FDRKw13idolfss7jwhajOHTSa61nij9sCHLSFtwrC5GrKzFss5pRv9OD7 LbnwXfV8/JaMkzCFN1+M+l8U5o0qxLQd/HEqleVLPn5gq7bsJguTQa14AAPkhoyLPTWr pTS1r4/5/8IRApi7dUJtrZT79du6YesbfnoGdMevcY6/ctBtvA2rW/cceXo0jlTDDx8y IDvA== X-Gm-Message-State: AGi0PuZUIMAL3yAzJlg1JlU0dCoMMn9VIizhLeAY3dm/Q0r0JFrhLQGP Q+AFyATimijRQqGx2tnV+Mw= X-Google-Smtp-Source: APiQypKxxgw1gHTSXE0R2uidSfFJNoUSdztA5pN6FNFmbebfe2j6K8LCVB8QZ+7yVeNP4+OkgKQkcA== X-Received: by 2002:adf:81e4:: with SMTP id 91mr14909020wra.143.1589129756971; Sun, 10 May 2020 09:55:56 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:56 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 14/15] [DO NOT MERGE] arm64: dts: allwinner: h6: Add GPU OPP table Date: Sun, 10 May 2020 18:55:37 +0200 Message-Id: <20200510165538.19720-15-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add an Operating Performance Points table for the GPU to enable Dynamic Voltage & Frequency Scaling on the H6. The voltage range is set with minival voltage set to the target and the maximal voltage set to 1.2V. This allow DVFS framework to work properly on board with fixed regulator. Signed-off-by: Clément Péron --- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 80 ++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi index b26f735201c7..85f43a4b651f 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi @@ -173,6 +173,7 @@ clocks = <&ccu CLK_GPU>, <&ccu CLK_BUS_GPU>; clock-names = "core", "bus"; resets = <&ccu RST_BUS_GPU>; + operating-points-v2 = <&gpu_opp_table>; #cooling-cells = <2>; status = "disabled"; }; @@ -1026,4 +1027,83 @@ }; }; }; + + gpu_opp_table: gpu-opp-table { + compatible = "operating-points-v2"; + + opp@216000000 { + opp-hz = /bits/ 64 <216000000>; + opp-microvolt = <810000 810000 1200000>; + }; + + opp@264000000 { + opp-hz = /bits/ 64 <264000000>; + opp-microvolt = <810000 810000 1200000>; + }; + + opp@312000000 { + opp-hz = /bits/ 64 <312000000>; + opp-microvolt = <810000 810000 1200000>; + }; + + opp@336000000 { + opp-hz = /bits/ 64 <336000000>; + opp-microvolt = <810000 810000 1200000>; + }; + + opp@360000000 { + opp-hz = /bits/ 64 <360000000>; + opp-microvolt = <820000 820000 1200000>; + }; + + opp@384000000 { + opp-hz = /bits/ 64 <384000000>; + opp-microvolt = <830000 830000 1200000>; + }; + + opp@408000000 { + opp-hz = /bits/ 64 <408000000>; + opp-microvolt = <840000 840000 1200000>; + }; + + opp@420000000 { + opp-hz = /bits/ 64 <420000000>; + opp-microvolt = <850000 850000 1200000>; + }; + + opp@432000000 { + opp-hz = /bits/ 64 <432000000>; + opp-microvolt = <860000 860000 1200000>; + }; + + opp@456000000 { + opp-hz = /bits/ 64 <456000000>; + opp-microvolt = <870000 870000 1200000>; + }; + + opp@504000000 { + opp-hz = /bits/ 64 <504000000>; + opp-microvolt = <890000 890000 1200000>; + }; + + opp@540000000 { + opp-hz = /bits/ 64 <540000000>; + opp-microvolt = <910000 910000 1200000>; + }; + + opp@576000000 { + opp-hz = /bits/ 64 <576000000>; + opp-microvolt = <930000 930000 1200000>; + }; + + opp@624000000 { + opp-hz = /bits/ 64 <624000000>; + opp-microvolt = <950000 950000 1200000>; + }; + + opp@756000000 { + opp-hz = /bits/ 64 <756000000>; + opp-microvolt = <1040000 1040000 1200000>; + }; + }; }; From patchwork Sun May 10 16:55:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539811 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE5EE15E6 for ; Mon, 11 May 2020 07:18:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACB37207FF for ; Mon, 11 May 2020 07:18:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NVaFtRRU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACB37207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5901F6E20D; Mon, 11 May 2020 07:17:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 59BED89FED for ; Sun, 10 May 2020 16:55:59 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id e16so7949994wra.7 for ; Sun, 10 May 2020 09:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LrpA01gh5f+4wCQVfiK/c2w8CUJsi/9aedeoRmkPm1A=; b=NVaFtRRUuIuJfOZ9VWEnsEcaHQLlxP0KjmHTYVaEol0TnaJzw14uuF0Ej7tBkZ/dXf q0cdIPbQ2ReTKQaZIx08FJyyfpQc46H2PP4lMAzaqienz9TjB71dMtXN47KrqWcqxFbO o1GK6lICcOVrfd0JUYo7eFmGGoXkfVH4g5DyGe4DFL2x74lhjkHAhAKErSB3hDhAXgYX bk95+Er61/m+x/X2LdsArOEZHganSOruTT+9efLroE+3vQu55tRQknbws3XuQKzD6QoT IhjlB0qHt90lQUSKTqPGVmIAJ1qjyAp27DajDztvQ0ZQsoWHXMxcgrFUIIdhtqbkj+dD UM+w== 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=LrpA01gh5f+4wCQVfiK/c2w8CUJsi/9aedeoRmkPm1A=; b=NhSUIk6+tmiM+opXSJ3MYv5iJAJ8PajsYPd5caIz7DfI9zUV7kVxax0hQ6oc3C8fUN Pfz9tcVyzjLs8SjmfZe2y0b6HGGkBdf9xpkwZcSpOftZddX9d29CrAYSij9YqgZmIvp2 181yKYwvY/EYrAbs/EnMIfai95BLZIEqjAhBcPIcIXhJ3Rdaj3ypVVnxxh4axBz/O4YP i0j1fK2B2/PWhsfB964yL8zFIrBI1A7T4U+ggfN8Yikk40Fxk/eIdvvKUBvyGfVNDYcf UzJVnoQFx2vL93VVfdV82JH2NhUhnKg5cV1jYDjsXENocUjlSnJahrdIHQc17RDBYsN3 LWpw== X-Gm-Message-State: AGi0PuZpQoMW29/J3XgOmPXO5HxqqJMD8otg7T/hTqVzqBB6zrUK1esB Mw3hp/nv7qX4x6E8Um+EiGE= X-Google-Smtp-Source: APiQypKucmou8UiKBQJLi/Cx8j6Ix30yatDbTUUMPyd8Dq8FziM9EgDPuGCXjSGiQ84ZMUcD+phxZA== X-Received: by 2002:a5d:46c7:: with SMTP id g7mr14131363wrs.293.1589129757999; Sun, 10 May 2020 09:55:57 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:57 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 15/15] [DO NOT MERGE] arm64: dts: allwinner: force GPU regulator to be always Date: Sun, 10 May 2020 18:55:38 +0200 Message-Id: <20200510165538.19720-16-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:27 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Signed-off-by: Clément Péron --- arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts index 3f7ceeb1a767..14257f7476b8 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts @@ -245,6 +245,7 @@ }; reg_dcdcc: dcdcc { + regulator-always-on; regulator-enable-ramp-delay = <32000>; regulator-min-microvolt = <810000>; regulator-max-microvolt = <1080000>;