xhcid: info-level attach_device milestone traces (diagnostic)

Temporary info-level ATTACH milestones in attach_device (begin, slot,
addressed, desc8, desc-full, drivers spawned) to trace hub-child
enumeration in QEMU — the kbd behind a hub reaches port-enable but
produces no visible outcome at the default log level. Level to be
revisited after the hub-child attach path is diagnosed.
This commit is contained in:
Red Bear OS
2026-07-19 11:39:44 +09:00
parent b16e6ca399
commit 5803f4c6f2
+9 -1
View File
@@ -1141,6 +1141,7 @@ impl<const N: usize> Xhci<N> {
}
pub async fn attach_device(&self, port_id: PortId) -> syscall::Result<()> {
log::info!("ATTACH {}: begin", port_id);
if self.port_states.contains_key(&port_id) {
debug!("Already contains port {}", port_id);
return Err(syscall::Error::new(EAGAIN));
@@ -1203,6 +1204,7 @@ impl<const N: usize> Xhci<N> {
};
debug!("Enabled port {}, which the xHC mapped to {}", port_id, slot);
log::info!("ATTACH {}: slot {}", port_id, slot);
//TODO: get correct speed for child devices
let protocol_speed = self
@@ -1224,6 +1226,7 @@ impl<const N: usize> Xhci<N> {
};
debug!("Addressed device");
log::info!("ATTACH {}: addressed", port_id);
// TODO: Should the descriptors be cached in PortState, or refetched?
@@ -1280,9 +1283,11 @@ impl<const N: usize> Xhci<N> {
}
debug!("Got the 8 byte dev descriptor: {:X?}", dev_desc_8_byte);
log::info!("ATTACH {}: desc8 ok", port_id);
let dev_desc = self.get_desc(port_id, slot).await?;
debug!("Got the full device descriptor!");
log::info!("ATTACH {}: desc full ok", port_id);
self.port_states.get_mut(&port_id).ok_or(Error::new(EBADFD))?.dev_desc = Some(dev_desc);
debug!("Got the port states again!");
@@ -1300,7 +1305,10 @@ impl<const N: usize> Xhci<N> {
debug!("Updated the default control pipe");
match self.spawn_drivers(port_id) {
Ok(()) => (),
Ok(()) => {
log::info!("ATTACH {}: drivers spawned", port_id);
()
},
Err(err) => {
error!("Failed to spawn driver for port {}: `{}`", port_id, err)
}