18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Defines, structures, APIs for edac_device
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * (C) 2007 Linux Networx (http://lnxi.com)
58c2ecf20Sopenharmony_ci * This file may be distributed under the terms of the
68c2ecf20Sopenharmony_ci * GNU General Public License.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Written by Thayne Harbaugh
98c2ecf20Sopenharmony_ci * Based on work by Dan Hollis <goemon at anime dot net> and others.
108c2ecf20Sopenharmony_ci *	http://www.anime.net/~goemon/linux-ecc/
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci * NMI handling support added by
138c2ecf20Sopenharmony_ci *     Dave Peterson <dsp@llnl.gov> <dave_peterson@pobox.com>
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci * Refactored for multi-source files:
168c2ecf20Sopenharmony_ci *	Doug Thompson <norsk5@xmission.com>
178c2ecf20Sopenharmony_ci *
188c2ecf20Sopenharmony_ci * Please look at Documentation/driver-api/edac.rst for more info about
198c2ecf20Sopenharmony_ci * EDAC core structs and functions.
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#ifndef _EDAC_DEVICE_H_
238c2ecf20Sopenharmony_ci#define _EDAC_DEVICE_H_
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#include <linux/completion.h>
268c2ecf20Sopenharmony_ci#include <linux/device.h>
278c2ecf20Sopenharmony_ci#include <linux/edac.h>
288c2ecf20Sopenharmony_ci#include <linux/kobject.h>
298c2ecf20Sopenharmony_ci#include <linux/list.h>
308c2ecf20Sopenharmony_ci#include <linux/types.h>
318c2ecf20Sopenharmony_ci#include <linux/sysfs.h>
328c2ecf20Sopenharmony_ci#include <linux/workqueue.h>
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci/*
368c2ecf20Sopenharmony_ci * The following are the structures to provide for a generic
378c2ecf20Sopenharmony_ci * or abstract 'edac_device'. This set of structures and the
388c2ecf20Sopenharmony_ci * code that implements the APIs for the same, provide for
398c2ecf20Sopenharmony_ci * registering EDAC type devices which are NOT standard memory.
408c2ecf20Sopenharmony_ci *
418c2ecf20Sopenharmony_ci * CPU caches (L1 and L2)
428c2ecf20Sopenharmony_ci * DMA engines
438c2ecf20Sopenharmony_ci * Core CPU switches
448c2ecf20Sopenharmony_ci * Fabric switch units
458c2ecf20Sopenharmony_ci * PCIe interface controllers
468c2ecf20Sopenharmony_ci * other EDAC/ECC type devices that can be monitored for
478c2ecf20Sopenharmony_ci * errors, etc.
488c2ecf20Sopenharmony_ci *
498c2ecf20Sopenharmony_ci * It allows for a 2 level set of hierarchy. For example:
508c2ecf20Sopenharmony_ci *
518c2ecf20Sopenharmony_ci * cache could be composed of L1, L2 and L3 levels of cache.
528c2ecf20Sopenharmony_ci * Each CPU core would have its own L1 cache, while sharing
538c2ecf20Sopenharmony_ci * L2 and maybe L3 caches.
548c2ecf20Sopenharmony_ci *
558c2ecf20Sopenharmony_ci * View them arranged, via the sysfs presentation:
568c2ecf20Sopenharmony_ci * /sys/devices/system/edac/..
578c2ecf20Sopenharmony_ci *
588c2ecf20Sopenharmony_ci *	mc/		<existing memory device directory>
598c2ecf20Sopenharmony_ci *	cpu/cpu0/..	<L1 and L2 block directory>
608c2ecf20Sopenharmony_ci *		/L1-cache/ce_count
618c2ecf20Sopenharmony_ci *			 /ue_count
628c2ecf20Sopenharmony_ci *		/L2-cache/ce_count
638c2ecf20Sopenharmony_ci *			 /ue_count
648c2ecf20Sopenharmony_ci *	cpu/cpu1/..	<L1 and L2 block directory>
658c2ecf20Sopenharmony_ci *		/L1-cache/ce_count
668c2ecf20Sopenharmony_ci *			 /ue_count
678c2ecf20Sopenharmony_ci *		/L2-cache/ce_count
688c2ecf20Sopenharmony_ci *			 /ue_count
698c2ecf20Sopenharmony_ci *	...
708c2ecf20Sopenharmony_ci *
718c2ecf20Sopenharmony_ci *	the L1 and L2 directories would be "edac_device_block's"
728c2ecf20Sopenharmony_ci */
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_cistruct edac_device_counter {
758c2ecf20Sopenharmony_ci	u32 ue_count;
768c2ecf20Sopenharmony_ci	u32 ce_count;
778c2ecf20Sopenharmony_ci};
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci/* forward reference */
808c2ecf20Sopenharmony_cistruct edac_device_ctl_info;
818c2ecf20Sopenharmony_cistruct edac_device_block;
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci/* edac_dev_sysfs_attribute structure
848c2ecf20Sopenharmony_ci *	used for driver sysfs attributes in mem_ctl_info
858c2ecf20Sopenharmony_ci *	for extra controls and attributes:
868c2ecf20Sopenharmony_ci *		like high level error Injection controls
878c2ecf20Sopenharmony_ci */
888c2ecf20Sopenharmony_cistruct edac_dev_sysfs_attribute {
898c2ecf20Sopenharmony_ci	struct attribute attr;
908c2ecf20Sopenharmony_ci	ssize_t (*show)(struct edac_device_ctl_info *, char *);
918c2ecf20Sopenharmony_ci	ssize_t (*store)(struct edac_device_ctl_info *, const char *, size_t);
928c2ecf20Sopenharmony_ci};
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci/* edac_dev_sysfs_block_attribute structure
958c2ecf20Sopenharmony_ci *
968c2ecf20Sopenharmony_ci *	used in leaf 'block' nodes for adding controls/attributes
978c2ecf20Sopenharmony_ci *
988c2ecf20Sopenharmony_ci *	each block in each instance of the containing control structure
998c2ecf20Sopenharmony_ci *	can have an array of the following. The show and store functions
1008c2ecf20Sopenharmony_ci *	will be filled in with the show/store function in the
1018c2ecf20Sopenharmony_ci *	low level driver.
1028c2ecf20Sopenharmony_ci *
1038c2ecf20Sopenharmony_ci *	The 'value' field will be the actual value field used for
1048c2ecf20Sopenharmony_ci *	counting
1058c2ecf20Sopenharmony_ci */
1068c2ecf20Sopenharmony_cistruct edac_dev_sysfs_block_attribute {
1078c2ecf20Sopenharmony_ci	struct attribute attr;
1088c2ecf20Sopenharmony_ci	ssize_t (*show)(struct kobject *, struct attribute *, char *);
1098c2ecf20Sopenharmony_ci	ssize_t (*store)(struct kobject *, struct attribute *,
1108c2ecf20Sopenharmony_ci			const char *, size_t);
1118c2ecf20Sopenharmony_ci	struct edac_device_block *block;
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci	unsigned int value;
1148c2ecf20Sopenharmony_ci};
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci/* device block control structure */
1178c2ecf20Sopenharmony_cistruct edac_device_block {
1188c2ecf20Sopenharmony_ci	struct edac_device_instance *instance;	/* Up Pointer */
1198c2ecf20Sopenharmony_ci	char name[EDAC_DEVICE_NAME_LEN + 1];
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci	struct edac_device_counter counters;	/* basic UE and CE counters */
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci	int nr_attribs;		/* how many attributes */
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci	/* this block's attributes, could be NULL */
1268c2ecf20Sopenharmony_ci	struct edac_dev_sysfs_block_attribute *block_attributes;
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci	/* edac sysfs device control */
1298c2ecf20Sopenharmony_ci	struct kobject kobj;
1308c2ecf20Sopenharmony_ci};
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci/* device instance control structure */
1338c2ecf20Sopenharmony_cistruct edac_device_instance {
1348c2ecf20Sopenharmony_ci	struct edac_device_ctl_info *ctl;	/* Up pointer */
1358c2ecf20Sopenharmony_ci	char name[EDAC_DEVICE_NAME_LEN + 4];
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci	struct edac_device_counter counters;	/* instance counters */
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci	u32 nr_blocks;		/* how many blocks */
1408c2ecf20Sopenharmony_ci	struct edac_device_block *blocks;	/* block array */
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci	/* edac sysfs device control */
1438c2ecf20Sopenharmony_ci	struct kobject kobj;
1448c2ecf20Sopenharmony_ci};
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci/*
1488c2ecf20Sopenharmony_ci * Abstract edac_device control info structure
1498c2ecf20Sopenharmony_ci *
1508c2ecf20Sopenharmony_ci */
1518c2ecf20Sopenharmony_cistruct edac_device_ctl_info {
1528c2ecf20Sopenharmony_ci	/* for global list of edac_device_ctl_info structs */
1538c2ecf20Sopenharmony_ci	struct list_head link;
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci	struct module *owner;	/* Module owner of this control struct */
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci	int dev_idx;
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci	/* Per instance controls for this edac_device */
1608c2ecf20Sopenharmony_ci	int log_ue;		/* boolean for logging UEs */
1618c2ecf20Sopenharmony_ci	int log_ce;		/* boolean for logging CEs */
1628c2ecf20Sopenharmony_ci	int panic_on_ue;	/* boolean for panic'ing on an UE */
1638c2ecf20Sopenharmony_ci	unsigned poll_msec;	/* number of milliseconds to poll interval */
1648c2ecf20Sopenharmony_ci	unsigned long delay;	/* number of jiffies for poll_msec */
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci	/* Additional top controller level attributes, but specified
1678c2ecf20Sopenharmony_ci	 * by the low level driver.
1688c2ecf20Sopenharmony_ci	 *
1698c2ecf20Sopenharmony_ci	 * Set by the low level driver to provide attributes at the
1708c2ecf20Sopenharmony_ci	 * controller level, same level as 'ue_count' and 'ce_count' above.
1718c2ecf20Sopenharmony_ci	 * An array of structures, NULL terminated
1728c2ecf20Sopenharmony_ci	 *
1738c2ecf20Sopenharmony_ci	 * If attributes are desired, then set to array of attributes
1748c2ecf20Sopenharmony_ci	 * If no attributes are desired, leave NULL
1758c2ecf20Sopenharmony_ci	 */
1768c2ecf20Sopenharmony_ci	struct edac_dev_sysfs_attribute *sysfs_attributes;
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci	/* pointer to main 'edac' subsys in sysfs */
1798c2ecf20Sopenharmony_ci	struct bus_type *edac_subsys;
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci	/* the internal state of this controller instance */
1828c2ecf20Sopenharmony_ci	int op_state;
1838c2ecf20Sopenharmony_ci	/* work struct for this instance */
1848c2ecf20Sopenharmony_ci	struct delayed_work work;
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci	/* pointer to edac polling checking routine:
1878c2ecf20Sopenharmony_ci	 *      If NOT NULL: points to polling check routine
1888c2ecf20Sopenharmony_ci	 *      If NULL: Then assumes INTERRUPT operation, where
1898c2ecf20Sopenharmony_ci	 *              MC driver will receive events
1908c2ecf20Sopenharmony_ci	 */
1918c2ecf20Sopenharmony_ci	void (*edac_check) (struct edac_device_ctl_info * edac_dev);
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci	struct device *dev;	/* pointer to device structure */
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci	const char *mod_name;	/* module name */
1968c2ecf20Sopenharmony_ci	const char *ctl_name;	/* edac controller  name */
1978c2ecf20Sopenharmony_ci	const char *dev_name;	/* pci/platform/etc... name */
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci	void *pvt_info;		/* pointer to 'private driver' info */
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_ci	unsigned long start_time;	/* edac_device load start time (jiffies) */
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci	struct completion removal_complete;
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci	/* sysfs top name under 'edac' directory
2068c2ecf20Sopenharmony_ci	 * and instance name:
2078c2ecf20Sopenharmony_ci	 *      cpu/cpu0/...
2088c2ecf20Sopenharmony_ci	 *      cpu/cpu1/...
2098c2ecf20Sopenharmony_ci	 *      cpu/cpu2/...
2108c2ecf20Sopenharmony_ci	 *      ...
2118c2ecf20Sopenharmony_ci	 */
2128c2ecf20Sopenharmony_ci	char name[EDAC_DEVICE_NAME_LEN + 1];
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci	/* Number of instances supported on this control structure
2158c2ecf20Sopenharmony_ci	 * and the array of those instances
2168c2ecf20Sopenharmony_ci	 */
2178c2ecf20Sopenharmony_ci	u32 nr_instances;
2188c2ecf20Sopenharmony_ci	struct edac_device_instance *instances;
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_ci	/* Event counters for the this whole EDAC Device */
2218c2ecf20Sopenharmony_ci	struct edac_device_counter counters;
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci	/* edac sysfs device control for the 'name'
2248c2ecf20Sopenharmony_ci	 * device this structure controls
2258c2ecf20Sopenharmony_ci	 */
2268c2ecf20Sopenharmony_ci	struct kobject kobj;
2278c2ecf20Sopenharmony_ci};
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci/* To get from the instance's wq to the beginning of the ctl structure */
2308c2ecf20Sopenharmony_ci#define to_edac_mem_ctl_work(w) \
2318c2ecf20Sopenharmony_ci		container_of(w, struct mem_ctl_info, work)
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci#define to_edac_device_ctl_work(w) \
2348c2ecf20Sopenharmony_ci		container_of(w,struct edac_device_ctl_info,work)
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci/*
2378c2ecf20Sopenharmony_ci * The alloc() and free() functions for the 'edac_device' control info
2388c2ecf20Sopenharmony_ci * structure. A MC driver will allocate one of these for each edac_device
2398c2ecf20Sopenharmony_ci * it is going to control/register with the EDAC CORE.
2408c2ecf20Sopenharmony_ci */
2418c2ecf20Sopenharmony_ciextern struct edac_device_ctl_info *edac_device_alloc_ctl_info(
2428c2ecf20Sopenharmony_ci		unsigned sizeof_private,
2438c2ecf20Sopenharmony_ci		char *edac_device_name, unsigned nr_instances,
2448c2ecf20Sopenharmony_ci		char *edac_block_name, unsigned nr_blocks,
2458c2ecf20Sopenharmony_ci		unsigned offset_value,
2468c2ecf20Sopenharmony_ci		struct edac_dev_sysfs_block_attribute *block_attributes,
2478c2ecf20Sopenharmony_ci		unsigned nr_attribs,
2488c2ecf20Sopenharmony_ci		int device_index);
2498c2ecf20Sopenharmony_ci
2508c2ecf20Sopenharmony_ci/* The offset value can be:
2518c2ecf20Sopenharmony_ci *	-1 indicating no offset value
2528c2ecf20Sopenharmony_ci *	0 for zero-based block numbers
2538c2ecf20Sopenharmony_ci *	1 for 1-based block number
2548c2ecf20Sopenharmony_ci *	other for other-based block number
2558c2ecf20Sopenharmony_ci */
2568c2ecf20Sopenharmony_ci#define	BLOCK_OFFSET_VALUE_OFF	((unsigned) -1)
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ciextern void edac_device_free_ctl_info(struct edac_device_ctl_info *ctl_info);
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci/**
2618c2ecf20Sopenharmony_ci * edac_device_add_device: Insert the 'edac_dev' structure into the
2628c2ecf20Sopenharmony_ci *	 edac_device global list and create sysfs entries associated with
2638c2ecf20Sopenharmony_ci *	 edac_device structure.
2648c2ecf20Sopenharmony_ci *
2658c2ecf20Sopenharmony_ci * @edac_dev: pointer to edac_device structure to be added to the list
2668c2ecf20Sopenharmony_ci *	'edac_device' structure.
2678c2ecf20Sopenharmony_ci *
2688c2ecf20Sopenharmony_ci * Returns:
2698c2ecf20Sopenharmony_ci *	0 on Success, or an error code on failure
2708c2ecf20Sopenharmony_ci */
2718c2ecf20Sopenharmony_ciextern int edac_device_add_device(struct edac_device_ctl_info *edac_dev);
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci/**
2748c2ecf20Sopenharmony_ci * edac_device_del_device:
2758c2ecf20Sopenharmony_ci *	Remove sysfs entries for specified edac_device structure and
2768c2ecf20Sopenharmony_ci *	then remove edac_device structure from global list
2778c2ecf20Sopenharmony_ci *
2788c2ecf20Sopenharmony_ci * @dev:
2798c2ecf20Sopenharmony_ci *	Pointer to struct &device representing the edac device
2808c2ecf20Sopenharmony_ci *	structure to remove.
2818c2ecf20Sopenharmony_ci *
2828c2ecf20Sopenharmony_ci * Returns:
2838c2ecf20Sopenharmony_ci *	Pointer to removed edac_device structure,
2848c2ecf20Sopenharmony_ci *	or %NULL if device not found.
2858c2ecf20Sopenharmony_ci */
2868c2ecf20Sopenharmony_ciextern struct edac_device_ctl_info *edac_device_del_device(struct device *dev);
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ci/**
2898c2ecf20Sopenharmony_ci * Log correctable errors.
2908c2ecf20Sopenharmony_ci *
2918c2ecf20Sopenharmony_ci * @edac_dev: pointer to struct &edac_device_ctl_info
2928c2ecf20Sopenharmony_ci * @inst_nr: number of the instance where the CE error happened
2938c2ecf20Sopenharmony_ci * @count: Number of errors to log.
2948c2ecf20Sopenharmony_ci * @block_nr: number of the block where the CE error happened
2958c2ecf20Sopenharmony_ci * @msg: message to be printed
2968c2ecf20Sopenharmony_ci */
2978c2ecf20Sopenharmony_civoid edac_device_handle_ce_count(struct edac_device_ctl_info *edac_dev,
2988c2ecf20Sopenharmony_ci				 unsigned int count, int inst_nr, int block_nr,
2998c2ecf20Sopenharmony_ci				 const char *msg);
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci/**
3028c2ecf20Sopenharmony_ci * Log uncorrectable errors.
3038c2ecf20Sopenharmony_ci *
3048c2ecf20Sopenharmony_ci * @edac_dev: pointer to struct &edac_device_ctl_info
3058c2ecf20Sopenharmony_ci * @inst_nr: number of the instance where the CE error happened
3068c2ecf20Sopenharmony_ci * @count: Number of errors to log.
3078c2ecf20Sopenharmony_ci * @block_nr: number of the block where the CE error happened
3088c2ecf20Sopenharmony_ci * @msg: message to be printed
3098c2ecf20Sopenharmony_ci */
3108c2ecf20Sopenharmony_civoid edac_device_handle_ue_count(struct edac_device_ctl_info *edac_dev,
3118c2ecf20Sopenharmony_ci				 unsigned int count, int inst_nr, int block_nr,
3128c2ecf20Sopenharmony_ci				 const char *msg);
3138c2ecf20Sopenharmony_ci
3148c2ecf20Sopenharmony_ci/**
3158c2ecf20Sopenharmony_ci * edac_device_handle_ce(): Log a single correctable error
3168c2ecf20Sopenharmony_ci *
3178c2ecf20Sopenharmony_ci * @edac_dev: pointer to struct &edac_device_ctl_info
3188c2ecf20Sopenharmony_ci * @inst_nr: number of the instance where the CE error happened
3198c2ecf20Sopenharmony_ci * @block_nr: number of the block where the CE error happened
3208c2ecf20Sopenharmony_ci * @msg: message to be printed
3218c2ecf20Sopenharmony_ci */
3228c2ecf20Sopenharmony_cistatic inline void
3238c2ecf20Sopenharmony_ciedac_device_handle_ce(struct edac_device_ctl_info *edac_dev, int inst_nr,
3248c2ecf20Sopenharmony_ci		      int block_nr, const char *msg)
3258c2ecf20Sopenharmony_ci{
3268c2ecf20Sopenharmony_ci	edac_device_handle_ce_count(edac_dev, 1, inst_nr, block_nr, msg);
3278c2ecf20Sopenharmony_ci}
3288c2ecf20Sopenharmony_ci
3298c2ecf20Sopenharmony_ci/**
3308c2ecf20Sopenharmony_ci * edac_device_handle_ue(): Log a single uncorrectable error
3318c2ecf20Sopenharmony_ci *
3328c2ecf20Sopenharmony_ci * @edac_dev: pointer to struct &edac_device_ctl_info
3338c2ecf20Sopenharmony_ci * @inst_nr: number of the instance where the UE error happened
3348c2ecf20Sopenharmony_ci * @block_nr: number of the block where the UE error happened
3358c2ecf20Sopenharmony_ci * @msg: message to be printed
3368c2ecf20Sopenharmony_ci */
3378c2ecf20Sopenharmony_cistatic inline void
3388c2ecf20Sopenharmony_ciedac_device_handle_ue(struct edac_device_ctl_info *edac_dev, int inst_nr,
3398c2ecf20Sopenharmony_ci		      int block_nr, const char *msg)
3408c2ecf20Sopenharmony_ci{
3418c2ecf20Sopenharmony_ci	edac_device_handle_ue_count(edac_dev, 1, inst_nr, block_nr, msg);
3428c2ecf20Sopenharmony_ci}
3438c2ecf20Sopenharmony_ci
3448c2ecf20Sopenharmony_ci/**
3458c2ecf20Sopenharmony_ci * edac_device_alloc_index: Allocate a unique device index number
3468c2ecf20Sopenharmony_ci *
3478c2ecf20Sopenharmony_ci * Returns:
3488c2ecf20Sopenharmony_ci *	allocated index number
3498c2ecf20Sopenharmony_ci */
3508c2ecf20Sopenharmony_ciextern int edac_device_alloc_index(void);
3518c2ecf20Sopenharmony_ciextern const char *edac_layer_name[];
3528c2ecf20Sopenharmony_ci#endif
353