lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 22 Mar 2019 11:43:30 +0100
From:   Paul Kocialkowski <paul.kocialkowski@...tlin.com>
To:     Eric Anholt <eric@...olt.net>, dri-devel@...ts.freedesktop.org
Cc:     linux-kernel@...r.kernel.org,
        Maxime Ripard <maxime.ripard@...tlin.com>
Subject: Re: [PATCH 7/7] drm/vc4: Make sure that the v3d ident debugfs has
 vc4's power on.

Hi,

Le mercredi 20 février 2019 à 13:03 -0800, Eric Anholt a écrit :
> Otherwise, you sometimes decode the ident fields based on 0xdeadbeef
> register reads.

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@...tlin.com>

Cheers,

Paul

> Signed-off-by: Eric Anholt <eric@...olt.net>
> ---
>  drivers/gpu/drm/vc4/vc4_v3d.c | 29 +++++++++++++++++------------
>  1 file changed, 17 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
> index 7820b8eaaa98..36e6c7086ecf 100644
> --- a/drivers/gpu/drm/vc4/vc4_v3d.c
> +++ b/drivers/gpu/drm/vc4/vc4_v3d.c
> @@ -108,18 +108,23 @@ static int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused)
>  	struct drm_info_node *node = (struct drm_info_node *)m->private;
>  	struct drm_device *dev = node->minor->dev;
>  	struct vc4_dev *vc4 = to_vc4_dev(dev);
> -	uint32_t ident1 = V3D_READ(V3D_IDENT1);
> -	uint32_t nslc = VC4_GET_FIELD(ident1, V3D_IDENT1_NSLC);
> -	uint32_t tups = VC4_GET_FIELD(ident1, V3D_IDENT1_TUPS);
> -	uint32_t qups = VC4_GET_FIELD(ident1, V3D_IDENT1_QUPS);
> -
> -	seq_printf(m, "Revision:   %d\n",
> -		   VC4_GET_FIELD(ident1, V3D_IDENT1_REV));
> -	seq_printf(m, "Slices:     %d\n", nslc);
> -	seq_printf(m, "TMUs:       %d\n", nslc * tups);
> -	seq_printf(m, "QPUs:       %d\n", nslc * qups);
> -	seq_printf(m, "Semaphores: %d\n",
> -		   VC4_GET_FIELD(ident1, V3D_IDENT1_NSEM));
> +	int ret = vc4_v3d_pm_get(vc4);
> +
> +	if (ret == 0) {
> +		uint32_t ident1 = V3D_READ(V3D_IDENT1);
> +		uint32_t nslc = VC4_GET_FIELD(ident1, V3D_IDENT1_NSLC);
> +		uint32_t tups = VC4_GET_FIELD(ident1, V3D_IDENT1_TUPS);
> +		uint32_t qups = VC4_GET_FIELD(ident1, V3D_IDENT1_QUPS);
> +
> +		seq_printf(m, "Revision:   %d\n",
> +			   VC4_GET_FIELD(ident1, V3D_IDENT1_REV));
> +		seq_printf(m, "Slices:     %d\n", nslc);
> +		seq_printf(m, "TMUs:       %d\n", nslc * tups);
> +		seq_printf(m, "QPUs:       %d\n", nslc * qups);
> +		seq_printf(m, "Semaphores: %d\n",
> +			   VC4_GET_FIELD(ident1, V3D_IDENT1_NSEM));
> +		vc4_v3d_pm_put(vc4);
> +	}
>  
>  	return 0;
>  }
-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

Powered by blists - more mailing lists