Skip to content

Conversation

mkeeter
Copy link
Collaborator

@mkeeter mkeeter commented Feb 7, 2025

hf.bonus_sector_erase(offset)
.map_err(|err| APOBError::EraseFailed { offset, err })?;
} else {
// Read back the page and confirm that it's all empty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this fail if there's a blip in the IPCC path and the host resends an APOB request? (I'm not sure what the expectations are for the offsets the host is providing.)

@mkeeter mkeeter marked this pull request as draft February 7, 2025 17:08
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some mostly kind of annoying nitpicks.

Comment on lines +1079 to +1083
fn apob_write(
hf: &HostFlash,
mut offset: u64,
data: &[u8],
) -> Result<(), ApobError> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we need something in the broader API to discover what the erase size granularity is or at least make sure that we're sending stuff that is page size aligned. This gets to what @jgallagher gets at below. But if the host sent things that wasn't page aligned then we'd erase the entire page because our API is not doing a read-modify-write.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants