summaryrefslogtreecommitdiff
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-17 08:56:43 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-17 08:56:43 -0700
commit43f82216f0bd114599f4a221ae6924f3658a0c9a (patch)
tree89dbd85a0a1882ae38e6b61e360b365c018195fd /drivers/input/serio
parent20f85957667ccc53183b5ffac22213d75e317408 (diff)
parentb435fdcda126db42343b8055d04a0a27c229717b (diff)
downloadlinux-3.10-43f82216f0bd114599f4a221ae6924f3658a0c9a.tar.gz
linux-3.10-43f82216f0bd114599f4a221ae6924f3658a0c9a.tar.bz2
linux-3.10-43f82216f0bd114599f4a221ae6924f3658a0c9a.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: fm801-gp - handle errors from pci_enable_device() Input: gameport core - handle errors returned by device_bind_driver() Input: serio core - handle errors returned by device_bind_driver() Lockdep: fix compile error in drivers/input/serio/serio.c Input: serio - add lockdep annotations Lockdep: add lockdep_set_class_and_subclass() and lockdep_set_subclass() Input: atkbd - supress "too many keys" error message Input: i8042 - supress ACK/NAKs when blinking during panic Input: add missing exports to fix modular build
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/i8042.c13
-rw-r--r--drivers/input/serio/libps2.c3
-rw-r--r--drivers/input/serio/serio.c22
3 files changed, 32 insertions, 6 deletions
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 09b06e605b5..7e3141f37e3 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -106,6 +106,7 @@ static unsigned char i8042_ctr;
static unsigned char i8042_mux_present;
static unsigned char i8042_kbd_irq_registered;
static unsigned char i8042_aux_irq_registered;
+static unsigned char i8042_suppress_kbd_ack;
static struct platform_device *i8042_platform_device;
static irqreturn_t i8042_interrupt(int irq, void *dev_id);
@@ -316,7 +317,7 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
unsigned char str, data;
unsigned int dfl;
unsigned int port_no;
- int ret;
+ int ret = 1;
spin_lock_irqsave(&i8042_lock, flags);
str = i8042_read_status();
@@ -378,10 +379,16 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
dfl & SERIO_PARITY ? ", bad parity" : "",
dfl & SERIO_TIMEOUT ? ", timeout" : "");
+ if (unlikely(i8042_suppress_kbd_ack))
+ if (port_no == I8042_KBD_PORT_NO &&
+ (data == 0xfa || data == 0xfe)) {
+ i8042_suppress_kbd_ack = 0;
+ goto out;
+ }
+
if (likely(port->exists))
serio_interrupt(port->serio, data, dfl);
- ret = 1;
out:
return IRQ_RETVAL(ret);
}
@@ -842,11 +849,13 @@ static long i8042_panic_blink(long count)
led ^= 0x01 | 0x04;
while (i8042_read_status() & I8042_STR_IBF)
DELAY;
+ i8042_suppress_kbd_ack = 1;
i8042_write_data(0xed); /* set leds */
DELAY;
while (i8042_read_status() & I8042_STR_IBF)
DELAY;
DELAY;
+ i8042_suppress_kbd_ack = 1;
i8042_write_data(led);
DELAY;
last_blink = count;
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c
index dcb16b5cbec..e5b1b60757b 100644
--- a/drivers/input/serio/libps2.c
+++ b/drivers/input/serio/libps2.c
@@ -189,7 +189,7 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
return -1;
}
- mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING);
+ mutex_lock(&ps2dev->cmd_mutex);
serio_pause_rx(ps2dev->serio);
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)
{
mutex_init(&ps2dev->cmd_mutex);
+ lockdep_set_subclass(&ps2dev->cmd_mutex, serio->depth);
init_waitqueue_head(&ps2dev->wait);
ps2dev->serio = serio;
}
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 960fae3c3ce..211943f85cb 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -118,6 +118,8 @@ static int serio_match_port(const struct serio_device_id *ids, struct serio *ser
static void serio_bind_driver(struct serio *serio, struct serio_driver *drv)
{
+ int error;
+
down_write(&serio_bus.subsys.rwsem);
if (serio_match_port(drv->id_table, serio)) {
@@ -126,9 +128,19 @@ static void serio_bind_driver(struct serio *serio, struct serio_driver *drv)
serio->dev.driver = NULL;
goto out;
}
- device_bind_driver(&serio->dev);
+ error = device_bind_driver(&serio->dev);
+ if (error) {
+ printk(KERN_WARNING
+ "serio: device_bind_driver() failed "
+ "for %s (%s) and %s, error: %d\n",
+ serio->phys, serio->name,
+ drv->description, error);
+ serio_disconnect_driver(serio);
+ serio->dev.driver = NULL;
+ goto out;
+ }
}
-out:
+ out:
up_write(&serio_bus.subsys.rwsem);
}
@@ -538,8 +550,12 @@ static void serio_init_port(struct serio *serio)
"serio%ld", (long)atomic_inc_return(&serio_no) - 1);
serio->dev.bus = &serio_bus;
serio->dev.release = serio_release_port;
- if (serio->parent)
+ if (serio->parent) {
serio->dev.parent = &serio->parent->dev;
+ serio->depth = serio->parent->depth + 1;
+ } else
+ serio->depth = 0;
+ lockdep_set_subclass(&serio->lock, serio->depth);
}
/*