Re: [PATCH 01/11] drm/vgem: Use ww_mutex_(un)lock even with a NULL context

From: Peter Zijlstra
Date: Mon Nov 28 2016 - 07:50:45 EST


On Mon, Nov 28, 2016 at 01:42:26PM +0100, Maarten Lankhorst wrote:

> > + ww_mutex_lock(&resv->lock.base, NULL);
> Yuck, can we rename base to __NEVER_TOUCH_DIRECTLY_OUTSIDE_LOCKING_CORE?
> It's harder to get them confused like that, even with a null context it's illegal to call mutex_lock/unlock directly.

I think there's a __private sparse annotation that could be used.