Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2705652lqp; Mon, 25 Mar 2024 07:09:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU94Jg6iVMG2SwqYxqNDRbQwJa4doOiKZwkr+XQR9Z0kh/DH5zKktUOGbQfHil22NhDvpOXCwIDpoGCyrPKNkEBb4G7fN+r8sbyhcODIw== X-Google-Smtp-Source: AGHT+IFwXrERtLdNnGKp/uVsyfdoBYKGZoUYqg+hULxo0tS6g52HJbyvYftAng7739VBAva+3RoQ X-Received: by 2002:a05:651c:1501:b0:2d4:707d:8b3c with SMTP id e1-20020a05651c150100b002d4707d8b3cmr7592845ljf.18.1711375797088; Mon, 25 Mar 2024 07:09:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711375797; cv=pass; d=google.com; s=arc-20160816; b=F4zfYDNgwYKpP3/XE1m+eN4Gid/eHocgfzV9U1HVdkVAbrLOMpg8/K2g2WngCArAK5 L98fw8mOjs7J7tnGq82xYHb5fiLfqOvlkQGnrUD5vXKVCtKzLfC/7IEyr95MN/aW8r2A yayaDfZKdOaCRjnZwocYUa4/yjsNn0kURaaUdF6eZsNmOiNyVu8nHFb3iiAJlyTPtmKb NqDElCwu2Ac89PrPeHALa/7e0mr/qxsqL+fVo5+lqe9KxVzdyOp9FiPTrXt++57d50YA L6z0w1CY36serd89obQTSGvxcSy3q6GZgKBxzWd4yKfCHNZkwZh6vdIDPwprX2T+/RwQ n7Fg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=jQktU3XmAS9NpA3XcWFFD5OiuKdgAwVqyHp8WADOnlc=; fh=Q+ZKEkn7qelYavYnvHhEl1/Pc4EuKIEhjLks79MgA0Q=; b=OmF9wvtU7tDgIrQsqK7YjFIVKinoKaSW4Pg6TQqaFap9YxorTMUJ3rr1kfnvv3iOQ4 soH0CMBwjRSpDZsIMdoeVxNLRK8Wia93bm36TsFSniMaFUd8N2qS9mqepBgAOm0MHoUS mHMB5DNO3UsyRkSlT5Y8rEBGksWxal1B+PcXzNU7nV1LxN/yLPxBlkrSiENiCmq5dIMl qQlXQ0W5PWhkvoxxdUeR1Un24CdjH6XuAZFbx/N4+gJlmunDV1RidK5MbRuC9uW2HwBu cMVq7ertvXpOvZLS/f0x0OjUZ01MSkmZ+dfoKmKgkXLVg5ojb0jI1+7QalykREExAp4n d01w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-116771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116771-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j2-20020a170906410200b00a46674fd64bsi2567427ejk.122.2024.03.25.07.09.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 07:09:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-116771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116771-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C62741F3DA7E for ; Mon, 25 Mar 2024 14:09:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 989B216EC1B; Mon, 25 Mar 2024 10:43:20 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B916F10A3C for ; Mon, 25 Mar 2024 10:28:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711362499; cv=none; b=HQ4ebSqXZIFO9x6TIgPrBfgOamF8xXaqaLLNG8nkVDjBtglS9ovLTOTy1Nb+eV1vN2clZg2XcqQrpgyRWY0kD7b7rjwdXq5i1OF65N0WGZhGRvB8PvEHvdyduoX9aEYJh7hfNwZ+iF5igIGU7xW600eH6dNa8wsnETEAXEir9BI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711362499; c=relaxed/simple; bh=Nsg5DTB9FmEllyTeXNhd2P7XdwJT0Qf+yploy0EirU8=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=blmYTIAkqQvNEIFwTkJAFLZQdC4V+dpFGmM8G3l/w26KeX56brZg3VVfobIkNxRtGDrZ7uhmImGzu4E6GGqrJmPwl9vfbVRYEJQNjz7BVmT7KPGnrjjct3KGbZ8HY/tdTFjFUvvplxDJFhGsXHWYthQ1L7AZ+mSW107tjcuwHeE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 B0F20C15; Mon, 25 Mar 2024 03:28:50 -0700 (PDT) Received: from [10.57.15.178] (unknown [10.57.15.178]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 085F33F67D; Mon, 25 Mar 2024 03:28:14 -0700 (PDT) Message-ID: Date: Mon, 25 Mar 2024 10:28:17 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/panfrost: fix power transition timeout warnings To: Christian Hewitt , Boris Brezillon , Rob Herring , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , AngeloGioacchino Del Regno , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20240322164525.2617508-1-christianshewitt@gmail.com> Content-Language: en-GB From: Steven Price In-Reply-To: <20240322164525.2617508-1-christianshewitt@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 22/03/2024 16:45, Christian Hewitt wrote: > Increase the timeout value to prevent system logs on Amlogic boards flooding > with power transition warnings: > > [ 13.047638] panfrost ffe40000.gpu: shader power transition timeout > [ 13.048674] panfrost ffe40000.gpu: l2 power transition timeout > [ 13.937324] panfrost ffe40000.gpu: shader power transition timeout > [ 13.938351] panfrost ffe40000.gpu: l2 power transition timeout > ... > [39829.506904] panfrost ffe40000.gpu: shader power transition timeout > [39829.507938] panfrost ffe40000.gpu: l2 power transition timeout > [39949.508369] panfrost ffe40000.gpu: shader power transition timeout > [39949.509405] panfrost ffe40000.gpu: l2 power transition timeout > > The 2000 value has been found through trial and error testing with devices > using G52 and G31 GPUs. How close to 2ms did you need in your trial and error testing? I'm wondering if we should increase it further in case this might still trigger occasionally? kbase seems to have a 5s (5000ms!) timeout before it will actually complain. But equally it doesn't busy wait on the registers in the same way as panfrost, so the impact to the rest of the system of a long wait is less. But 2ms doesn't sound an unreasonable timeout so: Reviewed-by: Steven Price > Fixes: 22aa1a209018 ("drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()") > Signed-off-by: Christian Hewitt > --- > drivers/gpu/drm/panfrost/panfrost_gpu.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c > index 9063ce254642..fd8e44992184 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c > +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c > @@ -441,19 +441,19 @@ void panfrost_gpu_power_off(struct panfrost_device *pfdev) > > gpu_write(pfdev, SHADER_PWROFF_LO, pfdev->features.shader_present); > ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_PWRTRANS_LO, > - val, !val, 1, 1000); > + val, !val, 1, 2000); > if (ret) > dev_err(pfdev->dev, "shader power transition timeout"); > > gpu_write(pfdev, TILER_PWROFF_LO, pfdev->features.tiler_present); > ret = readl_relaxed_poll_timeout(pfdev->iomem + TILER_PWRTRANS_LO, > - val, !val, 1, 1000); > + val, !val, 1, 2000); > if (ret) > dev_err(pfdev->dev, "tiler power transition timeout"); As Angelo points out the tiler probably doesn't need such a long timeout, but I can't see the harm in consistency so I'm happy with this change. If my memory of the hardware is correct then the tiler power off actually does very little and so I wouldn't expect it to take very long. Steve > gpu_write(pfdev, L2_PWROFF_LO, pfdev->features.l2_present); > ret = readl_poll_timeout(pfdev->iomem + L2_PWRTRANS_LO, > - val, !val, 0, 1000); > + val, !val, 0, 2000); > if (ret) > dev_err(pfdev->dev, "l2 power transition timeout"); > }