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: <9586bba7-ffb8-945f-eb30-88629e34737d@linux.intel.com>
Date:   Wed, 2 Mar 2022 10:37:18 +0000
From:   Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>, jani.nikula@...ux.intel.com,
        joonas.lahtinen@...ux.intel.com, rodrigo.vivi@...el.com,
        airlied@...ux.ie, daniel@...ll.ch, radhakrishna.sripada@...el.com,
        ville.syrjala@...ux.intel.com, matthew.d.roper@...el.com,
        lucas.demarchi@...el.com, jose.souza@...el.com,
        Thomas Hellstrom <thomas.hellstrom@...el.com>,
        Matthew Auld <matthew.auld@...el.com>
Cc:     intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/i915/gt: Handle errors for i915_gem_object_trylock


+ Thomas, Matt

On 02/03/2022 06:19, Jiasheng Jiang wrote:
> As the potential failure of the i915_gem_object_trylock(),
> it should be better to check it and return error if fails.
> 
> Fixes: 94ce0d65076c ("drm/i915/gt: Setup a default migration context on the GT")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
>   drivers/gpu/drm/i915/gt/selftest_migrate.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/selftest_migrate.c b/drivers/gpu/drm/i915/gt/selftest_migrate.c
> index fa4293d2944f..79c6c68f7316 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_migrate.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_migrate.c
> @@ -465,7 +465,11 @@ create_init_lmem_internal(struct intel_gt *gt, size_t sz, bool try_lmem)
>   			return obj;
>   	}
>   
> -	i915_gem_object_trylock(obj, NULL);

Guys why is this a trylock to start with? (Since being added in 
94ce0d65076c ("drm/i915/gt: Setup a default migration context on the GT").

Surely it can't ever fail since the object has just been created.

Regards,

Tvrtko

> +	if (!i915_gem_object_trylock(obj, NULL)) {
> +		i915_gem_object_put(obj);
> +		return ERR_PTR(-EBUSY);
> +	}
> +
>   	err = i915_gem_object_pin_pages(obj);
>   	if (err) {
>   		i915_gem_object_unlock(obj);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ