From 5803f4c6f23add7078302e58a1fd288d4249dd83 Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Sun, 19 Jul 2026 11:39:44 +0900 Subject: [PATCH] xhcid: info-level attach_device milestone traces (diagnostic) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- drivers/usb/xhcid/src/xhci/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/xhcid/src/xhci/mod.rs b/drivers/usb/xhcid/src/xhci/mod.rs index 71eca86f7e..9f8b39d74b 100644 --- a/drivers/usb/xhcid/src/xhci/mod.rs +++ b/drivers/usb/xhcid/src/xhci/mod.rs @@ -1141,6 +1141,7 @@ impl Xhci { } 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 Xhci { }; 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 Xhci { }; debug!("Addressed device"); + log::info!("ATTACH {}: addressed", port_id); // TODO: Should the descriptors be cached in PortState, or refetched? @@ -1280,9 +1283,11 @@ impl Xhci { } 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 Xhci { 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) }