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: <2d5acbda-61a9-412d-bf9d-04a372c927c5@linaro.org>
Date:   Sun, 3 Dec 2023 13:29:55 +0200
From:   Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To:     Rob Clark <robdclark@...il.com>, dri-devel@...ts.freedesktop.org
Cc:     freedreno@...ts.freedesktop.org, linux-arm-msm@...r.kernel.org,
        Rob Clark <robdclark@...omium.org>,
        Abhinav Kumar <quic_abhinavk@...cinc.com>,
        Sean Paul <sean@...rly.run>,
        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 v2 5/7] drm/msm/gem: Cleanup submit_cleanup_bo()

On 21/11/2023 02:38, Rob Clark wrote:
> From: Rob Clark <robdclark@...omium.org>
> 
> Now that it only handles unlock duty, drop the superfluous arg and
> rename it.
> 
> Signed-off-by: Rob Clark <robdclark@...omium.org>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>

> ---
>   drivers/gpu/drm/msm/msm_gem_submit.c | 15 +++++----------
>   1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
> index d001bf286606..603f04d851d9 100644
> --- a/drivers/gpu/drm/msm/msm_gem_submit.c
> +++ b/drivers/gpu/drm/msm/msm_gem_submit.c
> @@ -248,14 +248,10 @@ static int submit_lookup_cmds(struct msm_gem_submit *submit,
>   	return ret;
>   }
>   
> -/* Unwind bo state, according to cleanup_flags.  In the success case, only
> - * the lock is dropped at the end of the submit (and active/pin ref is dropped
> - * later when the submit is retired).
> - */
> -static void submit_cleanup_bo(struct msm_gem_submit *submit, int i,
> -		unsigned cleanup_flags)
> +static void submit_unlock_bo(struct msm_gem_submit *submit, int i)
>   {
>   	struct drm_gem_object *obj = submit->bos[i].obj;
> +	unsigned cleanup_flags = BO_LOCKED;

Nit: checkpatch will warn here, it should be unsigned int.

>   	unsigned flags = submit->bos[i].flags & cleanup_flags;
>   
>   	/*
> @@ -304,10 +300,10 @@ static int submit_lock_objects(struct msm_gem_submit *submit)
>   	}
>   
>   	for (; i >= 0; i--)
> -		submit_cleanup_bo(submit, i, BO_LOCKED);
> +		submit_unlock_bo(submit, i);
>   
>   	if (slow_locked > 0)
> -		submit_cleanup_bo(submit, slow_locked, BO_LOCKED);
> +		submit_unlock_bo(submit, slow_locked);
>   
>   	if (ret == -EDEADLK) {
>   		struct drm_gem_object *obj = submit->bos[contended].obj;
> @@ -533,7 +529,6 @@ static int submit_reloc(struct msm_gem_submit *submit, struct drm_gem_object *ob
>    */
>   static void submit_cleanup(struct msm_gem_submit *submit, bool error)
>   {
> -	unsigned cleanup_flags = BO_LOCKED;
>   	unsigned i;
>   
>   	if (error)
> @@ -541,7 +536,7 @@ static void submit_cleanup(struct msm_gem_submit *submit, bool error)
>   
>   	for (i = 0; i < submit->nr_bos; i++) {
>   		struct drm_gem_object *obj = submit->bos[i].obj;
> -		submit_cleanup_bo(submit, i, cleanup_flags);
> +		submit_unlock_bo(submit, i);
>   		if (error)
>   			drm_gem_object_put(obj);
>   	}

-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ