From 99898bba6214bcd4c5858521418e8ae7993fecf3 Mon Sep 17 00:00:00 2001 From: Matthew Jackson <1085847+MattJackson@users.noreply.github.com> Date: Sun, 27 Sep 2026 23:52:00 -0700 Subject: [PATCH] feat(stop): the post-upload readiness poll waits via pause MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WallClock's wait between TEST UNIT READY polls is now the transport's cancellable pause (stop-design-v5 §2.3), so a Stop during the poll ends it at once. The refusal is the dead-bus shape; libfreemkv's Drive::init reclassifies it as Halted (ST-L2). --- src/ld/platform/mt1959/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ld/platform/mt1959/mod.rs b/src/ld/platform/mt1959/mod.rs index 2d90c2c..5d9096a 100644 --- a/src/ld/platform/mt1959/mod.rs +++ b/src/ld/platform/mt1959/mod.rs @@ -518,7 +518,8 @@ fn ready_clock() -> Box { Box::new(WallClock::start()) } -/// The production clock: real time, a plain sleep between polls. +/// The production clock: real time, and the transport's cancellable `pause` +/// between polls (stop-design-v5 §2.3), so a Stop ends the wait at once. struct WallClock(std::time::Instant); impl WallClock { @@ -531,9 +532,8 @@ impl ReadyClock for WallClock { fn elapsed(&self) -> Duration { self.0.elapsed() } - fn wait(&mut self, _scsi: &mut dyn ScsiTransport, d: Duration) -> scsi::Result<()> { - std::thread::sleep(d); - Ok(()) + fn wait(&mut self, scsi: &mut dyn ScsiTransport, d: Duration) -> scsi::Result<()> { + scsi.pause(d) } }