Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

DDB not working with USB keyboard at xhci port



When ukbd(4) is a console and connected to USB3 port, you can enter
into DDB by pressing ALT+CTRL+ESC but console freezes.
(on HEAD, netbsd-7, netbsd-8)

xhci has two buses, sc->sc_bus is for usb3 and sc->sc_bus2 is for
usb2.  ukbd is usually connected at Low-Speed, so usbd_set_polling
sets sc->sc_bus2->ub_usepolling.
However, xhci.c checks only sc->sc_bus->ub_usepolling, that's why
xhci_poll does not call xhci_softintr.

I can show a quick dirty patch.
It assumes ub_usepolling is always set by ukbd at LS/FS/HS.

--- sys/dev/usb/xhci.c 2017-06-02 00:27:49
+++ sys/dev/usb/xhci.c 2017-08-16 08:12:00
@@ -1270,6 +1270,7 @@ xhci_intr1(struct xhci_softc * const sc)
  usbsts = xhci_op_read_4(sc, XHCI_USBSTS);
  DPRINTFN(16, "USBSTS %08x", usbsts, 0, 0, 0);

+ sc->sc_bus.ub_usepolling = sc->sc_bus2.ub_usepolling;
  usb_schedsoftintr(&sc->sc_bus);

  return 1;
@@ -2106,6 +2107,7 @@ xhci_softintr(void *v)

  XHCIHIST_FUNC(); XHCIHIST_CALLED();

+ sc->sc_bus.ub_usepolling = sc->sc_bus2.ub_usepolling;
  KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(&sc->sc_lock));

  i = er->xr_ep;


Home | Main Index | Thread Index | Old Index