[PATCH 37/37] Input: mac_hid - add lockdep annotation to emumousebtn

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <unlisted-recipients@...>, <@...>
Cc: <linux-kernel@...>, <jkosina@...>, <akpm@...>
Date: Friday, April 18, 2008 - 12:25 am

The mouse button emulation calls input device methods from an input
device. This causes funny lock nesting which is harmless as each
device has its own locks.

Give the nesting device its own lock classes so that lockdep will not
consider them the same.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
 drivers/macintosh/mac_hid.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c
index 8930230..f972ff3 100644
--- a/drivers/macintosh/mac_hid.c
+++ b/drivers/macintosh/mac_hid.c
@@ -103,6 +103,9 @@ int mac_hid_mouse_emulate_buttons(int caller, unsigned int keycode, int down)
 	return 0;
 }
 
+static struct lock_class_key emumousebtn_event_class;
+static struct lock_class_key emumousebtn_mutex_class;
+
 static int emumousebtn_input_register(void)
 {
 	int ret;
@@ -111,6 +114,9 @@ static int emumousebtn_input_register(void)
 	if (!emumousebtn)
 		return -ENOMEM;
 
+	lockdep_set_class(emumousebtn->event_lock, &emumousebtn_event_class);
+	lockdep_set_class(emumousebtn->mutex, &emumousebtn_mutex_class);
+
 	emumousebtn->name = "Macintosh mouse button emulation";
 	emumousebtn->id.bustype = BUS_ADB;
 	emumousebtn->id.vendor = 0x0001;
-- 
1.5.5.rc2.6.gf58d

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/37] Input queue for 2.6.26 merge window, Dmitry Torokhov, (Mon Apr 21, 9:14 am)
Re: [PATCH 00/37] Input queue for 2.6.26 merge window, Henrique de Moraes Holschuh..., (Mon Apr 21, 11:11 am)
Re: [PATCH 00/37] Input queue for 2.6.26 merge window, Dmitry Torokhov, (Mon Apr 21, 11:44 am)
Re: [PATCH 00/37] Input queue for 2.6.26 merge window, Henrique de Moraes Holschuh..., (Mon Apr 21, 12:58 pm)
[PATCH 28/37] Input: add Zhen Hua driver, Martin Kebert, (Mon Mar 10, 8:40 am)
[PATCH 10/37] Input: tosakbd - fix suspend, Dmitry Baryshkov, (Wed Apr 2, 11:22 am)
[PATCH 35/37] Input: bf54x-keys - add infrastructure for key..., Michael Hennerich, (Fri Apr 18, 12:25 am)
[PATCH 19/37] Input: xpad - don't use GFP_ATOMIC, Oliver Neukum, (Thu Apr 3, 4:19 pm)
[PATCH 37/37] Input: mac_hid - add lockdep annotation to emu..., Peter Zijlstra, (Fri Apr 18, 12:25 am)
[PATCH 29/37] Input: fix ordering in joystick Makefile, Jiri Kosina, (Mon Mar 10, 8:43 am)
Re: [PATCH 29/37] Input: fix ordering in joystick Makefile, Dmitry Torokhov, (Mon Apr 21, 11:39 am)
Re: [PATCH 29/37] Input: fix ordering in joystick Makefile, Dmitry Torokhov, (Mon Apr 21, 12:20 pm)
[PATCH 24/37] Input: omap-keypad - fix build warning, David Brownell, (Tue Apr 15, 1:31 am)
[PATCH 22/37] Input: add PS/2 serio driver for AVR32 devices, Hans-Christian Egtvedt, (Tue Apr 15, 1:30 am)
Re: [PATCH 22/37] Input: add PS/2 serio driver for AVR32 dev..., Hans-Christian Egtvedt, (Mon Apr 21, 9:33 am)
[PATCH 23/37] Input: gpio_keys - irq handling cleanup, David Brownell, (Tue Apr 15, 1:31 am)
[PATCH 13/37] Input: xpad - fix inverted Y and RY axes, Anssi Hannula, (Thu Apr 3, 4:18 pm)