Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753120AbbKZPWx (ORCPT ); Thu, 26 Nov 2015 10:22:53 -0500 Received: from e33.co.us.ibm.com ([32.97.110.151]:49914 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753077AbbKZPWt (ORCPT ); Thu, 26 Nov 2015 10:22:49 -0500 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org;linux-media@vger.kernel.org Date: Thu, 26 Nov 2015 07:23:17 -0800 From: "Paul E. McKenney" To: Russell King - ARM Linux Cc: Maarten Lankhorst , Daniel Vetter , Greg Kroah-Hartman , Sumit Semwal , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: reservation.h: build error with lockdep disabled Message-ID: <20151126152317.GL26643@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20151126134340.GB8644@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151126134340.GB8644@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15112615-0009-0000-0000-00001013081F Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1436 Lines: 39 On Thu, Nov 26, 2015 at 01:43:40PM +0000, Russell King - ARM Linux wrote: > As of 3c3b177a9369 ("reservation: add suppport for read-only access > using rcu") linux/reservation.h uses lockdep macros: > > +#define reservation_object_held(obj) lockdep_is_held(&(obj)->lock.base) > > This results in build errors when lockdep is disabled as lockdep_is_held() > is only available when lockdep is enabled. This has been reported today > to break the etnaviv kernel driver, which we're hoping to submit for 4.5. > > As this gets used with rcu_dereference_protected(), eg: > > static inline struct reservation_object_list * > reservation_object_get_list(struct reservation_object *obj) > { > return rcu_dereference_protected(obj->fence, > reservation_object_held(obj)); > } > > I'm guessing that it's not going to be a simple case of making it always > return true or always return false. > > Any ideas how to solve this? The usual approach is something like this: #ifdef CONFIG_PROVE_LOCKING #define reservation_object_held(obj) lockdep_is_held(&(obj)->lock.base) #else #define reservation_object_held(obj) true #endif Thanx, Paul -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/