﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	field_blocks	field_dependson	field_seealso
856	XHCI driver does not start reliably on amd64	Colin Parker		"When starting the XHCI driver, there appears to be a race condition that prevents it from starting in some cases. Steps to reproduce:

Configure HelenOS for amd64 with UEFI and SMP.

Launch QEMU with UEFI firmware (EDK2):
qemu-system-x86_64 -enable-kvm --bios OVMF.fd -drive file=hdisk.img,index=0,media=disk,format=raw -device e1000 -device qemu-xhci,id=xhci -device usb-mouse -device usb-kbd -device intel-hda -device hda-duplex -serial mon:stdio -boot d -cdrom image.iso

OVMF.fd is the firmware description from EDK2 build.

The symptom will be that although you can use the mouse (it falls back to PS2 mouse), the usb-kbd will be inoperable and you can't type. You will see xhci does not register the devices, but does not report an error either.

The issue is sensitive to timing or sequencing, and does not happen in all cases. To try to trigger it, it helps to add ""fibril_usleep(10000);"" to line 357 (at the bottom of xhci_event_ring_init, before ""fibril_mutex_initialize(&ring->guard);"") of trb_ring.c in the xhci driver code. I use values around 10000 or so and it usually causes the issue but you might need to try 50000, 100000, etc, although if you set it too long it might start working again. Note that changing the log warning level to get debug information will also alter timing, so it is challenging to investigate.

This problem can also be triggered on Mac Mini hardware, although in that case there is no PS2 fallback.

"	defect	new	major	0.16.1	helenos/drv/other	mainline		xhci				
