Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754584AbcK1Mun (ORCPT ); Mon, 28 Nov 2016 07:50:43 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:48251 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754388AbcK1Muf (ORCPT ); Mon, 28 Nov 2016 07:50:35 -0500 Date: Mon, 28 Nov 2016 13:50:24 +0100 From: Peter Zijlstra To: Maarten Lankhorst Cc: Nicolai =?iso-8859-1?Q?H=E4hnle?= , linux-kernel@vger.kernel.org, Nicolai =?iso-8859-1?Q?H=E4hnle?= , Ingo Molnar , Daniel Vetter , Chris Wilson , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 01/11] drm/vgem: Use ww_mutex_(un)lock even with a NULL context Message-ID: <20161128125024.GZ3092@twins.programming.kicks-ass.net> References: <1480335612-12069-1-git-send-email-nhaehnle@gmail.com> <1480335612-12069-2-git-send-email-nhaehnle@gmail.com> <03202725-ecf3-1b49-f22a-1cbff84156bc@mblankhorst.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <03202725-ecf3-1b49-f22a-1cbff84156bc@mblankhorst.nl> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 375 Lines: 7 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.