From c9ac5adffe74467b9cb8f5bd1fc4e2469f5245e4 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sat, 4 Nov 2006 13:50:17 +0000 Subject: [PATCH] backport kill "too many key pressed" mesage happens rutinely on my x41 svn path=/dists/trunk/linux-2.6/; revision=7691 --- debian/changelog | 5 +- .../input-atkb-supress-too-may-keys.patch | 135 ++++++++++++++++++ debian/patches/series/4 | 1 + 3 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 debian/patches/features/input-atkb-supress-too-may-keys.patch diff --git a/debian/changelog b/debian/changelog index 73233fd89..af8114177 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux-2.6 (2.6.18-4) unstable; urgency=low +linux-2.6 (2.6.18-4) UNRELEASED; urgency=low [ Norbert Tretkowski ] * [alpha] Switched to gcc-4.1. @@ -111,6 +111,7 @@ linux-2.6 (2.6.18-4) unstable; urgency=low - NFS: nfs_lookup - don't hash dentry when optimising away the lookup - uml: make Uml compile on FC6 kernel headers - Fix potential interrupts during alternative patching + * Backport atkbd - supress "too many keys" error message. [ Sven Luther ] * [powerpc] Added exception alignement patch from Benjamin Herrenschmidt. @@ -154,7 +155,7 @@ linux-2.6 (2.6.18-4) unstable; urgency=low - bugfix/mips/dec-serial.patch, replaces mips-dec-serial.patch, fix serial console handling on DECstations. - -- maximilian attems Sat, 4 Nov 2006 10:49:46 +0100 + -- maximilian attems Sat, 4 Nov 2006 14:46:21 +0100 linux-2.6 (2.6.18-3) unstable; urgency=low diff --git a/debian/patches/features/input-atkb-supress-too-may-keys.patch b/debian/patches/features/input-atkb-supress-too-may-keys.patch new file mode 100644 index 000000000..d9eee1bdb --- /dev/null +++ b/debian/patches/features/input-atkb-supress-too-may-keys.patch @@ -0,0 +1,135 @@ +From git-commits-head-owner@vger.kernel.org Tue Oct 17 23:30:30 2006 +From: Linux Kernel Mailing List +To: git-commits-head@vger.kernel.org +Subject: Input: atkbd - supress "too many keys" error message + +commit 86255d9d0bede79140f4912482447963f00818c0 +tree a3d18df86ecd58f3e84168141084b848507a42a3 +parent 817e6ba3623de9cdc66c6aba90eae30b5588ff11 +author Dmitry Torokhov 1160545486 -0400 +committer Dmitry Torokhov 1160545486 -0400 + +Input: atkbd - supress "too many keys" error message + +Many users seems to be annoyed by this warning so kill the message +and implement a counter exported as a sysfs attribute so we still +know what is going on. Make atkbd use attribute groups while we are +at it. + +Signed-off-by: Dmitry Torokhov + + drivers/input/keyboard/atkbd.c | 54 +++++++++++++++++++++++++++++++---------- + 1 file changed, 41 insertions(+), 13 deletions(-) + +diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c +index b6ef9ea..cbb9366 100644 +--- a/drivers/input/keyboard/atkbd.c ++++ b/drivers/input/keyboard/atkbd.c +@@ -221,6 +221,7 @@ struct atkbd { + unsigned long xl_bit; + unsigned int last; + unsigned long time; ++ unsigned long err_count; + + struct work_struct event_work; + struct mutex event_mutex; +@@ -234,11 +235,13 @@ static ssize_t atkbd_attr_set_helper(str + #define ATKBD_DEFINE_ATTR(_name) \ + static ssize_t atkbd_show_##_name(struct atkbd *, char *); \ + static ssize_t atkbd_set_##_name(struct atkbd *, const char *, size_t); \ +-static ssize_t atkbd_do_show_##_name(struct device *d, struct device_attribute *attr, char *b) \ ++static ssize_t atkbd_do_show_##_name(struct device *d, \ ++ struct device_attribute *attr, char *b) \ + { \ + return atkbd_attr_show_helper(d, b, atkbd_show_##_name); \ + } \ +-static ssize_t atkbd_do_set_##_name(struct device *d, struct device_attribute *attr, const char *b, size_t s) \ ++static ssize_t atkbd_do_set_##_name(struct device *d, \ ++ struct device_attribute *attr, const char *b, size_t s) \ + { \ + return atkbd_attr_set_helper(d, b, s, atkbd_set_##_name); \ + } \ +@@ -251,6 +254,32 @@ ATKBD_DEFINE_ATTR(set); + ATKBD_DEFINE_ATTR(softrepeat); + ATKBD_DEFINE_ATTR(softraw); + ++#define ATKBD_DEFINE_RO_ATTR(_name) \ ++static ssize_t atkbd_show_##_name(struct atkbd *, char *); \ ++static ssize_t atkbd_do_show_##_name(struct device *d, \ ++ struct device_attribute *attr, char *b) \ ++{ \ ++ return atkbd_attr_show_helper(d, b, atkbd_show_##_name); \ ++} \ ++static struct device_attribute atkbd_attr_##_name = \ ++ __ATTR(_name, S_IRUGO, atkbd_do_show_##_name, NULL); ++ ++ATKBD_DEFINE_RO_ATTR(err_count); ++ ++static struct attribute *atkbd_attributes[] = { ++ &atkbd_attr_extra.attr, ++ &atkbd_attr_scroll.attr, ++ &atkbd_attr_set.attr, ++ &atkbd_attr_softrepeat.attr, ++ &atkbd_attr_softraw.attr, ++ &atkbd_attr_err_count.attr, ++ NULL ++}; ++ ++static struct attribute_group atkbd_attribute_group = { ++ .attrs = atkbd_attributes, ++}; ++ + static const unsigned int xl_table[] = { + ATKBD_RET_BAT, ATKBD_RET_ERR, ATKBD_RET_ACK, + ATKBD_RET_NAK, ATKBD_RET_HANJA, ATKBD_RET_HANGEUL, +@@ -396,7 +425,10 @@ #endif + add_release_event = 1; + break; + case ATKBD_RET_ERR: ++ atkbd->err_count++; ++#ifdef ATKBD_DEBUG + printk(KERN_DEBUG "atkbd.c: Keyboard on %s reports too many keys pressed.\n", serio->phys); ++#endif + goto out; + } + +@@ -786,12 +818,7 @@ static void atkbd_disconnect(struct seri + synchronize_sched(); /* Allow atkbd_interrupt()s to complete. */ + flush_scheduled_work(); + +- device_remove_file(&serio->dev, &atkbd_attr_extra); +- device_remove_file(&serio->dev, &atkbd_attr_scroll); +- device_remove_file(&serio->dev, &atkbd_attr_set); +- device_remove_file(&serio->dev, &atkbd_attr_softrepeat); +- device_remove_file(&serio->dev, &atkbd_attr_softraw); +- ++ sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); + input_unregister_device(atkbd->dev); + serio_close(serio); + serio_set_drvdata(serio, NULL); +@@ -961,11 +988,7 @@ static int atkbd_connect(struct serio *s + atkbd_set_keycode_table(atkbd); + atkbd_set_device_attrs(atkbd); + +- device_create_file(&serio->dev, &atkbd_attr_extra); +- device_create_file(&serio->dev, &atkbd_attr_scroll); +- device_create_file(&serio->dev, &atkbd_attr_set); +- device_create_file(&serio->dev, &atkbd_attr_softrepeat); +- device_create_file(&serio->dev, &atkbd_attr_softraw); ++ sysfs_create_group(&serio->dev.kobj, &atkbd_attribute_group); + + atkbd_enable(atkbd); + +@@ -1259,6 +1282,11 @@ static ssize_t atkbd_set_softraw(struct + return count; + } + ++static ssize_t atkbd_show_err_count(struct atkbd *atkbd, char *buf) ++{ ++ return sprintf(buf, "%lu\n", atkbd->err_count); ++} ++ + + static int __init atkbd_init(void) + { + diff --git a/debian/patches/series/4 b/debian/patches/series/4 index 6ca6c2a34..27401f3e2 100644 --- a/debian/patches/series/4 +++ b/debian/patches/series/4 @@ -45,3 +45,4 @@ + bugfix/sparc/t1k-cpu-lockup.patch + bugfix/2.6.18.2 + bugfix/arm/iop3xx-mtd-map-fix.patch ++ features/input-atkb-supress-too-may-keys.patch