From patchwork Thu Nov 2 14:26:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 160894 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp393306vqu; Thu, 2 Nov 2023 07:27:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFhMDETmS2ukSKp9WAd8pdPDT8LhANxitvmKkvFwCN4sOYbDCELzIGrPh8Mt/zE/+w4G3vZ X-Received: by 2002:a05:6a00:2919:b0:6c2:cb4a:73c3 with SMTP id cg25-20020a056a00291900b006c2cb4a73c3mr7203046pfb.11.1698935228152; Thu, 02 Nov 2023 07:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698935228; cv=none; d=google.com; s=arc-20160816; b=xXW3Z1qi4ga7hdIIwHtIfxMGh0fxyKBKzbz01aTc4SKAf8/TkeubgeK4KwHv/Ih0GQ VYTa3vNRbkxIXQIXKACks6yFQCI1Fnf18o45QfCw0dwDdmEMHTiwFZJyDT06CMZ0yMHe o+7xyudVS6SvauXTadstXYk6kORqQhGmIL9IBcZ489Jx8sRV1qI8FVm/GEe+A60Z7idi A8FMJo0xKeqRHquphoNuYjVeMcvzDH92AC7/+sJlKKYsuaRnwX/90+s/bBlGXOnC/VJZ xnG8m+t1vHY5uvfMH08Z7KsKFx162/HVM7WfKYN7szxGcuJOi7ZVLykeixI7IhHr0uOw cHlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Naar1Xiv36HaMm0z0Y8HklF2PbnU3hK7mSzot3mWfKg=; fh=tAWvjMAEmVD3R8FzmIRYzQIb+yW9J+gWZJ2R8deHkVw=; b=IYZPxLVhegYg/W01FlFlFIGuGJUA2l4w1wHhw6JPKJj+EtBxBZmkcUloQrgDBjBXJI /BqILe8W8IjpOpRdUYw+turWq7ECR+LLFRZpLi1W0+hkUwvNBNh+8IzSqjRWeB7ReyF5 9g5Qzo31Ki4NFIJCy0PffMfOpQjtULrZpdb2E0Oq4hAJ4CAOBUkLVhRSIxfYJCWyMxHP zjT67B4RUh/AQipXW3IYOsrnmBccMngW/QYcaoBzPse2oEv9DmtTOnucedupCNdZ6Uk6 0+MrnK3SugXGp5LCxA5VvpACCG1+QCjp1mbZcSDu0kGNcwUi95mPL3YTb0I/4/MacAML nttg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MDdZALRE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id z9-20020aa79489000000b006be062ed5c6si3407277pfk.276.2023.11.02.07.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 07:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MDdZALRE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9F1F6822D101; Thu, 2 Nov 2023 07:27:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376811AbjKBO1C (ORCPT + 36 others); Thu, 2 Nov 2023 10:27:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235289AbjKBO1A (ORCPT ); Thu, 2 Nov 2023 10:27:00 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06039194 for ; Thu, 2 Nov 2023 07:26:53 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 84BF26607090; Thu, 2 Nov 2023 14:26:51 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698935212; bh=YtQIX3FzdJuXHKbLB+mWiM8MZF5dRqqjsu5pKi6GDpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MDdZALRE8B7hJslAhU/2RIDb5x31cIH0sNSiNrdFukx3ZHZAlOZ9j/x7M/MpV52tw fOqLTV21Dih3ht0oUIjqlSCS3EOCwwZSr3qjBMKGPO1BsO/ilOFuWnXzoCWC1HinC3 bFcuRTy/UUPl5I2aUcAtpYeSbSMBkPoVdkEtZNvAdBBZSR5lpblPAZgtwuOROylx4o nZHioQRwF4i1AfsEngo4ZHKgv7ubTOFE8tMzxEEXCOqsvFpylzAX8ydr7P0Zo36qbZ i7ly919US5lxyLIRt2fElYz3iqoO+c7JbPuKBPPP8GDBvwD+xSnm3DTNpJwDtsYjY/ xwsYs+gU4mbmA== From: AngeloGioacchino Del Regno To: boris.brezillon@collabora.com Cc: robh@kernel.org, steven.price@arm.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, wenst@chromium.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [PATCH v2 1/6] drm/panfrost: Perform hard reset to recover GPU if soft reset fails Date: Thu, 2 Nov 2023 15:26:38 +0100 Message-ID: <20231102142643.75288-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> References: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 07:27:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781462705995886512 X-GMAIL-MSGID: 1781462705995886512 Even though soft reset should ideally never fail, during development of some power management features I managed to get some bits wrong: this resulted in GPU soft reset failures, where the GPU was never able to recover, not even after suspend/resume cycles, meaning that the only way to get functionality back was to reboot the machine. Perform a hard reset after a soft reset failure to be able to recover the GPU during runtime (so, without any machine reboot). Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/panfrost/panfrost_gpu.c | 14 ++++++++++---- drivers/gpu/drm/panfrost/panfrost_regs.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index fad75b6e543e..7e9e2cf26e4d 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -60,14 +60,20 @@ int panfrost_gpu_soft_reset(struct panfrost_device *pfdev) gpu_write(pfdev, GPU_INT_MASK, 0); gpu_write(pfdev, GPU_INT_CLEAR, GPU_IRQ_RESET_COMPLETED); - gpu_write(pfdev, GPU_CMD, GPU_CMD_SOFT_RESET); + gpu_write(pfdev, GPU_CMD, GPU_CMD_SOFT_RESET); ret = readl_relaxed_poll_timeout(pfdev->iomem + GPU_INT_RAWSTAT, val, val & GPU_IRQ_RESET_COMPLETED, 100, 10000); - if (ret) { - dev_err(pfdev->dev, "gpu soft reset timed out\n"); - return ret; + dev_err(pfdev->dev, "gpu soft reset timed out, attempting hard reset\n"); + + gpu_write(pfdev, GPU_CMD, GPU_CMD_HARD_RESET); + ret = readl_relaxed_poll_timeout(pfdev->iomem + GPU_INT_RAWSTAT, + val, val & GPU_IRQ_RESET_COMPLETED, 100, 10000); + if (ret) { + dev_err(pfdev->dev, "gpu hard reset timed out\n"); + return ret; + } } gpu_write(pfdev, GPU_INT_CLEAR, GPU_IRQ_MASK_ALL); diff --git a/drivers/gpu/drm/panfrost/panfrost_regs.h b/drivers/gpu/drm/panfrost/panfrost_regs.h index 55ec807550b3..c25743b05c55 100644 --- a/drivers/gpu/drm/panfrost/panfrost_regs.h +++ b/drivers/gpu/drm/panfrost/panfrost_regs.h @@ -44,6 +44,7 @@ GPU_IRQ_MULTIPLE_FAULT) #define GPU_CMD 0x30 #define GPU_CMD_SOFT_RESET 0x01 +#define GPU_CMD_HARD_RESET 0x02 #define GPU_CMD_PERFCNT_CLEAR 0x03 #define GPU_CMD_PERFCNT_SAMPLE 0x04 #define GPU_CMD_CYCLE_COUNT_START 0x05 From patchwork Thu Nov 2 14:26:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 160895 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp393334vqu; Thu, 2 Nov 2023 07:27:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGBRiVGmRM7Usxr3iJohAnnY6gV8ZdPJNZJJ9d3t8ad1i98aCxRGWhVUEMsnNzgZ49ERzHK X-Received: by 2002:a17:902:c948:b0:1cc:33f1:3f03 with SMTP id i8-20020a170902c94800b001cc33f13f03mr14671575pla.2.1698935230408; Thu, 02 Nov 2023 07:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698935230; cv=none; d=google.com; s=arc-20160816; b=JrNaPn1QVbhBbSUZdCeDzWbdki05ewVSqdr6WsmVaadE0D1W8m2r0ddx23SOUTnJKC DiXByylfGsLqmgxJOPOIbBNfW/C8OrBLZTuckdi5IVEcYcSuXqBtiquehKMA8U4rhIG7 nHVr8vYzS8S6rKIrSWqCrLzrc1DBFWzKmpsK62YXxQ/yOjhkePO3TMM17B9Hpo8We2RY ULVT3YtcWJBtp2vTH3ibC2HPvEH0JJ3npfq6ZpiVJW5G3ARaxd7eLegkh1oNB/IxYn6+ Z1HbMmT/mtczDXO5DsHg8BXV1MHHH5/bd78fEa8pZOBI6F9nxAXVeC8VIO0NXrrc1dvD eB1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nzolsh5D/MbylCge90XKckr5HREXNnwZA+bVkMcy0dA=; fh=tAWvjMAEmVD3R8FzmIRYzQIb+yW9J+gWZJ2R8deHkVw=; b=jNtJ0P8FacSWrcDJJaYQe+VFL9NEEHBF7JqjX4N6g7M2Zwvotkz0cH2IyZxA9Px+V9 KXzEABXHvoTR71xh3bnBtbOBC0UrZGUQCvw1o4OL5EGxXUWmMAOGZsYKQUTjyxuA5Nyc JoL/300bWStk2nD/Ihfz+hWaTVFJBiKLwrdAJzlKKHhkNMmEpRzaG7P/2xwIipWLlZLG nqmhQzqFHK6byfUD5M39MzmfCsEvkA5XthUpl3+swsrWU6glNZn3PUNHExdmzufOYV2+ ASIEhJdcPEzKGXGxdHA8CfXyP+w9TStZA7nwt8Efl/Ts4CeGPeJmrAPTr2r5n6fzwh4C fNRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=id3kNsty; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e7-20020a170902cf4700b001cc259278a5si4913587plg.647.2023.11.02.07.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 07:27:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=id3kNsty; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 83B83822D0BE; Thu, 2 Nov 2023 07:27:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376832AbjKBO1F (ORCPT + 36 others); Thu, 2 Nov 2023 10:27:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235358AbjKBO1A (ORCPT ); Thu, 2 Nov 2023 10:27:00 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E8D91A1 for ; Thu, 2 Nov 2023 07:26:54 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 8CBE7660716E; Thu, 2 Nov 2023 14:26:52 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698935213; bh=0UapFtlwwc/wpDFrrChMTi6BxCWRS7nEWTprLucLiIE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=id3kNstyDYcKb/QUOjDDknsO3GV8HjIOxMLvwtHZiJsGslypvZERsaeqYZnAaZRs3 pioH67/s4u7nsbtZD47fblpN4FDtidk0LsiUb1rw1nmd7+h/9l4h4xm1mdheJ5Cl69 0zytdQF35GRUZ6CoO9zHt4oImwfOY0oaGRaP+ir63yKigufYjNT02hT6w7ZiBzUH9q tEaoetZhjDotYiqm2RHuPgMoq0oM2iDK1O0/RbfJwL50qEEgnI6JML3mZUVZS/1Kmq pjdF3qklYVqLQk1zHtXhoArgyR4FtZPRJNnElXO7AQE06L4PN+4IGeNsPJCsoJBtOW so6Fer0ayHP+A== From: AngeloGioacchino Del Regno To: boris.brezillon@collabora.com Cc: robh@kernel.org, steven.price@arm.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, wenst@chromium.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [PATCH v2 2/6] drm/panfrost: Tighten polling for soft reset and power on Date: Thu, 2 Nov 2023 15:26:39 +0100 Message-ID: <20231102142643.75288-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> References: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 07:27:09 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781462708109574889 X-GMAIL-MSGID: 1781462708109574889 In many cases, soft reset takes more than 1 microsecond, but definitely less than 10; moreover in the poweron flow, tilers, shaders and l2 will become ready (each) in less than 10 microseconds as well. Even in the cases (at least on my platforms, rarely) in which those take more than 10 microseconds, it's very unlikely to see both soft reset and poweron to take more than 70 microseconds. Shorten the polling delay to 10 microseconds to consistently reduce the runtime resume time of the GPU. As an indicative example, measurements taken on a MediaTek MT8195 SoC Average runtime resume time in nanoseconds before this commit: GDM, user selection up/down: 88435ns GDM, Text Entry (typing user/password): 91489ns GNOME Desktop, idling, GKRELLM running: 73200ns After this commit: GDM: user selection up/down: 26690ns GDM: Text Entry (typing user/password): 27917ns GNOME Desktop, idling, GKRELLM running: 25304ns Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_gpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index 7e9e2cf26e4d..e264e8c2252d 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -63,7 +63,7 @@ int panfrost_gpu_soft_reset(struct panfrost_device *pfdev) gpu_write(pfdev, GPU_CMD, GPU_CMD_SOFT_RESET); ret = readl_relaxed_poll_timeout(pfdev->iomem + GPU_INT_RAWSTAT, - val, val & GPU_IRQ_RESET_COMPLETED, 100, 10000); + val, val & GPU_IRQ_RESET_COMPLETED, 10, 10000); if (ret) { dev_err(pfdev->dev, "gpu soft reset timed out, attempting hard reset\n"); @@ -403,7 +403,7 @@ void panfrost_gpu_power_on(struct panfrost_device *pfdev) gpu_write(pfdev, L2_PWRON_LO, pfdev->features.l2_present & core_mask); ret = readl_relaxed_poll_timeout(pfdev->iomem + L2_READY_LO, val, val == (pfdev->features.l2_present & core_mask), - 100, 20000); + 10, 20000); if (ret) dev_err(pfdev->dev, "error powering up gpu L2"); @@ -411,13 +411,13 @@ void panfrost_gpu_power_on(struct panfrost_device *pfdev) pfdev->features.shader_present & core_mask); ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_READY_LO, val, val == (pfdev->features.shader_present & core_mask), - 100, 20000); + 10, 20000); if (ret) dev_err(pfdev->dev, "error powering up gpu shader"); gpu_write(pfdev, TILER_PWRON_LO, pfdev->features.tiler_present); ret = readl_relaxed_poll_timeout(pfdev->iomem + TILER_READY_LO, - val, val == pfdev->features.tiler_present, 100, 1000); + val, val == pfdev->features.tiler_present, 10, 1000); if (ret) dev_err(pfdev->dev, "error powering up gpu tiler"); } From patchwork Thu Nov 2 14:26:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 160896 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp393376vqu; Thu, 2 Nov 2023 07:27:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKuMnuMs3rYrb+MXE+JSvyJjcNvH7bS0GdE5M+63H80YVHCNHNw0kEmehMVqxjJhlV9eN5 X-Received: by 2002:a05:6a21:71c7:b0:181:261f:f347 with SMTP id ay7-20020a056a2171c700b00181261ff347mr6588152pzc.32.1698935233783; Thu, 02 Nov 2023 07:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698935233; cv=none; d=google.com; s=arc-20160816; b=MoDPyaziP/QBfxQ5UKKo3KlFTTbvUSBs/xtnefBI4JaZy54soZAXeGsvPvCw1SQtta rjMQONK87GTAEmqkBhz8YaKKV/AdSVMkhHOEd3VCGzIhF3vJN6ML1ffEJ3BKNicNbGrQ dH3lk1YiBo4C/dk5oOoIFYW5MUG2vdUGYuViGLirr0ka4wjb06j0gQLhmqRLzapj6g+I WIViCItqwMH1PbPCpsR5vjDA1Y5XNkX92yyPaINY40X85P6nzvu9SyHDV9Fu2yFOSu9q QcFKisDBCFSeNQxF9KWkRSrAOyBC/3mGrDy2FhAtQdm70bOL+lEAlCHS48cTVjj0cVBW pDdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IQlY+Ogct50SulhYBO0Ht8k2i9eNXTRvLhpGLGyd9SQ=; fh=tAWvjMAEmVD3R8FzmIRYzQIb+yW9J+gWZJ2R8deHkVw=; b=dKFMXXO5/HfAFjQkn76Ou2jDcVhp8DXUsFTSexej3XkS8NdhTQ/H2EHBKltO7+uyM9 rhvA33wxhqB5zWE0CtrKmXkIW+0RbcKskD9rcVAc9F4s2tbAXYobkCnmZ9kQC/Yu3JpX UqVw+Au4gFPlFE7ybw7YjZMIAPdX5ea0ltlzbTZTt0AUv2TXAP73THUazHTbkqMWCbF4 V1PZHVk6h+mrTeooJr3uwPjSg9ADoPfjYikmHzmyjlAQji35V5TOfajETJ9SyGOXqjw0 zlqgWKolLKklL+s7mYWHCrGkss7M880XEiW4BZAyuAi0asmQtc6y7KEJBUFoOewdpuBF aDiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=lvCYDqjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i18-20020a633c52000000b005b92cefe42csi1980840pgn.97.2023.11.02.07.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 07:27:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=lvCYDqjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E5EE1822D11A; Thu, 2 Nov 2023 07:27:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376834AbjKBO1J (ORCPT + 36 others); Thu, 2 Nov 2023 10:27:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376810AbjKBO1C (ORCPT ); Thu, 2 Nov 2023 10:27:02 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DC061A6 for ; Thu, 2 Nov 2023 07:26:55 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 9461A66071A3; Thu, 2 Nov 2023 14:26:53 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698935214; bh=/LtYZX88iauWNQZJUo4rCxgbBpDr9xze3AUhEtbVTX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lvCYDqjfsnlTfsTUF/eGRTtWeN06O3QFIIgwOJE09mRbW8MjPHG1/i43A+8/nblLF p+E3VMrHJD5qpmnaxqxCumtS1z2BrlDmtmX8sk/GycpwBkjj+DglrTVqL4sFFaVcIA mDY8v7I6SxgubAArRmtIzOscjqMEmow1sr9XbJfDrmYhrw5bd/8a25/isvw4Vd+EB2 PnGNLBcJVqguD8Dtf+wt87G6W3LOzTvN+WdZgVQ0+DSpDYcbGjeqlj7xJZzGvIhT/D yi2c43PAITxkqG1psxvhQyXW1jUSq2TUp4v7ohJYSBW0qvrUY40AqbmX11RD9UlA1A sJI57ISmuQnLQ== From: AngeloGioacchino Del Regno To: boris.brezillon@collabora.com Cc: robh@kernel.org, steven.price@arm.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, wenst@chromium.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [PATCH v2 3/6] drm/panfrost: Implement ability to turn on/off GPU clocks in suspend Date: Thu, 2 Nov 2023 15:26:40 +0100 Message-ID: <20231102142643.75288-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> References: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 07:27:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781462711847174821 X-GMAIL-MSGID: 1781462711847174821 Currently, the GPU is being internally powered off for runtime suspend and turned back on for runtime resume through commands sent to it, but note that the GPU doesn't need to be clocked during the poweroff state, hence it is possible to save some power on selected platforms. Add suspend and resume handlers for full system sleep and then add a new panfrost_gpu_pm enumeration and a pm_features variable in the panfrost_compatible structure: BIT(GPU_PM_CLK_DIS) will be used to enable this power saving technique only on SoCs that are able to safely use it. Note that this was implemented only for the system sleep case and not for runtime PM because testing on one of my MediaTek platforms showed issues when turning on and off clocks aggressively (in PM runtime) resulting in a full system lockup. Doing this only for full system sleep never showed issues during my testing by suspending and resuming the system continuously for more than 100 cycles. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Steven Price --- Note: Even after fixing the panfrost_power_off() function, I'm still getting issues with turning off the clocks at .runtime_suspend() but this time, instead of getting a GPU lockup, the entire SoC will deadlock bringing down the entire system with it (so it's even worst!) :-) drivers/gpu/drm/panfrost/panfrost_device.c | 61 ++++++++++++++++++++-- drivers/gpu/drm/panfrost/panfrost_device.h | 11 ++++ 2 files changed, 68 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c index 28f7046e1b1a..2022ed76a620 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.c +++ b/drivers/gpu/drm/panfrost/panfrost_device.c @@ -403,7 +403,7 @@ void panfrost_device_reset(struct panfrost_device *pfdev) panfrost_job_enable_interrupts(pfdev); } -static int panfrost_device_resume(struct device *dev) +static int panfrost_device_runtime_resume(struct device *dev) { struct panfrost_device *pfdev = dev_get_drvdata(dev); @@ -413,7 +413,7 @@ static int panfrost_device_resume(struct device *dev) return 0; } -static int panfrost_device_suspend(struct device *dev) +static int panfrost_device_runtime_suspend(struct device *dev) { struct panfrost_device *pfdev = dev_get_drvdata(dev); @@ -426,5 +426,58 @@ static int panfrost_device_suspend(struct device *dev) return 0; } -EXPORT_GPL_RUNTIME_DEV_PM_OPS(panfrost_pm_ops, panfrost_device_suspend, - panfrost_device_resume, NULL); +static int panfrost_device_resume(struct device *dev) +{ + struct panfrost_device *pfdev = dev_get_drvdata(dev); + int ret; + + if (pfdev->comp->pm_features & BIT(GPU_PM_CLK_DIS)) { + ret = clk_enable(pfdev->clock); + if (ret) + return ret; + + if (pfdev->bus_clock) { + ret = clk_enable(pfdev->bus_clock); + if (ret) + goto err_bus_clk; + } + } + + ret = pm_runtime_force_resume(dev); + if (ret) + goto err_resume; + + return 0; + +err_resume: + if (pfdev->comp->pm_features & BIT(GPU_PM_CLK_DIS) && pfdev->bus_clock) + clk_disable(pfdev->bus_clock); +err_bus_clk: + if (pfdev->comp->pm_features & BIT(GPU_PM_CLK_DIS)) + clk_disable(pfdev->clock); + return ret; +} + +static int panfrost_device_suspend(struct device *dev) +{ + struct panfrost_device *pfdev = dev_get_drvdata(dev); + int ret; + + ret = pm_runtime_force_suspend(dev); + if (ret) + return ret; + + if (pfdev->comp->pm_features & BIT(GPU_PM_CLK_DIS)) { + clk_disable(pfdev->clock); + + if (pfdev->bus_clock) + clk_disable(pfdev->bus_clock); + } + + return 0; +} + +EXPORT_GPL_DEV_PM_OPS(panfrost_pm_ops) = { + RUNTIME_PM_OPS(panfrost_device_runtime_suspend, panfrost_device_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(panfrost_device_suspend, panfrost_device_resume) +}; diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index 1ef38f60d5dc..d7f179eb8ea3 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h @@ -25,6 +25,14 @@ struct panfrost_perfcnt; #define NUM_JOB_SLOTS 3 #define MAX_PM_DOMAINS 5 +/** + * enum panfrost_gpu_pm - Supported kernel power management features + * @GPU_PM_CLK_DIS: Allow disabling clocks during system suspend + */ +enum panfrost_gpu_pm { + GPU_PM_CLK_DIS, +}; + struct panfrost_features { u16 id; u16 revision; @@ -75,6 +83,9 @@ struct panfrost_compatible { /* Vendor implementation quirks callback */ void (*vendor_quirk)(struct panfrost_device *pfdev); + + /* Allowed PM features */ + u8 pm_features; }; struct panfrost_device { From patchwork Thu Nov 2 14:26:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 160899 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp393996vqu; Thu, 2 Nov 2023 07:28:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9clYsqWLnZeIn9TxfzQYD+lyDNcloldS93+Hse2WdBhwvsbP7t2Wi+x9oz9oJ+6bkN/05 X-Received: by 2002:a05:6a21:7894:b0:138:68b9:138e with SMTP id bf20-20020a056a21789400b0013868b9138emr9105805pzc.8.1698935293924; Thu, 02 Nov 2023 07:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698935293; cv=none; d=google.com; s=arc-20160816; b=pT1p81dpFkInIdMirmigP+0q8CD5jQhZA7gqTGdHbxZvszxML2Bp6GYqtd/4uS/MlK emk8xIfyUZfg6bsfcm7n36iAxQb5MIfiVoc1RO0VtPYrCKcOVs8hAJL1rPzg7arlZ/9o +quuCueXjp9LrQge1pZZdjuhHsbx2bZEHSBgn4eDrvd4+aXxCYx2Voy1LQqFO1En0gGB c8Wd/SFjJ1XUDbopIvcW//icFMEP3Wi1I3qIDUnFTlZj/XOcOIUa6shG5LncLTc6fn5T GLm9JfpUNXzxzGDlmuMjVX0qJqd0en8fzRMcxXSkHhNqSYXRFlyA8+ErSWfjzB8tMFAk zrdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fZQY1blD73uUYrg2yjbSX6lM1AGEqVMBX4QBV395gMQ=; fh=tAWvjMAEmVD3R8FzmIRYzQIb+yW9J+gWZJ2R8deHkVw=; b=Au3Gtx6xy7ilurYCkAKMLqXaAWwKvAi6YUAuWLGffaawY0UW+ser1zbDSmKv1DJKDS YamJTn8TQlopVkto+yxFDLchg/IBIev/9QFf/bxu9Qd4kLyrSQmqEZICHYUe9o7dAlEg hbCzxXRwREtA6QtyWABsiHl12Zs/P/EQ8dIBpzKXELABPbMbSWH+G46KzDM2SZmRg6mc 5rUkOzkzoFeCH4ab8lnzUEhJnqZGBRHhyWR54gK5zNsKGDI+V49T5cp4kYK6DaICCKys xxqSOLT9HBE49bP14/0OHTJaaDonsBjmq0ckpqtzKLy546adx1TGuEIc4BOZs++y+zAD aSYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PMgQ9tnH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id j191-20020a638bc8000000b005bd28c9bb23si808539pge.308.2023.11.02.07.28.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 07:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PMgQ9tnH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 9416A8024C13; Thu, 2 Nov 2023 07:27:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376839AbjKBO1P (ORCPT + 36 others); Thu, 2 Nov 2023 10:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376819AbjKBO1F (ORCPT ); Thu, 2 Nov 2023 10:27:05 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F60D187 for ; Thu, 2 Nov 2023 07:26:56 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 9BAF466071C9; Thu, 2 Nov 2023 14:26:54 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698935215; bh=nx8LZ5aZaZWmWIuhLZAit8ghPn7x7/L0ncMUkbIZjgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PMgQ9tnHFhp1yKgV6pn/NrC94LTt4p5qBqRZP5sEUPj6lAi/ozfcY+qg53ZszDXDA /3rSKevUzVz+wrE+dZ5NmofgBKgUhXwnrsaSUFZ3rHZ71MbbBHws778kvKrJ/Fn5Ai F2Y/DgS/BZcojQLvZnLhFBcc8fmtbTQdonpdcL9/n6tYlpGC6OiJh3QUsDX+DL/KuP 51IoH4sa70l81OP0zElQRaIj5TRsXg+RpqYns+w8F56iuowRSjMbVdbKS32kzYPB6P EBigNWc/hQdsTIyz2smZ2f/sBfb1Eqgcb7y4Xk9jME7NfYoT0pk7UvsPVUbQKtecqC QjzmENZSB0mvg== From: AngeloGioacchino Del Regno To: boris.brezillon@collabora.com Cc: robh@kernel.org, steven.price@arm.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, wenst@chromium.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [PATCH v2 4/6] drm/panfrost: Set clocks on/off during system sleep on MediaTek SoCs Date: Thu, 2 Nov 2023 15:26:41 +0100 Message-ID: <20231102142643.75288-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> References: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 02 Nov 2023 07:27:52 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781462774328086963 X-GMAIL-MSGID: 1781462774328086963 All of the MediaTek SoCs supported by Panfrost can switch the clocks off and on during system sleep to save some power without any user experience penalty. Measurements taken on multiple MediaTek SoCs show that adding this will not prolong the time that is required to resume the system in any meaningful way. As an example, for MT8195 - a "before" with only runtime PM operations (so, without turning on/off GPU clocks), and an "after" executing both the system sleep .resume() handler and .runtime_resume() (so the time refers to T_Resume + T_Runtime_Resume): Average Panfrost-only system sleep resume time, before: ~28000ns Average Panfrost-only system sleep resume time, after: ~33500ns Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 7cabf4e3d1f2..82f3c5fe9c58 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -734,6 +734,7 @@ static const struct panfrost_compatible mediatek_mt8183_b_data = { .supply_names = mediatek_mt8183_b_supplies, .num_pm_domains = ARRAY_SIZE(mediatek_mt8183_pm_domains), .pm_domain_names = mediatek_mt8183_pm_domains, + .pm_features = BIT(GPU_PM_CLK_DIS), }; static const char * const mediatek_mt8186_pm_domains[] = { "core0", "core1" }; @@ -742,6 +743,7 @@ static const struct panfrost_compatible mediatek_mt8186_data = { .supply_names = mediatek_mt8183_b_supplies, .num_pm_domains = ARRAY_SIZE(mediatek_mt8186_pm_domains), .pm_domain_names = mediatek_mt8186_pm_domains, + .pm_features = BIT(GPU_PM_CLK_DIS), }; static const char * const mediatek_mt8192_supplies[] = { "mali", NULL }; @@ -752,6 +754,7 @@ static const struct panfrost_compatible mediatek_mt8192_data = { .supply_names = mediatek_mt8192_supplies, .num_pm_domains = ARRAY_SIZE(mediatek_mt8192_pm_domains), .pm_domain_names = mediatek_mt8192_pm_domains, + .pm_features = BIT(GPU_PM_CLK_DIS), }; static const struct of_device_id dt_match[] = { From patchwork Thu Nov 2 14:26:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 160898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp393581vqu; Thu, 2 Nov 2023 07:27:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUVNRzF0XIQGXcgbMwM7V2f5+K/Z94FMETMSkD1a/kcVIEPbdVyr2kB8kSNbyTE8NlUFSv X-Received: by 2002:a17:902:ea01:b0:1cc:47a6:12b8 with SMTP id s1-20020a170902ea0100b001cc47a612b8mr13800136plg.46.1698935248654; Thu, 02 Nov 2023 07:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698935248; cv=none; d=google.com; s=arc-20160816; b=k+OTr5AM3VvrRhnU4vFxZ8OmkQMyhSZCB2yLjoeYi+2L1by/DgzrQQK1STgZ1LlaUZ 5FHnWBupENQkhQ7UEBXnaMFCPWfepTomkujHBW2eX1kDWdAFpKXkNxmISBKBg7Y/z94O FxLr6x9pkh+I9e7zssjB2Edn6BrxA10ZGiDYT6gcYXdEGYB9IH1Kyr4qwSS+JtSWwM69 tsIFBleRVyyjV/MSlTOQEcP4t1aa6cTEPub6/lf2IswYXIx4mfQjq83ZeysF3F7HtvzU b23hUSyooTInlAkGHkXsvgZTO0JnJsoUr1cExn3vcE3/Ua5z1GUsNYnUWwpAwf0lNm3K iP6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=shcKmizxUENtP1Ih2Lsio0RlYzOJFfGzfA5YRFNBKz8=; fh=tAWvjMAEmVD3R8FzmIRYzQIb+yW9J+gWZJ2R8deHkVw=; b=vgwqKHFs1bXE1SEPR4X2VVGtpMcHdpZe/Z7x5ZlluJ56wa4GqEDr8oD1LTbHsdVZdv G7Q3p+M/sDcdx60dyN1M510PYfdJ4GPBuNex1e3nGa4fhWcX87U3zs7Ci/g5c/QBIHu4 Vv5Tcz6IUgzqPvFjNyuODQ+eWtwgYJgh2USItIVMDU3Hz2pHmVw2hgt+cnHoE2QVGgaQ jyAGQ1zY+PRdsSDu/lAcNqVZ296fdfF5TOfusUNtS7CVNOvZsCF4Lq6odglYe+ocgRor qXN9Sy2ahN71KR7K4pv3cQYWC+GUxJb6m4sWb4QYvTonVNc6x+vajKfN+8bHhxNmbfsy NSFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QgYvBWJL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b2-20020a170902d40200b001c5e1c94588si4672248ple.550.2023.11.02.07.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 07:27:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QgYvBWJL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EA128822D14C; Thu, 2 Nov 2023 07:27:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376859AbjKBO1V (ORCPT + 36 others); Thu, 2 Nov 2023 10:27:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376815AbjKBO1F (ORCPT ); Thu, 2 Nov 2023 10:27:05 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B96EA198 for ; Thu, 2 Nov 2023 07:26:58 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id A047166071A9; Thu, 2 Nov 2023 14:26:55 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698935216; bh=3dUd841wLvR/syQt4DasoXOByTVGgSmSqikDkfeYRv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QgYvBWJLWs05RlEnORo1TJ541DBm/lIqdxky3UZXiB9beCz2/sWxF13bVJfF3MvYq SL4CGRyEoNLaTatGFsB+XbB/uvbO5wU0sXuwk/apYugYXba0sVlY1bGk/vhObyZWMr kXK2pgQ7m+NQ8TeGJgmYkj4noIZuN70fD8wfsHwmT/fOoZb5pDkm7vMm6lysznLZQ2 UE5sAIOPMPF5EABsVG1K0e7940ME9TSoIzHdcOpMWvOiT8kg9BQRwAtnAnEQEnz+of 5MCwKqnAEp/K/+k63jVOpIcQCZ+w41qBIuJjyGjbbRn/C/MQZTAUsJMTWyQp/FxQST LaOzlGkwrC1Ug== From: AngeloGioacchino Del Regno To: boris.brezillon@collabora.com Cc: robh@kernel.org, steven.price@arm.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, wenst@chromium.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [PATCH v2 5/6] drm/panfrost: Implement ability to turn on/off regulators in suspend Date: Thu, 2 Nov 2023 15:26:42 +0100 Message-ID: <20231102142643.75288-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> References: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 07:27:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781462727378471105 X-GMAIL-MSGID: 1781462727378471105 Some platforms/SoCs can power off the GPU entirely by completely cutting off power, greatly enhancing battery time during system suspend: add a new pm_feature GPU_PM_VREG_OFF to allow turning off the GPU regulators during full suspend only on selected platforms. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/panfrost/panfrost_device.c | 19 ++++++++++++++++++- drivers/gpu/drm/panfrost/panfrost_device.h | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c index 2022ed76a620..51b22eb0971d 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.c +++ b/drivers/gpu/drm/panfrost/panfrost_device.c @@ -431,10 +431,21 @@ static int panfrost_device_resume(struct device *dev) struct panfrost_device *pfdev = dev_get_drvdata(dev); int ret; + if (pfdev->comp->pm_features & BIT(GPU_PM_VREG_OFF)) { + unsigned long freq = pfdev->pfdevfreq.fast_rate; + struct dev_pm_opp *opp; + + opp = dev_pm_opp_find_freq_ceil(dev, &freq); + if (IS_ERR(opp)) + return PTR_ERR(opp); + dev_pm_opp_put(opp); + dev_pm_opp_set_opp(dev, opp); + } + if (pfdev->comp->pm_features & BIT(GPU_PM_CLK_DIS)) { ret = clk_enable(pfdev->clock); if (ret) - return ret; + goto err_clk; if (pfdev->bus_clock) { ret = clk_enable(pfdev->bus_clock); @@ -455,6 +466,9 @@ static int panfrost_device_resume(struct device *dev) err_bus_clk: if (pfdev->comp->pm_features & BIT(GPU_PM_CLK_DIS)) clk_disable(pfdev->clock); +err_clk: + if (pfdev->comp->pm_features & BIT(GPU_PM_VREG_OFF)) + dev_pm_opp_set_opp(dev, NULL); return ret; } @@ -474,6 +488,9 @@ static int panfrost_device_suspend(struct device *dev) clk_disable(pfdev->bus_clock); } + if (pfdev->comp->pm_features & BIT(GPU_PM_VREG_OFF)) + dev_pm_opp_set_opp(dev, NULL); + return 0; } diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index d7f179eb8ea3..0fc558db6bfd 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h @@ -28,9 +28,11 @@ struct panfrost_perfcnt; /** * enum panfrost_gpu_pm - Supported kernel power management features * @GPU_PM_CLK_DIS: Allow disabling clocks during system suspend + * @GPU_PM_VREG_OFF: Allow turning off regulators during system suspend */ enum panfrost_gpu_pm { GPU_PM_CLK_DIS, + GPU_PM_VREG_OFF, }; struct panfrost_features { From patchwork Thu Nov 2 14:26:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 160897 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp393518vqu; Thu, 2 Nov 2023 07:27:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE8UtxoK2nxmsO4SU/WD0I0vPWt556G0GOIBc/7G9Y7bzYhutuxxM5WwkDEeGcWrsuZEiC/ X-Received: by 2002:a05:6a20:3d04:b0:129:3bb4:77f1 with SMTP id y4-20020a056a203d0400b001293bb477f1mr19969567pzi.0.1698935243912; Thu, 02 Nov 2023 07:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698935243; cv=none; d=google.com; s=arc-20160816; b=Wr7e1kSVjkhE8sweRE1F/ZgBwbTMlDq7O3pqKXUOooNub931yBE9nzUplwT8hE7ocC uQg0VmnbHJiUM9yhDZsfdwrXYjBdTcTDF62DRiUtJg9HxRaimJ5RXM9ugcSINLt32SZT KdAejMlISExeeBMK3GFBTsUCvAvcelBJ4P7WX8viLWtRFlEVVaKfYn+T7rZJTc23Q+Fl uTW4uaitx0aOTL1SL7kmT30yUBr5m8/gkVW+6TWqycif1MHqy4AI9AlPl/OTwdaVYK6J 7riQzSYb6xLb7yltNxv00t/oiJPVlmISyEX4zqzwjYtQwB0/oCSEHQpKdIkwWzrhCfBa RQZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fy91i1rq9a9c9S7u/Ndzmkqtpc5DBKL/DpwN85VpWkw=; fh=tAWvjMAEmVD3R8FzmIRYzQIb+yW9J+gWZJ2R8deHkVw=; b=P2MxaQzSFLeKwON7S0NGLrwJhNpPIzbF8iMtxpw+yTM5vDKQLIT6ncT8GtRH3IiRJg jlCz4f9tPckpSALf/OwG7HUYI7LbQRnx2uB3LIsn9FehU8vjPgsPdO5rRxloogDXNVUJ qTGknnSxDVIDKX2xI3YEX0xQW0BxYViZ/8r/gztFMcycDFLocWFAaYYqFCyPJZ3RWnmI dkM/T5nA5f9tKzN2QFbVsw22RvsOqeRKduF5K0VVM0aYJUs48k86I34p77PV2Ru9TW6+ 4StQrY5K3WbjV2ByWu3/qWs5pgwHJjiO7ZXN/Hed3sjQ28TgjFWqozojzmBFKlg53mfn 4CpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JYDSlsNv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id v202-20020a6361d3000000b005b9610fb99esi1867657pgb.90.2023.11.02.07.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 07:27:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JYDSlsNv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 975AB822D14F; Thu, 2 Nov 2023 07:27:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376854AbjKBO1S (ORCPT + 36 others); Thu, 2 Nov 2023 10:27:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376829AbjKBO1F (ORCPT ); Thu, 2 Nov 2023 10:27:05 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B97D619F for ; Thu, 2 Nov 2023 07:26:58 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id A44E466072EF; Thu, 2 Nov 2023 14:26:56 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698935217; bh=L5OWGShxX3MAgjaEB+LbUFsMRGhPWkp6u6Ba4OZca4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JYDSlsNvDIwZLm6W5E2xUHL2zehdH/PcUa/huAehUQr3Q+TQILITNrexes/qLdQkQ hBeovSOTEEpTvQnigwj96Tv91jdw5TaAKxvK8Uz5b7dFgJfR7QmxxU7mp9x4OMKNMn wtSAXXro5G9mjxz8mKQhDlwzRjQa+eqadVSl2mPNrtAFLawK7G3MrxMK0/MvMJHY32 HiTVq6yqPCvV9LhBSPJMbbkeLOq4T8FjcoYQJMtTyVO1lpqyP3REBUw2R77FXHGv+v oZL0gj7JJjlsaj720cy5UWKI7No/a4A6evEvZXyPCTmuAXN8SUiSIh6O9E3rAvPytI ajw6CRoFkkOzQ== From: AngeloGioacchino Del Regno To: boris.brezillon@collabora.com Cc: robh@kernel.org, steven.price@arm.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, wenst@chromium.org, AngeloGioacchino Del Regno , kernel@collabora.com Subject: [PATCH v2 6/6] drm/panfrost: Set regulators on/off during system sleep on MediaTek SoCs Date: Thu, 2 Nov 2023 15:26:43 +0100 Message-ID: <20231102142643.75288-7-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> References: <20231102142643.75288-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 07:27:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781462722445810552 X-GMAIL-MSGID: 1781462722445810552 All of the MediaTek SoCs supported by Panfrost can completely cut power to the GPU during full system sleep without any user-noticeable delay in the resume operation, as shown by measurements taken on multiple MediaTek SoCs. As an example, for MT8195 - a "before" with only runtime PM operations (so, without turning on/off regulators), and an "after" executing both the system sleep .resume() handler and .runtime_resume() (so the time refers to T_Resume + T_Runtime_Resume): Average Panfrost-only system sleep resume time, before: ~33500ns Average Panfrost-only system sleep resume time, after: ~336200ns Keep in mind that this additional ~308200 nanoseconds delay happens only in resume from a full system suspend, and not in runtime PM operations, hence it is acceptable. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/panfrost/panfrost_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 82f3c5fe9c58..f63382d9ab04 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -734,7 +734,7 @@ static const struct panfrost_compatible mediatek_mt8183_b_data = { .supply_names = mediatek_mt8183_b_supplies, .num_pm_domains = ARRAY_SIZE(mediatek_mt8183_pm_domains), .pm_domain_names = mediatek_mt8183_pm_domains, - .pm_features = BIT(GPU_PM_CLK_DIS), + .pm_features = BIT(GPU_PM_CLK_DIS) | BIT(GPU_PM_VREG_OFF), }; static const char * const mediatek_mt8186_pm_domains[] = { "core0", "core1" }; @@ -743,7 +743,7 @@ static const struct panfrost_compatible mediatek_mt8186_data = { .supply_names = mediatek_mt8183_b_supplies, .num_pm_domains = ARRAY_SIZE(mediatek_mt8186_pm_domains), .pm_domain_names = mediatek_mt8186_pm_domains, - .pm_features = BIT(GPU_PM_CLK_DIS), + .pm_features = BIT(GPU_PM_CLK_DIS) | BIT(GPU_PM_VREG_OFF), }; static const char * const mediatek_mt8192_supplies[] = { "mali", NULL }; @@ -754,7 +754,7 @@ static const struct panfrost_compatible mediatek_mt8192_data = { .supply_names = mediatek_mt8192_supplies, .num_pm_domains = ARRAY_SIZE(mediatek_mt8192_pm_domains), .pm_domain_names = mediatek_mt8192_pm_domains, - .pm_features = BIT(GPU_PM_CLK_DIS), + .pm_features = BIT(GPU_PM_CLK_DIS) | BIT(GPU_PM_VREG_OFF), }; static const struct of_device_id dt_match[] = {