Files
RedBear-OS/local/recipes/system/driver-manager
vasilito 452d738eb9 driver-manager: detach AER reset_device recovery to background worker (N18 S3)
Three changes in scheme.rs:

- Add `self_weak: Mutex<Option<Weak<DriverManagerScheme>>>` field
  to the `DriverManagerScheme` struct (cfg-gated on redox, the
  same pattern as the existing `handles`/`modalias_results`
  fields).

- Add `set_self_weak` method that stores a `Weak`
  self-reference; main.rs calls it with
  `Arc::downgrade(&scheme)` after `set_manager`.

- Replace the `reset_device` arm of `dispatch_recovery`
  with a detached worker that captures the manager Arc + the
  scheme Weak, runs `remove_device` → `sleep 100 ms` →
  `bind_device` on the worker thread, and notifies the
  scheme of the rebind events via `self_weak.upgrade()`. The
  scheme server thread is no longer blocked for 100 ms during
  recovery; the endpoint stays responsive.

Includes a warning if `self_weak` is unset, the manager
isn't set, or the worker thread fails to launch (graceful
no-op rather than panic).
2026-07-27 21:58:38 +09:00
..