public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Suppressing softrepeat
@ 2006-02-21 20:43 Pete Zaitcev
  2006-02-21 21:08 ` Vojtech Pavlik
  2006-02-21 21:15 ` Dmitry Torokhov
  0 siblings, 2 replies; 14+ messages in thread
From: Pete Zaitcev @ 2006-02-21 20:43 UTC (permalink / raw)
  To: dtor_core; +Cc: zaitcev, linux-kernel, vojtech, stuart_hayes

Add the "nosoftrepeat" parameter. This is useful if a "dumb" keyboard
has (unswitcheable) hardware repeat, like in Dell DRAC3.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>

---

Hi, Dmitry,

Dell people passed on a request to add a new parameter, "nosoftrepeat",
to i8042 (in atkbd.c). So, if I understand right, things should work so:

 - None set in grub.conf: Softrepeat is set by the driver as detected
   or derived. This is the default.
 - "softrepeat" set: Softrepeat is on, regardless
 - "nosoftrepeat" set: Softrepeat is off, regardless
 - Both "softrepeat" and "nosoftrepeat" are set: Do not do that.

The code looked confusing, but there is an good explanation in this bug:
 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=181457

In short words, DRAC3 "plugs into" the keyboard connector, but does not
emulate output, so we detect this as "dumb" keyboard and enable softrepeat.
But softrepeat causes double keypresses.

I suppose we could revamp the old softrepeat parameter to be more than
a boolean, but I see no point.

If you agree, please include the attached.

-- Pete

--- linux-2.6.16-rc2/drivers/input/keyboard/atkbd.c	2006-02-11 00:31:41.000000000 -0800
+++ linux-2.6.16-rc2-lem/drivers/input/keyboard/atkbd.c	2006-02-21 11:53:53.000000000 -0800
@@ -50,6 +50,10 @@ static int atkbd_softrepeat;
 module_param_named(softrepeat, atkbd_softrepeat, bool, 0);
 MODULE_PARM_DESC(softrepeat, "Use software keyboard repeat");
 
+static int atkbd_nosoftrepeat;
+module_param_named(nosoftrepeat, atkbd_nosoftrepeat, bool, 0);
+MODULE_PARM_DESC(nosoftrepeat, "Do not use software keyboard repeat");
+
 static int atkbd_softraw = 1;
 module_param_named(softraw, atkbd_softraw, bool, 0);
 MODULE_PARM_DESC(softraw, "Use software generated rawmode");
@@ -862,7 +866,7 @@ static int atkbd_connect(struct serio *s
 	atkbd->softrepeat = atkbd_softrepeat;
 	atkbd->scroll = atkbd_scroll;
 
-	if (!atkbd->write)
+	if (!atkbd->write && !atkbd_nosoftrepeat)
 		atkbd->softrepeat = 1;
 
 	if (atkbd->softrepeat)

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: Suppressing softrepeat
@ 2006-02-22 20:46 Stuart_Hayes
  0 siblings, 0 replies; 14+ messages in thread
From: Stuart_Hayes @ 2006-02-22 20:46 UTC (permalink / raw)
  To: vojtech, zaitcev; +Cc: dtor_core, linux-kernel

Vojtech Pavlik wrote:
> On Wed, Feb 22, 2006 at 12:00:47PM -0800, Pete Zaitcev wrote:
>> On Tue, 21 Feb 2006 22:08:00 +0100, Vojtech Pavlik <vojtech@suse.cz>
>> wrote: 
>> 
>>> A much simpler workaround for the DRAC3 is to set the softrepeat
>>> delay to at least 750ms, using kbdrate(8), which will call the
>>> proper console ioctl, resulting in updating the softrepeat
>>> parameters. 
>>> 
>>> I prefer workarounds for problematic hardware done outside the
>>> kernel, if possible.
>> 
>> I agree with the sentiment when posed in the abstract way, but let me
>> tell you why this case is different.
>> 
>> Firstly, there's nothing "problematic" about this. It's just how it
>> is. The only problematic thing here is our code. Currently, the
>> situation 
>> is assymetric. It is possible to force softrepeat on, but not
>> possible 
>> to force softrepeat off. Isn't it broken?
>> 
>> Secondly, 750ms may be not enough. Stuart is being shy here and
>> posting explanations to Bugzilla for some reason.
>> 
>> Lastly, it's such a PITA to add these things into the userland, that
>> it's completely impractical. Console is needed the most when things
>> go wrong. In such case, that echo(1) may not be reached before the
>> single user shell. And stuffing it into the initrd is for Linux
>> weenies only, unless automated by mkinitrd. 
>> 
>> I think you're being unreasonable here. I am not asking for NFS root
>> or IP autoconfiguration and sort of complicated process which ought
>> to 
>> be done in userland indeed.
> 
> I'm definitely not intending to be unreasonable, and I understand
> your need to have the keyboard working all the way from the grub/lilo
> prompt.  
> 
> I just don't like adding more module options to one that already has
> so many it's hard to understand what they're used for. 
> 
> How about simply this patch instead?
> 
> Setting autorepeat will not be possible on 'dumb' keyboards anymore
> by default, but since these usually are special forms of hardware
> anyway, like the DRAC3, this shouldn't be an issue for most users.
> Using 'softrepeat' on these keyboards will restore the behavior for
> users that need it.    
> 
> diff --git a/drivers/input/keyboard/atkbd.c
> b/drivers/input/keyboard/atkbd.c --- a/drivers/input/keyboard/atkbd.c
> +++ b/drivers/input/keyboard/atkbd.c
> @@ -863,9 +863,6 @@ static int atkbd_connect(struct serio *s
>  	atkbd->softrepeat = atkbd_softrepeat;
>  	atkbd->scroll = atkbd_scroll;
> 
> -	if (!atkbd->write)
> -		atkbd->softrepeat = 1;
> -
>  	if (atkbd->softrepeat)
>  		atkbd->softraw = 1;

That seems reasonable to me, and would fix the issue with the DRAC3.

Shyly,
Stuart

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-02-22 22:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-21 20:43 Suppressing softrepeat Pete Zaitcev
2006-02-21 21:08 ` Vojtech Pavlik
2006-02-21 21:32   ` Dmitry Torokhov
2006-02-21 21:40     ` Vojtech Pavlik
2006-02-21 21:57       ` Dmitry Torokhov
2006-02-22 20:00   ` Pete Zaitcev
2006-02-22 20:40     ` Vojtech Pavlik
2006-02-22 21:09       ` Dmitry Torokhov
2006-02-22 22:09         ` Vojtech Pavlik
2006-02-22 22:13           ` Dmitry Torokhov
2006-02-22 21:16       ` Pete Zaitcev
2006-02-21 21:15 ` Dmitry Torokhov
2006-02-21 21:35   ` Vojtech Pavlik
  -- strict thread matches above, loose matches on Subject: below --
2006-02-22 20:46 Stuart_Hayes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox