Skip to content

Commit

Permalink
nvme: log controller enable/disable
Browse files Browse the repository at this point in the history
  • Loading branch information
luqmana committed Dec 4, 2023
1 parent 9194fe8 commit 71e2b5b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/propolis/src/hw/nvme/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,8 @@ impl PciNvme {

let cur = state.ctrl.cc;
if new.enabled() && !cur.enabled() {
slog::info!(self.log, "Enabling controller");

let mem = self.mem_access();
let mem = mem.ok_or(NvmeError::MemoryInaccessible)?;

Expand All @@ -633,6 +635,8 @@ impl PciNvme {
state.ctrl.csts.set_ready(true);
}
} else if !new.enabled() && cur.enabled() {
slog::info!(self.log, "Disabling controller");

// Reset controller state which will set CC.EN=0 and CSTS.RDY=0
state.reset();
}
Expand Down

0 comments on commit 71e2b5b

Please sign in to comment.