Re: console: no USB keyboard!

From: Tomoaki AOKI <junchoon_at_dec.sakura.ne.jp>
Date: Sun, 14 Mar 2021 23:10:49 +0900
On Sun, 14 Mar 2021 13:16:53 +0100
"Hartmann, O." <o.hartmann_at_walstatt.org> wrote:

> On Sun, 14 Mar 2021 11:42:13 +0200
> Andriy Gapon <avg_at_FreeBSD.org> wrote:
> 
> > On 13/03/2021 21:01, Hartmann, O. wrote:
> > > Running 14-CURRENT on several boxes (i.e. FreeBSD 14.0-CURRENT #49
> > > main-n245422-cecfaf9bede9: Fri Mar 12 16:08:09 CET 2021 amd64) with custom and/or
> > > GENERIC kernel and USB-only equipment (mouse if available, keyboard).
> > > In multiuser mode, there is no problem using the USB keyboard. On single user console
> > > (for maintenance purposes), no USB keyboard is available. The same is true while
> > > booting and the rc scripts are worked on. Usually, one can hit the enter key and
> > > inserts a newline, this doesn't work anymore until the box is completely up! 
> > > 
> > > I do not know when this problem as been introduced, the very same config is used since
> > > 13-CURRENT in its earlier time and has been modified accordingly, but I can't see
> > > obvios changes which would explain the wrecked behaviour now. 
> > > 
> > > I got aware of this problem, when a small mistake in /etc/fstab rendered a box
> > > unbootable, I had to head for the datacenter and wasn't even capable of interrupting
> > > the stuck system. Checking on other boxes running recent 14-CURRENT revealed the same
> > > problem.
> > > 
> > > The interesting part is, that as long as those boxes are with the loader present (all
> > > boxes are UEFI booting!), the USB keyboard works as expected and I'm able to select
> > > kernel/kernel.old and so on.
> > > 
> > > How to fix this?  
> > 
> > Can't help with fixing the problem, but here's some info.
> > When you are at the loader prompt, BIOS provides emulation of a standard /
> > legacy keyboard for the USB keyboard.  That's why loader can work even though it
> > doesn't know much about USB.
> > When a FreeBSD driver for the USB controller takes over then the BIOS emulation
> > stops.  Until a FreeBSD peripheral driver like ukbd attaches, it's not possible
> > to use the keyboad, unfortunately.  You can check your dmesg to see when that
> > happens.
> > 
> > Personally, I try to avoid "legacy free" solutions and always have a PS/2
> > keyboard (even if it's a really a USB one using PS/2 <-> USB adapter).
> > 
> > Of course, it would be great to reduce the dead window for USB keyboards and I
> > think that it is doable.
> > 
> > 
> 
> Hello,
> 
> thank you very much for the explanation. For usual, I compile all necessary module
> staticlly into the kernel, the USB mouse, massstorage, keyboard. There was a message
> about some changes with uhid/hid, I tried all variants coming to my mind, starting from
> GENERIC up to add-ons statically compiled in. The systems in question I observed this
> the first time are quite old (Z77/IvyBridge era) and do have PS/2 sockets, but others
> (KabyLake) doesn't. Most KVM we use today in the datacenters are VGA/USB based, so there
> is no chance to attach PS/2 equipment :-(
> 
> Kind regards,
> 
> oh 

I usually try these kind of things though /boot/loader.conf whenever
possible.

If you prefer usbhid drivers, add BOTH

  hw.usb.usbhid.enable=1
  usbhid_load="YES"

lines to loader.conf. IIUC, these should not specified
in /etc/sysctl.conf and /etc/rc.conf respectively (it's too late to work
properly). It would automatically pull hidbus.ko in as a dependency.

IIRC, at least for some trackpads are forcibly handled by i2c and don't
work with legacy usb driver (ums).

OTOH, if USB devices are accidentally (non-intended) handled by usbhid
and causing problems, you shoud intentionally add

 hw.usb.usbhid.enable=0

in /boot/loader.conf. This is default, IIRC.

HTH.

-- 
Tomoaki AOKI    <junchoon_at_dec.sakura.ne.jp>
Received on Sun Mar 14 2021 - 13:11:01 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:27 UTC