STRUCT EDAC_MEM_REPAIR_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct edac_mem_repair_ops(9) πŸ’–

okay bestie, welcome to the glow-up guide for struct edac_mem_repair_ops β€” this is a Kernel API Manual page, and it's giving "backstage pass to the memory repair ops table" energy. Every element in here is optional except do_repair and set_hpa/set_dpa, so like… mostly chill, but those three? main character energy, no cap. πŸŽ€


✨ NAME ✨

struct edac_mem_repair_ops β€” memory repair operations (all elements are optional except do_repair, set_hpa/set_dpa)


🌸 SYNOPSIS 🌸

struct edac_mem_repair_ops {
    int (*get_repair_type)(struct device *dev, void *drv_data, const char **type);
    int (*get_persist_mode)(struct device *dev, void *drv_data, bool *persist);
    int (*set_persist_mode)(struct device *dev, void *drv_data, bool persist);
    int (*get_repair_safe_when_in_use)(struct device *dev, void *drv_data, bool *safe);
    int (*get_hpa)(struct device *dev, void *drv_data, u64 *hpa);
    int (*set_hpa)(struct device *dev, void *drv_data, u64 hpa);
    int (*get_min_hpa)(struct device *dev, void *drv_data, u64 *hpa);
    int (*get_max_hpa)(struct device *dev, void *drv_data, u64 *hpa);
    int (*get_dpa)(struct device *dev, void *drv_data, u64 *dpa);
    int (*set_dpa)(struct device *dev, void *drv_data, u64 dpa);
    int (*get_min_dpa)(struct device *dev, void *drv_data, u64 *dpa);
    int (*get_max_dpa)(struct device *dev, void *drv_data, u64 *dpa);
    int (*get_nibble_mask)(struct device *dev, void *drv_data, u32 *val);
    int (*set_nibble_mask)(struct device *dev, void *drv_data, u32 val);
    int (*get_bank_group)(struct device *dev, void *drv_data, u32 *val);
    int (*set_bank_group)(struct device *dev, void *drv_data, u32 val);
    int (*get_bank)(struct device *dev, void *drv_data, u32 *val);
    int (*set_bank)(struct device *dev, void *drv_data, u32 val);
    int (*get_rank)(struct device *dev, void *drv_data, u32 *val);
    int (*set_rank)(struct device *dev, void *drv_data, u32 val);
    int (*get_row)(struct device *dev, void *drv_data, u32 *val);
    int (*set_row)(struct device *dev, void *drv_data, u32 val);
    int (*get_column)(struct device *dev, void *drv_data, u32 *val);
    int (*set_column)(struct device *dev, void *drv_data, u32 val);
    int (*get_channel)(struct device *dev, void *drv_data, u32 *val);
    int (*set_channel)(struct device *dev, void *drv_data, u32 val);
    int (*get_sub_channel)(struct device *dev, void *drv_data, u32 *val);
    int (*set_sub_channel)(struct device *dev, void *drv_data, u32 val);
    int (*do_repair)(struct device *dev, void *drv_data, u32 val);
 };

πŸ¦‹ Members πŸ¦‹

one bullet per lil function pointer, all facts intact, let's go πŸ”₯

πŸ’œ the type + persistence girlies

  • get_repair_type β€” grabs the memory repair type, and it's listed in enum edac_mem_repair_function. lowkey the label-maker of the group πŸ’…
  • get_persist_mode β€” gets the current persist mode. false means Soft repair type (temporary repair), true means Hard memory repair type (permanent repair). she's a simple booleAN icon πŸŽ€
  • set_persist_mode β€” sets the persist mode of the memory repair instance. matching set with her sister above, we love a duo ✨
  • get_repair_safe_when_in_use β€” gets whether memory media is accessible and data is retained during the repair operation. iykyk, this one's the vibe check 🫢

πŸ’– address besties (HPA squad)

  • get_hpa β€” gets the current host physical address (HPA) of the memory to repair.
  • set_hpa β€” sets the host physical address (HPA) of the memory to repair. ⭐
  • get_min_hpa β€” gets the minimum supported host physical address (HPA).
  • get_max_hpa β€” gets the maximum supported host physical address (HPA).

🌈 address besties (DPA squad)

  • get_dpa β€” gets the current device physical address (DPA) of the memory to repair.
  • set_dpa β€” sets the device physical address (DPA) of the memory to repair. In some states of system configuration (e.g. before address decoders have been configured), memory devices (e.g. CXL) may not have an active mapping in the host physical address map. As such, the memory to repair must be identified by a device specific physical addressing scheme using a device physical address(DPA). The DPA and other control attributes to use for the repair operations will be presented in related error records. 😭 (yeah that's a lot, but it's literally the whole point, don't skip it)
  • get_min_dpa β€” gets the minimum supported device physical address (DPA).
  • get_max_dpa β€” gets the maximum supported device physical address (DPA).

🧚 the attribute committee (get + set pairs, slay)

  • get_nibble_mask β€” gets the current nibble mask of the memory to repair.
  • set_nibble_mask β€” sets the nibble mask of the memory to repair.
  • get_bank_group β€” gets the current bank group of the memory to repair.
  • set_bank_group β€” sets the bank group of the memory to repair.
  • get_bank β€” gets the current bank of the memory to repair.
  • set_bank β€” sets the bank of the memory to repair.
  • get_rank β€” gets the current rank of the memory to repair.
  • set_rank β€” sets the rank of the memory to repair.
  • get_row β€” gets the current row of the memory to repair.
  • set_row β€” sets the row of the memory to repair.
  • get_column β€” gets the current column of the memory to repair.
  • set_column β€” sets the column of the memory to repair.
  • get_channel β€” gets the current channel of the memory to repair.
  • set_channel β€” sets the channel of the memory to repair.
  • get_sub_channel β€” gets the current subchannel of the memory to repair.
  • set_sub_channel β€” sets the subchannel of the memory to repair.

πŸ‘‘ the one that actually does the thing

  • do_repair β€” issues the memory repair operation for the HPA/DPA and other control attributes set for the memory to repair. this is HER moment, the final boss, the reason we're all here πŸ’…πŸ”₯

🌟 Description 🌟

real talk: all elements are optional except do_repair and at least one of set_hpa/set_dpa. everything else can vibe in the void, but those you genuinely need. periodt. 🫢


πŸ“ SEE ALSO πŸ“

  • Kernel file ./include/linux/edac.h
  • enum dev_type(9)
  • enum hw_event_mc_err_type(9)
  • enum mem_type(9)
  • enum edac_type(9)
  • enum scrub_type(9)
  • enum edac_mc_layer_type(9)
  • struct edac_mc_layer(9)
  • struct rank_info(9)
  • struct edac_raw_error_desc(9)
  • edac_get_dimm(9)
  • struct edac_scrub_ops(9)
  • struct edac_ecs_ops(9)

bestie heads up πŸ’€ this page comes from ./include/linux and it's dated October 2026, so like… future-slay. go read the edac.h file if you want the deep lore, i believe in you πŸ’–

and that's the whole page!! mwah, you did amazing, go repair some memory πŸ§šβ€β™€οΈβœ¨πŸŽ€

πŸ“¦ where this page comes from