From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>,
Daniel Vetter <daniel@ffwll.ch>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sumit Semwal <sumit.semwal@linaro.org>,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: reservation.h: build error with lockdep disabled
Date: Thu, 26 Nov 2015 07:23:17 -0800 [thread overview]
Message-ID: <20151126152317.GL26643@linux.vnet.ibm.com> (raw)
In-Reply-To: <20151126134340.GB8644@n2100.arm.linux.org.uk>
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
prev parent reply other threads:[~2015-11-26 15:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-26 13:43 reservation.h: build error with lockdep disabled Russell King - ARM Linux
2015-11-26 15:23 ` Paul E. McKenney [this message]
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=20151126152317.GL26643@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=maarten.lankhorst@canonical.com \
--cc=sumit.semwal@linaro.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox