-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split ServerImpl
versus FlashDriver
, add FailServer
#1852
Conversation
47a8f59
to
e99cc3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems good to me! I had a couple smallish notes, but nothing major.
/// Failure function, running an Idol response loop that always returns an error | ||
fn fail(err: drv_hf_api::HfError) { | ||
let mut buffer = [0; hf::idl::INCOMING_SIZE]; | ||
let mut server = hf::FailServer { err }; | ||
loop { | ||
idol_runtime::dispatch(&mut buffer, &mut server); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice approach to having a driver go into "failure mode" when hardware can't be initialized, I wonder if we might want to do something similar in e.g. gimlet_seq
, here:
hubris/drv/gimlet-seq-server/src/main.rs
Lines 159 to 176 in 6990578
// Initializing the sequencer failed. | |
Err(_) => { | |
// Tell everyone that something's broken, as loudly as possible. | |
ringbuf_entry!(Trace::StartFailed(SeqError::I2cFault)); | |
// Leave FAULT_PIN_L low (which is done at the start of init) | |
// All these moments will be lost in time, like tears in rain... | |
// Time to die. | |
loop { | |
// Sleeping with all bits in the notification mask clear means | |
// we should never be notified --- and if one never wakes up, | |
// the difference between sleeping and dying seems kind of | |
// irrelevant. But, `rustc` doesn't realize that this should | |
// never return, we'll stick it in a `loop` anyway so the main | |
// function can return `!` | |
sys_recv_notification(0); | |
} | |
} |
rather than just waiting for a non-existent notification?
Obviously not something to do in this PR, but could be nice to do later.
67c3883
to
b9ae084
Compare
cd00656
to
d4adadd
Compare
3f54152
to
d4c3ffc
Compare
5892fa3
to
e3dcb40
Compare
d4c3ffc
to
c468dc5
Compare
e3dcb40
to
9967a30
Compare
c468dc5
to
5029453
Compare
5029453
to
05dc04b
Compare
Staged on top of #1852 Unlike Gimlet, Cosmo / Grapefruit only has a single 128 MiB flash chip. This PR allows us to treat it as two virtual 64 MiB devices, preserving the existing `HostFlash` API semantics. --------- Co-authored-by: Nathanael Huffman <nathanael@oxidecomputer.com>
Staged on top of #1851
This PR splits the FMC NOR flash into
FlashDriver
(talking to the FPGA and flash) andServerImpl
(implementing theHostFlash
API). In addition, it adds a non-panicking failure path. In this new failure path, there's a small Idol server which replies with an error to any message.