2005-10-27 08:27:20

by Andi Kleen

[permalink] [raw]
Subject: [PATCH] Disable the most annoying printk in the kernel


Remove most useless printk in the world

Signed-off-by: Andi Kleen <[email protected]>

Index: linux/drivers/input/keyboard/atkbd.c
===================================================================
--- linux/drivers/input/keyboard/atkbd.c
+++ linux/drivers/input/keyboard/atkbd.c
@@ -328,7 +328,6 @@ static irqreturn_t atkbd_interrupt(struc
atkbd_report_key(&atkbd->dev, regs, KEY_HANJA, 3);
goto out;
case ATKBD_RET_ERR:
- printk(KERN_DEBUG "atkbd.c: Keyboard on %s reports too many keys pressed.
\n", serio->phys);
goto out;
}


2005-10-27 14:05:01

by Keenan Pepper

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

Andi Kleen wrote:
> Remove most useless printk in the world

No way! I love that prink! =P

> Signed-off-by: Andi Kleen <[email protected]>
>
> Index: linux/drivers/input/keyboard/atkbd.c
> ===================================================================
> --- linux/drivers/input/keyboard/atkbd.c
> +++ linux/drivers/input/keyboard/atkbd.c
> @@ -328,7 +328,6 @@ static irqreturn_t atkbd_interrupt(struc
> atkbd_report_key(&atkbd->dev, regs, KEY_HANJA, 3);
> goto out;
> case ATKBD_RET_ERR:
> - printk(KERN_DEBUG "atkbd.c: Keyboard on %s reports too many keys pressed.
> \n", serio->phys);
> goto out;
> }
>

2005-10-27 14:39:34

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On Thu, 2005-10-27 at 10:04 -0400, Keenan Pepper wrote:
> Andi Kleen wrote:
> > Remove most useless printk in the world
>
> No way! I love that prink! =P
>

And you know, once it is gone, you will start getting reports from
people that their kernel doesn't act like it use to. Or they'll start
to think that their keyboards suddenly work better ;-)

-- Steve

> > Signed-off-by: Andi Kleen <[email protected]>
> >
> > Index: linux/drivers/input/keyboard/atkbd.c
> > ===================================================================
> > --- linux/drivers/input/keyboard/atkbd.c
> > +++ linux/drivers/input/keyboard/atkbd.c
> > @@ -328,7 +328,6 @@ static irqreturn_t atkbd_interrupt(struc
> > atkbd_report_key(&atkbd->dev, regs, KEY_HANJA, 3);
> > goto out;
> > case ATKBD_RET_ERR:
> > - printk(KERN_DEBUG "atkbd.c: Keyboard on %s reports too many keys pressed.
> > \n", serio->phys);
> > goto out;
> > }
> >
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2005-10-27 18:03:33

by Ingo Oeser

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

Hi Andi,

On Thursday 27 October 2005 10:26, Andi Kleen wrote:
> Remove most useless printk in the world

*clap* *clap*

Thanks!

It usally triggers, if your cat, child, bird whatever handles your keyboard or
you accidentally put a book or sth. on it (e.g while the screen has been
locked).

So there is really no use for it, except for kernel debugging,
where it can be wrapped up by pr_debug() or similiar.

Regards

Ingo Oeser


Attachments:
(No filename) (431.00 B)
(No filename) (189.00 B)
Download all attachments

2005-10-27 22:04:44

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel


>> > Remove most useless printk in the world
>>
>> No way! I love that prink! =P
>
>And you know, once it is gone, you will start getting reports from
>people that their kernel doesn't act like it use to. Or they'll start
>to think that their keyboards suddenly work better ;-)

You could make it a high beep click `a la MS-DOS.



Jan Engelhardt
--

2005-10-27 23:23:04

by Jerome Lacoste

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On 10/27/05, Ingo Oeser <[email protected]> wrote:
> Hi Andi,
>
> On Thursday 27 October 2005 10:26, Andi Kleen wrote:
> > Remove most useless printk in the world
>
> *clap* *clap*
>
> Thanks!
>
> It usally triggers, if your cat, child, bird whatever handles your keyboard or
> you accidentally put a book or sth. on it (e.g while the screen has been
> locked).
>
> So there is really no use for it, except for kernel debugging,
> where it can be wrapped up by pr_debug() or similiar.

I am not the fastest typer on Earth, far from it.

I use to have this printed all over the place on my Dell Inspiron 8100
laptop, without really doing anything special with my keyboard....

So I don't know if this was an issue or not, but given that my
keyboard never caused me a trouble, I just brain blacklisted the
message.

Thanks a lot for making this simple yet effective patch :)

Cheers,

Jerome

2005-10-28 18:31:07

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

Hi!

> Remove most useless printk in the world
>
> Signed-off-by: Andi Kleen <[email protected]>

It warns about crappy keyboards. It triggers regulary for me on x32,
(probably because of my weird capslock+x+s etc combination). It is
usefull as a warning "this keyboard is crap" and "no, bad mechanical switch
is not the reason for lost key".
Pavel
--
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms

2005-10-28 18:43:05

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On Friday 28 October 2005 09:20, Pavel Machek wrote:
> Hi!
>
> > Remove most useless printk in the world
> >
> > Signed-off-by: Andi Kleen <[email protected]>
>
> It warns about crappy keyboards. It triggers regulary for me on x32,
> (probably because of my weird capslock+x+s etc combination). It is
> usefull as a warning "this keyboard is crap" and "no, bad mechanical switch
> is not the reason for lost key".

In German that would be described as "Zum Schaden auch noch den Spot"
(for the damage you get the gossip too). Not very useful.

-Andi

2005-10-28 18:51:05

by Hugh Dickins

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On Fri, 28 Oct 2005, Pavel Machek wrote:
>
> > Remove most useless printk in the world
>
> It warns about crappy keyboards. It triggers regulary for me on x32,
> (probably because of my weird capslock+x+s etc combination). It is
> usefull as a warning "this keyboard is crap" and "no, bad mechanical switch
> is not the reason for lost key".

Okay, if you want a message to remind you that your keyboard is crap
several times a day, please keep your own patch to do so. Let the
rest of the world go with Andi's patch.

Hugh

2005-10-28 18:52:06

by Andre Eisenbach

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

"Add insult to injury" ;)

2005/10/28, Andi Kleen <[email protected]>:
> On Friday 28 October 2005 09:20, Pavel Machek wrote:
> > Hi!
> >
> > > Remove most useless printk in the world
> > >
> > > Signed-off-by: Andi Kleen <[email protected]>
> >
> > It warns about crappy keyboards. It triggers regulary for me on x32,
> > (probably because of my weird capslock+x+s etc combination). It is
> > usefull as a warning "this keyboard is crap" and "no, bad mechanical switch
> > is not the reason for lost key".
>
> In German that would be described as "Zum Schaden auch noch den Spot"
> (for the damage you get the gossip too). Not very useful.
>
> -Andi
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2005-10-28 20:45:18

by Lee Revell

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On Fri, 2005-10-28 at 19:50 +0100, Hugh Dickins wrote:
> On Fri, 28 Oct 2005, Pavel Machek wrote:
> >
> > > Remove most useless printk in the world
> >
> > It warns about crappy keyboards. It triggers regulary for me on x32,
> > (probably because of my weird capslock+x+s etc combination). It is
> > usefull as a warning "this keyboard is crap" and "no, bad mechanical switch
> > is not the reason for lost key".
>
> Okay, if you want a message to remind you that your keyboard is crap
> several times a day, please keep your own patch to do so. Let the
> rest of the world go with Andi's patch.

Plus keyboards are a dime a dozen these days, they give you one with
every server whether or not you want it. If you have rack full of 1U
servers the pile of keyboards will be as high as the rack. I wish our
KVM vendor would come haul them away.

Lee

2005-10-28 20:52:08

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

Hi!

> > > > Remove most useless printk in the world
> > >
> > > It warns about crappy keyboards. It triggers regulary for me on x32,
> > > (probably because of my weird capslock+x+s etc combination). It is
> > > usefull as a warning "this keyboard is crap" and "no, bad mechanical switch
> > > is not the reason for lost key".
> >
> > Okay, if you want a message to remind you that your keyboard is crap
> > several times a day, please keep your own patch to do so. Let the
> > rest of the world go with Andi's patch.
>
> Plus keyboards are a dime a dozen these days, they give you one with
> every server whether or not you want it. If you have rack full of 1U
> servers the pile of keyboards will be as high as the rack. I wish our
> KVM vendor would come haul them away.

Well, keyboard detected and reported an error. Kernel reacted with
printk(). You are removing that printk(). I can understand that,
printk is really annoying, but I really believe _some_ error handling
should be added there if you remove the printk.
Pavel
--
Thanks, Sharp!

2005-10-28 21:00:06

by Russell King

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On Fri, Oct 28, 2005 at 10:51:32PM +0200, Pavel Machek wrote:
> Well, keyboard detected and reported an error. Kernel reacted with
> printk(). You are removing that printk(). I can understand that,
> printk is really annoying, but I really believe _some_ error handling
> should be added there if you remove the printk.

What do you suggest?

Having a TP 380XD which regularly produces this annoying message,
it's just logspam. There's no noticable failure.

Plus, kernels previous to ones with the new input subsystem just
used to ignore the scancode (from v2.[24].xx):

int pckbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode)
{
...
/* 0xFF is sent by a few keyboards, ignore it. 0x00 is error */
if (scancode == 0x00 || scancode == 0xff) {
prev_scancode = 0;
return 0;
}
}

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core

2005-10-28 21:20:41

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel


>> Well, keyboard detected and reported an error. Kernel reacted with
>> printk(). You are removing that printk(). I can understand that,
>> printk is really annoying, but I really believe _some_ error handling
>> should be added there if you remove the printk.
>
>What do you suggest?

I would say print it once a day, or even less, e.g. once per boot.

>Having a TP 380XD which regularly produces this annoying message,
>it's just logspam. There's no noticable failure.


Jan Engelhardt
--

2005-10-28 21:21:51

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On Friday 28 October 2005 22:59, Russell King wrote:
> On Fri, Oct 28, 2005 at 10:51:32PM +0200, Pavel Machek wrote:
> > Well, keyboard detected and reported an error. Kernel reacted with
> > printk(). You are removing that printk(). I can understand that,
> > printk is really annoying, but I really believe _some_ error handling
> > should be added there if you remove the printk.
>
> What do you suggest?

Obviously it needs an DBUS over netlink interface with an user space daemon to open
a window on the desktop. Then the user needs to click ok to make sure they
understood they did something wrong (either by buying broken hardware or by simply
typing).

You get bonus points when that window first opens another window with a "Did you
know ..." message with a little dancing pink penguin that gives you helpful tips
regarding typing on keyboards and offers you links to buy new keyboards on the web.

Wouldn't that be great?

-Andi

2005-10-28 21:23:43

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

Hi!

> > Well, keyboard detected and reported an error. Kernel reacted with
> > printk(). You are removing that printk(). I can understand that,
> > printk is really annoying, but I really believe _some_ error handling
> > should be added there if you remove the printk.
>
> What do you suggest?

Well, having error counter for each input device would probably be
enough. Or perhaps add some rate-limiting. One message per boot should
be adequate.

> Having a TP 380XD which regularly produces this annoying message,
> it's just logspam. There's no noticable failure.

I do notice lost keys on x32 here. You need to press some weird
combination...
Pavel
--
Thanks, Sharp!

2005-10-28 21:37:09

by Russell King

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On Fri, Oct 28, 2005 at 11:23:05PM +0200, Pavel Machek wrote:
> > Having a TP 380XD which regularly produces this annoying message,
> > it's just logspam. There's no noticable failure.
>
> I do notice lost keys on x32 here. You need to press some weird
> combination...

I don't need any weird combinations to produce this message - it
appears quite often when hitting keys to wake it up from sleep
mode (which it has an eager desire to be in when it's used in
text-only mode.)

> > What do you suggest?
>
> Well, having error counter for each input device would probably be
> enough. Or perhaps add some rate-limiting. One message per boot should
> be adequate.

$ dmesg |grep 'too many' | wc -l
72

I don't care how many occur or even that they do occur. That's not
to say someone else doesn't. But if there is someone else who does
care, maybe they should speak up and produce a patch to add whatever
/they/ /do/ require.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core

2005-10-28 21:40:14

by Russell King

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On Fri, Oct 28, 2005 at 11:22:15PM +0200, Andi Kleen wrote:
> On Friday 28 October 2005 22:59, Russell King wrote:
> > On Fri, Oct 28, 2005 at 10:51:32PM +0200, Pavel Machek wrote:
> > > Well, keyboard detected and reported an error. Kernel reacted with
> > > printk(). You are removing that printk(). I can understand that,
> > > printk is really annoying, but I really believe _some_ error handling
> > > should be added there if you remove the printk.
> >
> > What do you suggest?
>
> Obviously it needs an DBUS over netlink interface with an user space daemon to open
> a window on the desktop. Then the user needs to click ok to make sure they
> understood they did something wrong (either by buying broken hardware or by simply
> typing).
>
> You get bonus points when that window first opens another window with a "Did you
> know ..." message with a little dancing pink penguin that gives you helpful tips
> regarding typing on keyboards and offers you links to buy new keyboards on the web.
>
> Wouldn't that be great?

Sounds like too much hastle. I heard an alternative suggestion somewhere
which I liked much better <evil grin>.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core

2005-10-28 22:18:28

by Bodo Eggert

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

Pavel Machek <[email protected]> wrote:

> Well, keyboard detected and reported an error. Kernel reacted with
> printk(). You are removing that printk(). I can understand that,
> printk is really annoying, but I really believe _some_ error handling
> should be added there if you remove the printk.

I once posted a printk that would only actually print if the last printk
wasn't the same message. This would ensure error reporting while preventing
dmesg from being spammed. Off cause this would fail if two subsystems are
competing to annoy you.
--
Ich danke GMX daf?r, die Verwendung meiner Adressen mittels per SPF
verbreiteten L?gen zu sabotieren.

2005-10-28 22:41:08

by Jon Masters

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On 10/28/05, Andi Kleen <[email protected]> wrote:
> On Friday 28 October 2005 22:59, Russell King wrote:
> > On Fri, Oct 28, 2005 at 10:51:32PM +0200, Pavel Machek wrote:
> > > Well, keyboard detected and reported an error. Kernel reacted with
> > > printk(). You are removing that printk(). I can understand that,
> > > printk is really annoying, but I really believe _some_ error handling
> > > should be added there if you remove the printk.
> >
> > What do you suggest?
>
> Obviously it needs an DBUS over netlink interface with an user space daemon to open
> a window on the desktop. Then the user needs to click ok to make sure they
> understood they did something wrong (either by buying broken hardware or by simply
> typing).

But just in case the mouse is also broken, this should broadcast out
on the local network and popup windows on every other Linux box we can
find within 50 miles.

> You get bonus points when that window first opens another window with a "Did you
> know ..." message with a little dancing pink penguin that gives you helpful tips
> regarding typing on keyboards and offers you links to buy new keyboards on the web.

> Wouldn't that be great?

Where does sysfs fit into this plan? :P

Jon.

2005-10-29 15:36:13

by Ingo Oeser

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On Friday 28 October 2005 22:43, Lee Revell wrote:
> Plus keyboards are a dime a dozen these days, they give you one with
> every server whether or not you want it. If you have rack full of 1U
> servers the pile of keyboards will be as high as the rack. I wish our
> KVM vendor would come haul them away.

My employer sells servers and neither includes keyboards nor
monitors nor mouses. These are extras, since my employer considers
servers "unattended machines" and you either have a KVM switch or
can rip a KVM-set off some work station, if you have a hardware failure.

If you don't have a KVM set at hand, our service team brings it in.

So you just need to change to a sane vendor and can exclude that kind
of costs[1] in the next contract.

Regards

Ingo Oeser

[1] Just consider the deposit and recycling costs, maintence costs,
storage space costs, inventory costs and so on. This all adds
up dime by dime for a good amount of servers.


Attachments:
(No filename) (958.00 B)
(No filename) (189.00 B)
Download all attachments

2005-10-29 15:40:15

by Ingo Oeser

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

On Friday 28 October 2005 23:23, Pavel Machek wrote:
> I do notice lost keys on x32 here. You need to press some weird
> combination...

So just tell the message, if !strcmp(current->comm,'emacs') :-)

Regards

Ingo Oeser


Attachments:
(No filename) (223.00 B)
(No filename) (189.00 B)
Download all attachments

2005-10-30 12:39:54

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] Disable the most annoying printk in the kernel

Hi!

> > Well, keyboard detected and reported an error. Kernel reacted with
> > printk(). You are removing that printk(). I can understand that,
> > printk is really annoying, but I really believe _some_ error handling
> > should be added there if you remove the printk.
>
> What do you suggest?

Second possibility would be to create "error" event, and send it to userspace.
Userspace would probably ignore it, but that's okay. At least it
has chance to do the right thing.
(AKA dbus event, and nice, friendly "do not panic" message ;-)
--
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms