Re: [PATCH] drm/i915: properly init lockdep class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2017-11-30 at 16:19 +0100, Sebastian Andrzej Siewior wrote:
> The code has an ifdef and uses two functions to either init the bare
> spinlock or init it and set a lock-class. It is possible to do the same
> thing without an ifdef.
> With this patch (in debug case) we first use the "default" lock class
> which is later overwritten to the supplied one. Without lockdep the set
> name/class function vanishes.
> 
> Reported-by: kbuild test robot <fengguang.wu@xxxxxxxxx>

How exactly did kbuild test robot figure this out?

At least according to the source there doesn't seem to be clarity about
what is the right thing to do, this being just one option.

Regards, Joonas

> +++ b/drivers/gpu/drm/i915/i915_gem_timeline.c
> @@ -33,11 +33,8 @@ static void __intel_timeline_init(struct
>  {
>  	tl->fence_context = context;
>  	tl->common = parent;
> -#ifdef CONFIG_DEBUG_SPINLOCK
> -	__raw_spin_lock_init(&tl->lock.rlock, lockname, lockclass);
> -#else
>  	spin_lock_init(&tl->lock);
> -#endif
> +	lockdep_set_class_and_name(&tl->lock, lockclass, lockname);
>  	init_request_active(&tl->last_request, NULL);
>  	INIT_LIST_HEAD(&tl->requests);
>  	i915_syncmap_init(&tl->sync);
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux