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] [thread-next>] [day] [month] [year] [list]
Message-ID: <192815d9-5ecb-09a7-4624-5fd36126890d@amd.com>
Date:   Tue, 1 Oct 2019 21:29:30 +0000
From:   "Liu, Leo" <Leo.Liu@....com>
To:     "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
        "Deucher, Alexander" <Alexander.Deucher@....com>,
        "Koenig, Christian" <Christian.Koenig@....com>,
        "Zhou, David(ChunMing)" <David1.Zhou@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>
CC:     "amd-gfx@...ts.freedesktop.org" <amd-gfx@...ts.freedesktop.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/amdgpu: fix structurally dead code vcn_v2_5_hw_init


On 2019-10-01 1:16 p.m., Gustavo A. R. Silva wrote:
> Notice that there is a *continue* statement in the middle of the
> for loop and that prevents the code below from ever being reached:
>
> 	r = amdgpu_ring_test_ring(ring);
> 	if (r) {
> 		ring->sched.ready = false;
> 		goto done;
> 	}
>
> Fix this by removing the continue statement and updating ring->sched.ready
> to true before calling amdgpu_ring_test_ring(ring).
>
> Notice that this fix is based on
> commit 1b61de45dfaf ("drm/amdgpu: add initial VCN2.0 support (v2)")
>
> Addresses-Coverity-ID 1485608 ("Structurally dead code")
> Fixes: 28c17d72072b ("drm/amdgpu: add VCN2.5 basic supports")
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
> ---
>
> Any feedback is greatly appreciated.
>
>   drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
> index 395c2259f979..47b0dcd59e13 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
> @@ -258,6 +258,7 @@ static int vcn_v2_5_hw_init(void *handle)
>   		adev->nbio_funcs->vcn_doorbell_range(adev, ring->use_doorbell,
>   						     ring->doorbell_index, j);
>   
> +		ring->sched.ready = true;

This is redundant. all the sched->ready is initialized as true, please 
refer to drm_sched_init()


>   		r = amdgpu_ring_test_ring(ring);
>   		if (r) {
>   			ring->sched.ready = false;
> @@ -266,8 +267,7 @@ static int vcn_v2_5_hw_init(void *handle)
>   
>   		for (i = 0; i < adev->vcn.num_enc_rings; ++i) {
>   			ring = &adev->vcn.inst[j].ring_enc[i];
> -			ring->sched.ready = false;
> -			continue;
> +			ring->sched.ready = true;

Because the VCN 2.5 FW still has issue for encode, so we have it 
disabled here.


Regards,

Leo




>   			r = amdgpu_ring_test_ring(ring);
>   			if (r) {
>   				ring->sched.ready = false;
> @@ -276,6 +276,7 @@ static int vcn_v2_5_hw_init(void *handle)
>   		}
>   
>   		ring = &adev->vcn.inst[j].ring_jpeg;
> +		ring->sched.ready = true;
>   		r = amdgpu_ring_test_ring(ring);
>   		if (r) {
>   			ring->sched.ready = false;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ