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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4a8a9984-efd4-4aaa-ba48-5ff6b641349c@linaro.org>
Date: Tue, 4 Jun 2024 19:03:04 +0200
From: Konrad Dybcio <konrad.dybcio@...aro.org>
To: Rob Clark <robdclark@...il.com>, dri-devel@...ts.freedesktop.org
Cc: linux-arm-msm@...r.kernel.org, freedreno@...ts.freedesktop.org,
 Rob Clark <robdclark@...omium.org>, Sean Paul <sean@...rly.run>,
 Abhinav Kumar <quic_abhinavk@...cinc.com>,
 Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
 Marijn Suijten <marijn.suijten@...ainline.org>,
 David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
 open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/msm/a6xx: Print SQE fw version



On 6/4/24 17:48, Rob Clark wrote:
> From: Rob Clark <robdclark@...omium.org>
> 
> Add the SQE fw version to dmesg and devcoredump.
> 
> Signed-off-by: Rob Clark <robdclark@...omium.org>
> ---
>   drivers/gpu/drm/msm/adreno/a6xx_gpu.c       | 32 +++++++++++++++++++--
>   drivers/gpu/drm/msm/adreno/a6xx_gpu.h       |  1 +
>   drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c |  2 ++
>   3 files changed, 33 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> index 56bfb228808d..5a2a005003c8 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> @@ -665,6 +665,32 @@ static int a7xx_cp_init(struct msm_gpu *gpu)
>   	return a6xx_idle(gpu, ring) ? 0 : -EINVAL;
>   }
>   
> +static uint32_t get_ucode_version(const uint32_t *data)
> +{
> +	uint32_t version;
> +
> +	/* NOTE: compared to kgsl, we've already stripped off the first dword: */
> +	version = data[0];
> +
> +	if ((version & 0xf) != 0xa)
> +		return version;
> +
> +	version &= ~0xfff;
> +	return  version | ((data[2] & 0xfff000) >> 12);

double space

Some GENMASKy defines w/ FIELD_GET would be nice here..

[...]

>   
> +	DRM_DEV_INFO(&gpu->pdev->dev, "Have SQE version %03x\n", get_ucode_version(buf));


"SQE FW version: [...]" instead?

> +
>   	/* A7xx is safe! */
>   	if (adreno_is_a7xx(adreno_gpu) || adreno_is_a702(adreno_gpu))
>   		return true;
> @@ -714,7 +742,7 @@ static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu,
>   		}
>   
>   		DRM_DEV_ERROR(&gpu->pdev->dev,
> -			"a630 SQE ucode is too old. Have version %x need at least %x\n",
> +			"a630 SQE ucode is too old. Have version %03x need at least %03x\n",
>   			buf[0] & 0xfff, 0x190);

This func should probably get updated to use the new getter too,
getting rid of magic masks for e.g.

if (FIELD_GET(SQE_FW_MINMAJ, ver) > 0x190)
	foobarbaz

Konrad

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ