mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 16:07:39 +00:00
Input: serio - add lockdep annotations
Signed-off-by: Jiri Kosina <jikos@jikos.cz> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
4dfbb9d8c6
commit
88aa0103e4
3 changed files with 8 additions and 2 deletions
|
@ -189,7 +189,7 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING);
|
mutex_lock(&ps2dev->cmd_mutex);
|
||||||
|
|
||||||
serio_pause_rx(ps2dev->serio);
|
serio_pause_rx(ps2dev->serio);
|
||||||
ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0;
|
ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0;
|
||||||
|
@ -296,6 +296,7 @@ EXPORT_SYMBOL(ps2_schedule_command);
|
||||||
void ps2_init(struct ps2dev *ps2dev, struct serio *serio)
|
void ps2_init(struct ps2dev *ps2dev, struct serio *serio)
|
||||||
{
|
{
|
||||||
mutex_init(&ps2dev->cmd_mutex);
|
mutex_init(&ps2dev->cmd_mutex);
|
||||||
|
lockdep_set_subclass(&ps2dev->cmd_mutex, serio->depth);
|
||||||
init_waitqueue_head(&ps2dev->wait);
|
init_waitqueue_head(&ps2dev->wait);
|
||||||
ps2dev->serio = serio;
|
ps2dev->serio = serio;
|
||||||
}
|
}
|
||||||
|
|
|
@ -538,8 +538,12 @@ static void serio_init_port(struct serio *serio)
|
||||||
"serio%ld", (long)atomic_inc_return(&serio_no) - 1);
|
"serio%ld", (long)atomic_inc_return(&serio_no) - 1);
|
||||||
serio->dev.bus = &serio_bus;
|
serio->dev.bus = &serio_bus;
|
||||||
serio->dev.release = serio_release_port;
|
serio->dev.release = serio_release_port;
|
||||||
if (serio->parent)
|
if (serio->parent) {
|
||||||
serio->dev.parent = &serio->parent->dev;
|
serio->dev.parent = &serio->parent->dev;
|
||||||
|
serio->depth = serio->parent->depth + 1;
|
||||||
|
} else
|
||||||
|
serio->depth = 0;
|
||||||
|
lockdep_set_subclass(&serio->lock, serio->depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -41,6 +41,7 @@ struct serio {
|
||||||
void (*stop)(struct serio *);
|
void (*stop)(struct serio *);
|
||||||
|
|
||||||
struct serio *parent, *child;
|
struct serio *parent, *child;
|
||||||
|
unsigned int depth; /* level of nesting in serio hierarchy */
|
||||||
|
|
||||||
struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
|
struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
|
||||||
struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
|
struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
|
||||||
|
|
Loading…
Reference in a new issue