STRUCT NAND_ECC(9)
β¨ struct nand_ecc(9) β¨
okay bestie, so this page is from the Kernel API Manual and it's all about struct nand_ecc, which is literally the main character of ECC info. like, it holds all the vibes for error correction on NAND chips π
This struct is where the kernel keeps track of how to do ECC β and honestly, it's giving "organized bestie who has her life together" energy. no cap.
π¦ SYNOPSIS π¦
struct nand_ecc {
struct nand_ecc_props defaults;
struct nand_ecc_props requirements;
struct nand_ecc_props user_conf;
struct nand_ecc_context ctx;
struct nand_ecc_engine *ondie_engine;
struct nand_ecc_engine *engine;
};
πΈ Members πΈ
so, like, here's the breakdown of every single member, no skipping bestie π
defaultsβ these are the default values, and tbh they depend on the underlying subsystem. it's giving "factory settings" energy.requirementsβ the ECC requirements from the NAND chip's perspective, iykyk. the chip has opinions and this is where they live.user_confβ what the user actually desires in terms of ECC parameters. like, this is what you want. main character choices only πctxβ the ECC context for the ECC engine, and here's the tea: it's derived from the device requirements, theuser_confand thedefaults. so it's like the final form that ate all the other info β¨ondie_engineβ an On-die ECC engine reference, if any. so if there's one, it's here. if not, she's not invited to the party πengineβ the ECC engine that's actually bound. like, the one who actually showed up and is doing the work. slay.
π SEE ALSO π
if you're curious and wanna go down a rabbit hole, check out the Kernel file ./include/linux/mtd/nand.h and these structs/functions bestie:
struct nand_memory_organization(9), struct nand_row_converter(9), struct nand_pos(9), enum nand_page_io_req_type(9), struct nand_page_io_req(9), enum nand_ecc_engine_type(9), enum nand_ecc_placement(9), enum nand_ecc_algo(9), struct nand_ecc_props(9), struct nand_bbt(9), struct nand_ops(9), struct nand_ecc_context(9), struct nand_ecc_engine_ops(9), enum nand_ecc_engine_integration(9), struct nand_ecc_engine(9), struct nand_ecc_req_tweak_ctx(9), struct nand_device(9), struct nand_io_iter(9), mtd_to_nanddev(9), nanddev_to_mtd(9), nanddev_page_size(9), nanddev_per_page_oobsize(9), nanddev_pages_per_eraseblock(9), nanddev_pages_per_target(9), nanddev_eraseblocks_per_lun(9), nanddev_eraseblocks_per_target(9), nanddev_target_size(9), nanddev_neraseblocks(9), nanddev_size(9), nanddev_get_memorg(9), nanddev_get_ecc_conf(9), nanddev_get_ecc_nsteps(9), nanddev_get_ecc_bytes_per_step(9), nanddev_get_ecc_requirements(9), nanddev_set_ecc_requirements(9), nanddev_register(9), nanddev_unregister(9), nanddev_set_of_node(9), nanddev_get_of_node(9), nanddev_offs_to_pos(9), nanddev_pos_cmp(9), nanddev_pos_to_offs(9), nanddev_pos_to_row(9), nanddev_pos_next_target(9), nanddev_pos_next_lun(9), nanddev_pos_next_eraseblock(9), nanddev_pos_next_page(9), nanddev_bbt_pos_to_entry(9), nanddev_bbt_is_initialized(9).
okay that's the whole page bestie, you understood it perfectly fr fr π
stay sparkly β this was pulled from the kernel files in ./include/linux/mtd, last updated October 2026, and yeah, that's the struct nand_ecc(9) manual page, periodt. πβ¨π¦
π¦ 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