Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1333411ybg; Thu, 11 Jun 2020 07:14:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjrGpjbPP4H9u11zN4Q0gPUR6DWT9nSDHOgsn7MXTKXExGD7DU+X7FN0deOcM1Ji9hZTVy X-Received: by 2002:a17:906:b79a:: with SMTP id dt26mr8953880ejb.422.1591884859769; Thu, 11 Jun 2020 07:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591884859; cv=none; d=google.com; s=arc-20160816; b=cY/yttN0k+5MpkhL6cuue4NhpyvPj3xS6gV9L589QFTNaJEEnRBaZN3kJQMrFjcbuK CqXd2Gprpjv9zPUv9nOTnw4poGOj0y97Bwoh93v36wuf9kENwjnevDo8EJt2DsUBf4zT adWRndO3jwMP8rH01QmtId6ExtkBfgnGf0TXIC5PwEPTFs4KU0bpiMuiPrKvsYCYenPQ asbfv099e8p/bQhBkG6GRB7CJG4m6/Ll4jVOy2zLA0M9+cmt9jQjQmAo1D3yY1PYlTc9 e27PRlZzeOxi9zx+w2HS3XGiaiQN8Zve2cG9vyrVy5DCaVO60jggbH/8VOL3dP5mdCWi spIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=uA7mCjXE1YUuaTb12F6Ct9G+m3iS5965I0txZcq6RDY=; b=rno1XP+RXJ1k+YyMu4W3T3GS6QFDgc90xTE2yO2T24gWpOiDlZ7GkNvO+HUWTqIKxS 2r1sDJKgX42eDseP8MUHwlVDgvbyhN15/6tVB1a/QU8ec7/2xfbElHC1a7pcLllUHDxN nSFO0bQyMYZEh60wcsMH5nDKZnip0RxNsC9KaBWMRpCvh9eVthEZJ7jzZbeyx5enNVzN PLHW8R61n7h6KMCRgWy4AULd0bkqvNYw9VRJc+O12jxQF1kHI8GtmbYBfXp54tKHTRva YAIO+fxxY0ObXEiMLbxRvLD4a64pUPCydj8Nazf089NywIn6/PT1974Eoo3emRzb6yTs GXWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k15si1650472edq.127.2020.06.11.07.13.57; Thu, 11 Jun 2020 07:14:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728123AbgFKOLm (ORCPT + 99 others); Thu, 11 Jun 2020 10:11:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726905AbgFKOLh (ORCPT ); Thu, 11 Jun 2020 10:11:37 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B064BC08C5C1 for ; Thu, 11 Jun 2020 07:11:36 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: alyssa) with ESMTPSA id 3800A2A4ACF Date: Thu, 11 Jun 2020 10:11:27 -0400 From: Alyssa Rosenzweig To: Tomeu Vizoso Cc: LKML , Rob Herring , Steven Price , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 1/2] panfrost: Make sure GPU is powered on when reading GPU_LATEST_FLUSH_ID Message-ID: <20200611141127.GA1834@kevin> References: <20200611085900.49740-1-tomeu.vizoso@collabora.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline In-Reply-To: <20200611085900.49740-1-tomeu.vizoso@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Both patches are Reviewed-by: Alyssa Rosenzweig On Thu, Jun 11, 2020 at 10:58:43AM +0200, Tomeu Vizoso wrote: > Bifrost devices do support the flush reduction feature, so on first job > submit we were trying to read the register while still powered off. >=20 > If the GPU is powered off, the feature doesn't bring any benefit, so > don't try to read. >=20 > Signed-off-by: Tomeu Vizoso > --- > drivers/gpu/drm/panfrost/panfrost_gpu.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/pa= nfrost/panfrost_gpu.c > index f2c1ddc41a9b..e0f190e43813 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c > +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c > @@ -10,6 +10,7 @@ > #include > #include > #include > +#include > =20 > #include "panfrost_device.h" > #include "panfrost_features.h" > @@ -368,7 +369,16 @@ void panfrost_gpu_fini(struct panfrost_device *pfdev) > =20 > u32 panfrost_gpu_get_latest_flush_id(struct panfrost_device *pfdev) > { > - if (panfrost_has_hw_feature(pfdev, HW_FEATURE_FLUSH_REDUCTION)) > - return gpu_read(pfdev, GPU_LATEST_FLUSH_ID); > + u32 flush_id; > + > + if (panfrost_has_hw_feature(pfdev, HW_FEATURE_FLUSH_REDUCTION)) { > + /* Flush reduction only makes sense when the GPU is kept powered on be= tween jobs */ > + if (pm_runtime_get_if_in_use(pfdev->dev)) { > + flush_id =3D gpu_read(pfdev, GPU_LATEST_FLUSH_ID); > + pm_runtime_put(pfdev->dev); > + return flush_id; > + } > + } > + > return 0; > } > --=20 > 2.21.0 >=20 --OgqxwSJOaUobr8KG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEQ17gm7CvANAdqvY4/v5QWgr1WA0FAl7iO4YACgkQ/v5QWgr1 WA0tPBAArzmVDiuBFirXaT97r1Ge78bboVEyZU99PhlWzzQsuA9Cxn5THkpl1Od+ BYGXVCycozrZNwEvHnTzI6NruL1ZgLK9NrIT/afZSK4dzg6lLiZplyi7dCul/YAU J/UWU5/g4ae8aPWMXz2v1wiwcpA0N2PS/5WQxKwm6f45B7aBudchG7Ofdhpg8LrW EFP7ScKMWYmnGYzfwUZ2uXawnHpBrNoXS1ZQ21EfA22V4LOJvmH7zzh2o/ldhq5P 3FHu8MdNyiNgrSyU07Fe+zJ3jt5MkGI4EiR36r90vvBlv3C75ov7wtPcPgyEsURI b51D5+osyt1Q9GmHYrpxFo73H/qPYqxCnZW1cVSrd74h2VKdv/QzSeALg2VHfQNW W9d1U3SjD+BKzwgCvNCEppken3nG5nsHPc39CXwoetZ5hOrzy0iQMCJ2rzjxLC3d TCIzOU6MbHvUVNYqeBqe+bkftoN98Gf9+JUnKyZJSbolkbaUF0vZyI3xoP5ga+wm PMyx89WjZauM0VQP6rUbkDmzhzQihvWYId276r37CTYrKY/jLo52b5RChWDUnIJb dfMZ6BF7fDoUPszOSEeaqkYmf8HtyLYl95h7FMLD56ewdMDUAKSujXyXq9D3+wYc 1JSQEGBHIPhMw783zOmGWp+nVozQ/O2+9R28NJLYbDdQClQ4Gcc= =K7V+ -----END PGP SIGNATURE----- --OgqxwSJOaUobr8KG--