All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Matthew Auld <matthew.auld@intel.com>
Subject: Re: [PATCH] drm/i915/selftests: Avoid drm_gem_handle_create under struct_mutex
Date: Tue, 21 Nov 2017 15:01:43 +0200	[thread overview]
Message-ID: <1511269303.4891.53.camel@linux.intel.com> (raw)
In-Reply-To: <20171121110652.1107-1-chris@chris-wilson.co.uk>

On Tue, 2017-11-21 at 11:06 +0000, Chris Wilson wrote:
> Despite us reloading the module around every selftest, the lockclasses
> persist and the chains used in selftesting may then dictate how we are
> allowed to nest locks during runtime testing. As such we have to be just
> as careful, and in particular it turns out we are not allowed to nest
> dev->object_name_lock (drm_gem_handle_create) inside dev->struct_mutex.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103830
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

<SNIP>

> @@ -283,8 +299,7 @@ create_test_object(struct i915_gem_context *ctx,
>  	if (IS_ERR(obj))
>  		return obj;
>  
> -	/* tie the handle to the drm_file for easy reaping */
> -	err = drm_gem_handle_create(file, &obj->base, &handle);
> +	err = file_add_object(file, obj);

Should we have a more direct connection between the substituted mock
function names? So should we have mock_drm_gem_handle_create, and it'll
then mock that function only for the interesting parts, like here.

I know it might be equally confusing, too, when only a small portion of
the function is mocked. Especially if it's more of a side-effect like
here.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-11-21 13:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 11:06 [PATCH] drm/i915/selftests: Avoid drm_gem_handle_create under struct_mutex Chris Wilson
2017-11-21 12:11 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-11-21 12:53 ` ✓ Fi.CI.IGT: " Patchwork
2017-11-21 13:01 ` Joonas Lahtinen [this message]
2017-11-21 13:12   ` [PATCH] " Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1511269303.4891.53.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.