usb: demote diagnostic ATTACH/HUBFLOW traces to debug!

The diagnostic milestones used to root-cause the intermittent boot
'freeze' (attach_device milestones, usbhubd HUBFLOW decision points,
reactor/enumerator startup) moved from info to debug! so production
logs stay clean. One-line-per-boot startup confirmations (scheme
registered, daemon ready, reactor started, enumerator started, reactor
dispatch mode, enumerator running) remain at info as genuinely useful
low-volume startup evidence.
This commit is contained in:
Red Bear OS
2026-07-19 23:01:48 +09:00
parent 5a709b0f43
commit a8e1ddc913
4 changed files with 14 additions and 14 deletions
+4 -4
View File
@@ -349,7 +349,7 @@ fn main() {
if attached {
match self.handle.attach() {
Ok(()) => {
log::info!("HUBFLOW {}: attach() ok", self.port_id);
log::debug!("HUBFLOW {}: attach() ok", self.port_id);
}
Err(e) => {
log::warn!("usbhubd: attach failed for port {}: {}", self.port_id, e);
@@ -575,7 +575,7 @@ fn main() {
state.ensure_attached(false);
continue;
}
log::info!("HUBFLOW {}: debounced conn={} en={} att={}", port, snap.connected, snap.enabled, state.attached);
log::debug!("HUBFLOW {}: debounced conn={} en={} att={}", port, snap.connected, snap.enabled, state.attached);
}
// Ensure port is enabled.
@@ -586,7 +586,7 @@ fn main() {
if !snap.enabled {
log::info!("reset port {port}");
match set_feature(&handle, port, usb::HubPortFeature::PortReset) {
Ok(()) => log::info!("HUBFLOW {port}: PortReset set ok"),
Ok(()) => log::debug!("HUBFLOW {port}: PortReset set ok"),
Err(e) => {
log::warn!("usbhubd: SetPortReset failed for port {}: {}", port, e);
continue;
@@ -609,7 +609,7 @@ fn main() {
}
let was_attached = state.attached;
log::info!("HUBFLOW {}: pre-attach conn={} en={} rst={} att={}", port, snap.connected, snap.enabled, snap.resetting, state.attached);
log::debug!("HUBFLOW {}: pre-attach conn={} en={} rst={} att={}", port, snap.connected, snap.enabled, snap.resetting, state.attached);
state.ensure_attached(true);
if !was_attached && state.attached {
// The connection-change bit was ignored during the debounce
+3 -3
View File
@@ -183,21 +183,21 @@ pub fn wait_for_reset<E>(
let mut delay = HUB_SHORT_RESET_TIME_MS;
let mut cur = fetch().map_err(WaitError::Io)?;
log::info!("HUBFLOW wait_for_reset: first fetch resetting={} connected={}", cur.resetting, cur.connected);
log::debug!("HUBFLOW wait_for_reset: first fetch resetting={} connected={}", cur.resetting, cur.connected);
loop {
if !cur.resetting && cur.connected {
sleep(RESET_RECOVERY_TIME_MS);
if cur.reset_changed {
clear_reset_change().map_err(WaitError::Io)?;
}
log::info!("HUBFLOW wait_for_reset: complete after {}ms", total_ms);
log::debug!("HUBFLOW wait_for_reset: complete after {}ms", total_ms);
return Ok(cur);
}
if !cur.connected {
return Err(WaitError::Disconnected);
}
if total_ms >= HUB_RESET_TIMEOUT_MS {
log::info!("HUBFLOW wait_for_reset: timeout, still resetting={}", cur.resetting);
log::debug!("HUBFLOW wait_for_reset: timeout, still resetting={}", cur.resetting);
return Err(WaitError::Timeout);
}
sleep(delay);
@@ -33,7 +33,7 @@ impl<const N: usize> DeviceEnumerator<N> {
return;
}
};
log::info!("ENUMERATOR: request for port {}", request.port_id);
debug!("ENUMERATOR: request for port {}", request.port_id);
let port_id = request.port_id;
let port_array_index = match port_id.root_hub_port_index() {
+6 -6
View File
@@ -1141,7 +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);
debug!("ATTACH {}: begin", port_id);
if self.port_states.contains_key(&port_id) {
debug!("Already contains port {}", port_id);
return Err(syscall::Error::new(EAGAIN));
@@ -1204,7 +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);
debug!("ATTACH {}: slot {}", port_id, slot);
//TODO: get correct speed for child devices
let protocol_speed = self
@@ -1226,7 +1226,7 @@ impl<const N: usize> Xhci<N> {
};
debug!("Addressed device");
log::info!("ATTACH {}: addressed", port_id);
debug!("ATTACH {}: addressed", port_id);
// TODO: Should the descriptors be cached in PortState, or refetched?
@@ -1283,11 +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);
debug!("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);
debug!("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!");
@@ -1306,7 +1306,7 @@ impl<const N: usize> Xhci<N> {
match self.spawn_drivers(port_id) {
Ok(()) => {
log::info!("ATTACH {}: drivers spawned", port_id);
debug!("ATTACH {}: drivers spawned", port_id);
()
},
Err(err) => {