ice_read_flat_nvm(9)
π ice_read_flat_nvm(9) π
okay so bestie, buckle up β this is a page from the Kernel API Manual and it's about ice_read_flat_nvm, which is genuinely one of those functions that looks scary but is actually serving. Let's get into it β¨
π NAME π
ice_read_flat_nvm β read a portion of NVM by flat offset. that's it, that's the vibe π
β¨ SYNOPSIS β¨
int ice_read_flat_nvm (struct ice_hw *hw , u32 offset , u32 *length , u8
*data , bool read_shadow_ram , enum libie_aq_err *read_aq_err );
like, six arguments. she's high-maintenance but worth it π«Ά
πΈ ARGUMENTS πΈ
hwβ pointer to the HW struct. the whole hardware situation lives here πoffsetβ offset from beginning of NVM. where you're starting from, bestie πlengthβ (in) number of bytes to read; (out) number of bytes actually read. she's a two-way street, lowkey iconic πdataβ buffer to return data in (sized to fit the specified length). pls size her correctly or it's giving chaos πread_shadow_ramβ if true, read from shadow RAM instead of NVM. shadow RAM said "let me be the main character" πread_aq_errβ if non-NULL, receives the AQ error status of the failing read. if you pass NULL she simply won't tell you, that's the deal π
π¦ DESCRIPTION π¦
So basically: this function reads a portion of the NVM, treating it as a flat memory space. no cap. and the way that she does it is actually so smart β she correctly breaks read requests across Shadow RAM sectors and makes sure that no single read request exceeds the maximum 4KB read for a single AdminQ command. organization? immaculate. π§
now for the spicy part πΆοΈ β FW caps the read lock at a maximum of 3000ms, so a read spanning multiple 4KB sectors legit cannot be done under a single lock without FW reclaiming it mid-read. rude, but okay. so the NVM lock is therefore acquired and released around each AQ read, which means this function must be called without the lock held. i cannot stress this enough bestie, do not hold the lock π ββοΈ
β οΈ also important: sinceice_release_nvmissues an AQ command that overwriteshw->adminq.sq_last_status, callers that need the failing read's AQ error must useread_aq_errrather than inspectingsq_last_statusafterwards. the status you want is gone by then, fr fr π
she returns a status code on failure. and heads up β the data pointer may be partially updated if some reads succeed before a failure. so like, no, you don't get a clean slate on error. tragic but true π
π SEE ALSO π
kernel file ./drivers/net/ethernet/intel/ice/ice_nvm.c β go read the source, it slays β¨
and the whole friend group:
ice_aq_read_nvm(9), ice_aq_update_nvm(9), ice_aq_erase_nvm(9), ice_read_sr_word(9), ice_acquire_nvm(9), ice_release_nvm(9), ice_get_flash_bank_offset(9), ice_read_flash_module(9), ice_read_nvm_module(9), ice_read_nvm_sr_copy(9), ice_read_netlist_module(9), ice_get_pfa_module_tlv(9), ice_read_pba_string(9), ice_get_nvm_ver_info(9), ice_get_inactive_nvm_ver(9), ice_get_orom_civd_data(9), ice_get_orom_ver_info(9), ice_get_inactive_orom_ver(9), ice_get_netlist_info(9), ice_get_inactive_netlist_ver(9), ice_discover_flash_size(9), ice_read_sr_pointer(9), ice_read_sr_area_size(9), ice_determine_active_flash_banks(9), ice_get_nvm_css_hdr_len(9), ice_determine_css_hdr_len(9), ice_init_nvm(9), ice_nvm_validate_checksum(9), ice_nvm_write_activate(9), ice_aq_nvm_update_empr(9)
like genuinely every single one, i'm not skipping a single bestie π«Ά
and that's the page!! this one's from ./drivers/net/ethernet/intel/ice, dated October 2026, and it's a ice_read_flat_nvm(9) kind of moment. mwah, go forth and don't hold that lock ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms