Bug 195491 - Keyboard stop working after r274861 when kbdmux is disabled in kernel
Summary: Keyboard stop working after r274861 when kbdmux is disabled in kernel
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-29 05:08 UTC by iron.udjin
Modified: 2016-02-25 16:59 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description iron.udjin 2014-11-29 05:08:30 UTC
Hello,

After PR 194718 and commit r274861 keyboard stop working. As I discovered, it happens when kbdmux is disabled in kernel config file. After I uncommented "device	kbdmux" my keyboard started work.

This bug is not critical as we have work-around, but it would be good to recover previous behaviour because usually keyboard multiplexer doesn't need to be present in all configurations.

Thanks
Comment 1 Glen Barber freebsd_committer 2015-07-07 16:11:43 UTC
Is this still an issue after PR 196512 was resolved?
Comment 2 Glen Barber freebsd_committer 2015-07-07 16:13:36 UTC
Sorry, I meant PR 196512.
Comment 3 Luis Mendes 2015-11-25 10:52:51 UTC
This is also affecting me.  I think it affects everybody that tries to disable kbdmux.
I'm setting up a multiseat workstation for a couple of people, so I have to separate the two keyboards.  But when disabling kbdmux, no keyboard is recognized by vt.  And this is preventing me from using the multiseat configuration.
I'm using FreeBSD 10-STABLE with kernel compilation of a few days ago.

I'd be glad to know what is the workaround that is mentioned is last post.
Comment 4 Pierre Guinoiseau 2016-02-25 10:12:10 UTC
Same here on 10.2
Comment 5 Luis Mendes 2016-02-25 15:46:54 UTC
With the help of other knowledgeable people, I've already narrowed the problem to either vt(4) or ukbd(4) as the causes of this problem.


After disabling kbdmux either on /boot/device.hints or in /boot/loader.conf with: hint.kbdmux.0.disabled="1", I cannot type at the prompt login.
Using sc(4), it's possible to type at the login.


The steps I've taken:
1. Have an USB keyboard attached to the motherboard.
   The keyboard is a Logitech K120 with no multimedia keys, just a 105
   key with PT layout.  The keyboard works fine when kbdmux is not
   disabled, and works fine in every other computer/OS.
   No AT keyboard used.
   url of the keyboard: http://www.logitech.com/en-us/product/k120
   I tried with different USB keyboards, the behavior is identical.


2. In /boot/loader.conf, have these lines added:
    ukbd_load="YES"
    hint.kbdmux.0.disabled="1"
    hint.atkbd.0.disabled="1"
    hint.atkbdc.0.disabled="1"

    I tried it with both *atkbd* lines commented in and out and the
    result is the same.


3. In /etc/rc.conf
   Placing either:
      kbdcontrol -k /dev/ukbd0 < /dev/console
   or
      keyboard="/dev/ukbd0"
   Has the same effect.  Can type at the login prompt with sc(4), but not
   with vt(4).


4. After commenting the two atk lines in /boot/loader.conf, what I got
   from:
    # ll /dev/*kbd*
    crw-------  1 root  wheel  0x34 18 Fev 14:34 /dev/atkbd0
    lrwxr-xr-x  1 root  wheel     6 18 Fev 14:34 /dev/kbd0@ -> atkbd0
    lrwxr-xr-x  1 root  wheel     5 18 Fev 14:34 /dev/kbd1@ -> ukbd0
    crw-------  1 root  wheel  0x81 18 Fev 14:34 /dev/ukbd0

    It seems everything is fine here.


5. In /var/log/messages, there are these lines:
   # egrep -i -e 'kbd|keyb' messages
   Feb 18 14:34:58 leao kernel: module_register_init: MOD_LOAD (kbdmux,
   0xffffffff805d4070, 0) error 6
   Feb 18 14:34:58 leao kernel: atkbdc0: <Keyboard controller (i8042)>
   at port 0x60,0x64 on isa0
   Feb 18 14:34:58 leao kernel: atkbd0: <AT Keyboard> irq 1 on atkbdc0
   Feb 18 14:34:58 leao kernel: kbd0 at atkbd0
   Feb 18 14:34:58 leao kernel: atkbd0: [GIANT-LOCKED]
   Feb 18 14:34:58 leao kernel: ukbd0: <USB Keyboard> on usbus0
   Feb 18 14:34:58 leao kernel: kbd1 at ukbd0
   Feb 18 14:34:58 leao kernel: uhid0: <USB Keyboard> on usbus0

   It seems there's an error 6 regarding kbdmux...
   
   But, the person responsible for kbdmux, Maksim Yevmenkin, told me that
   this error is ENXIO which makes sense because kbdmux is disabled.
   To avoid showing de error, one have to do one of:
   remove 'device kbdmux' from kernel config 
   or
   use nodevice

   So, no problem from kbdmux.

6. # dmesg | grep kbd
   module_register_init: MOD_LOAD (kbdmux, 0xffffffff805d4070, 0) error 6
   atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
   atkbd0: <AT Keyboard> irq 1 on atkbdc0
   kbd0 at atkbd0
   atkbd0: [GIANT-LOCKED]
   ukbd0: <USB Keyboard> on usbus0
   kbd1 at ukbd0

   Seems to look fine, too.

7. # kbdcontrol -i < /dev/ukbd0
   kbd1:
       ukbd0, type:generic (0

   This is normal too. ukbd is the default keyboard, i.e. only one
   that is available

8. BIOS has legacy USB enabled.


Conclusion:
   As the same setup allows for typing in sc(4) and not in vt(4), and as
   nothing seems wrong with kbdmux, it must be a vt(4) or ukbd(4) bug.