From 0a48496179b385d0b9a294f9037ad33c3185911b Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Wed, 21 Aug 2024 14:18:20 -0400 Subject: [PATCH] Log hash driver init failure --- drv/cosmo-hf/src/hf.rs | 3 ++- drv/cosmo-hf/src/main.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drv/cosmo-hf/src/hf.rs b/drv/cosmo-hf/src/hf.rs index 5583f1572..d9df4ed49 100644 --- a/drv/cosmo-hf/src/hf.rs +++ b/drv/cosmo-hf/src/hf.rs @@ -148,7 +148,8 @@ impl idl::InOrderHostFlashImpl for ServerImpl { len: u32, ) -> Result<[u8; SHA256_SZ], RequestError> { let hash_driver = drv_hash_api::Hash::from(HASH.get_task_id()); - if hash_driver.init_sha256().is_err() { + if let Err(e) = hash_driver.init_sha256() { + ringbuf_entry!(Trace::HashInitError(e)); return Err(HfError::HashError.into()); } let begin = addr as usize; diff --git a/drv/cosmo-hf/src/main.rs b/drv/cosmo-hf/src/main.rs index 09e4f00f2..e5cd64232 100644 --- a/drv/cosmo-hf/src/main.rs +++ b/drv/cosmo-hf/src/main.rs @@ -31,6 +31,7 @@ enum Trace { SectorEraseBusy, WriteBusy, + HashInitError(drv_hash_api::HashError), HashUpdateError(drv_hash_api::HashError), HashFinalizeError(drv_hash_api::HashError), }