From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 549A7C4332F for ; Wed, 8 Nov 2023 13:20:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344701AbjKHNUJ (ORCPT ); Wed, 8 Nov 2023 08:20:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbjKHNUH (ORCPT ); Wed, 8 Nov 2023 08:20:07 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6D8761BE3 for ; Wed, 8 Nov 2023 05:20:05 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 658121477; Wed, 8 Nov 2023 05:20:49 -0800 (PST) Received: from [10.1.36.36] (e122027.cambridge.arm.com [10.1.36.36]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 587E83F703; Wed, 8 Nov 2023 05:20:02 -0800 (PST) Message-ID: <7928524a-b581-483b-b1a1-6ffd719ce650@arm.com> Date: Wed, 8 Nov 2023 13:20:00 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off() Content-Language: en-GB To: AngeloGioacchino Del Regno , boris.brezillon@collabora.com Cc: robh@kernel.org, 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, kernel@collabora.com References: <20231102141507.73481-1-angelogioacchino.delregno@collabora.com> From: Steven Price In-Reply-To: <20231102141507.73481-1-angelogioacchino.delregno@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/11/2023 14:15, AngeloGioacchino Del Regno wrote: > The layout of the registers {TILER,SHADER,L2}_PWROFF_LO, used to request > powering off cores, is the same as the {TILER,SHADER,L2}_PWRON_LO ones: > this means that in order to request poweroff of cores, we are supposed > to write a bitmask of cores that should be powered off! > This means that the panfrost_gpu_power_off() function has always been > doing nothing. > > Fix powering off the GPU by writing a bitmask of the cores to poweroff > to the relevant PWROFF_LO registers and then check that the transition > (from ON to OFF) has finished by polling the relevant PWRTRANS_LO > registers. > > While at it, in order to avoid code duplication, move the core mask > logic from panfrost_gpu_power_on() to a new panfrost_get_core_mask() > function, used in both poweron and poweroff. > > Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver") > Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Steven Price Thanks, Steve