EDAC: Add support for EDAC device features control

Add generic EDAC device feature controls supporting the registration of RAS
features available in the system. The driver exposes control attributes for
these features to userspace in

  /sys/bus/edac/devices/<dev-name>/<ras-feature>

  [ bp: Touch-up documentation, simplify, make edac_dev_type static,
    fixup edac_dev_register() retvals. ]

Co-developed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Tested-by: Daniel Ferguson <danielf@os.amperecomputing.com>
Tested-by: Fan Ni <fan.ni@samsung.com>
Link: https://lore.kernel.org/r/20250212143654.1893-2-shiju.jose@huawei.com
This commit is contained in:
Shiju Jose authored and Borislav Petkov (AMD) committed 2025-02-25 15:33:27 +01:00
1 parent 0ad2507d5d
commit db99ea5f2c
4 files changed
+230

No files matched your search

+26
View File
@@ -661,4 +661,30 @@ static inline struct dimm_info *edac_get_dimm(struct mem_ctl_info *mci,
return mci->dimms[index];
}
/* RAS feature type */
enum edac_dev_feat {
RAS_FEAT_MAX
};
/* EDAC device feature information structure */
struct edac_dev_data {
u8 instance;
void *private;
};
struct edac_dev_feat_ctx {
struct device dev;
void *private;
};
struct edac_dev_feature {
enum edac_dev_feat ft_type;
u8 instance;
void *ctx;
};
int edac_dev_register(struct device *parent, char *dev_name,
void *parent_pvt_data, int num_features,
const struct edac_dev_feature *ras_features);
#endif /* _LINUX_EDAC_H_ */