mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
drivers/edac: core Lindent cleanup
Run the EDAC CORE files through Lindent for cleanup Signed-off-by: Douglas Thompson <dougthompson@xmission.com> Signed-off-by: Dave Jiang <djiang@mvista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
4de78c6877
commit
079708b917
@ -462,7 +462,6 @@ struct edac_attrib_spec {
|
|||||||
#define EDAC_ATTR_CHAR 0x02
|
#define EDAC_ATTR_CHAR 0x02
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Attribute control structure
|
/* Attribute control structure
|
||||||
* In this structure is a pointer to the driver's edac_attrib_spec
|
* In this structure is a pointer to the driver's edac_attrib_spec
|
||||||
* The life of this pointer is inclusive in the life of the driver's
|
* The life of this pointer is inclusive in the life of the driver's
|
||||||
@ -509,7 +508,6 @@ struct edac_device_instance {
|
|||||||
struct completion kobj_complete;
|
struct completion kobj_complete;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Abstract edac_device control info structure
|
* Abstract edac_device control info structure
|
||||||
*
|
*
|
||||||
@ -594,8 +592,7 @@ struct edac_device_ctl_info {
|
|||||||
container_of(w,struct edac_device_ctl_info,work)
|
container_of(w,struct edac_device_ctl_info,work)
|
||||||
|
|
||||||
/* Function to calc the number of delay jiffies from poll_msec */
|
/* Function to calc the number of delay jiffies from poll_msec */
|
||||||
static inline void edac_device_calc_delay(
|
static inline void edac_device_calc_delay(struct edac_device_ctl_info *edac_dev)
|
||||||
struct edac_device_ctl_info *edac_dev)
|
|
||||||
{
|
{
|
||||||
/* convert from msec to jiffies */
|
/* convert from msec to jiffies */
|
||||||
edac_dev->delay = edac_dev->poll_msec * HZ / 1000;
|
edac_dev->delay = edac_dev->poll_msec * HZ / 1000;
|
||||||
@ -616,8 +613,7 @@ extern struct edac_device_ctl_info *edac_device_alloc_ctl_info(
|
|||||||
unsigned nr_blocks,
|
unsigned nr_blocks,
|
||||||
unsigned offset_value,
|
unsigned offset_value,
|
||||||
struct edac_attrib_spec *attrib_spec,
|
struct edac_attrib_spec *attrib_spec,
|
||||||
unsigned nr_attribs
|
unsigned nr_attribs);
|
||||||
);
|
|
||||||
|
|
||||||
/* The offset value can be:
|
/* The offset value can be:
|
||||||
* -1 indicating no offset value
|
* -1 indicating no offset value
|
||||||
@ -769,25 +765,23 @@ extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci,
|
|||||||
* statement clutter and extra function arguments.
|
* statement clutter and extra function arguments.
|
||||||
*/
|
*/
|
||||||
extern void edac_mc_handle_ce(struct mem_ctl_info *mci,
|
extern void edac_mc_handle_ce(struct mem_ctl_info *mci,
|
||||||
unsigned long page_frame_number, unsigned long offset_in_page,
|
unsigned long page_frame_number,
|
||||||
|
unsigned long offset_in_page,
|
||||||
unsigned long syndrome, int row, int channel,
|
unsigned long syndrome, int row, int channel,
|
||||||
const char *msg);
|
const char *msg);
|
||||||
extern void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci,
|
extern void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci,
|
||||||
const char *msg);
|
const char *msg);
|
||||||
extern void edac_mc_handle_ue(struct mem_ctl_info *mci,
|
extern void edac_mc_handle_ue(struct mem_ctl_info *mci,
|
||||||
unsigned long page_frame_number, unsigned long offset_in_page,
|
unsigned long page_frame_number,
|
||||||
int row, const char *msg);
|
unsigned long offset_in_page, int row,
|
||||||
|
const char *msg);
|
||||||
extern void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci,
|
extern void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci,
|
||||||
const char *msg);
|
const char *msg);
|
||||||
extern void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
|
extern void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci, unsigned int csrow,
|
||||||
unsigned int csrow,
|
unsigned int channel0, unsigned int channel1,
|
||||||
unsigned int channel0,
|
|
||||||
unsigned int channel1,
|
|
||||||
char *msg);
|
|
||||||
extern void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
|
|
||||||
unsigned int csrow,
|
|
||||||
unsigned int channel,
|
|
||||||
char *msg);
|
char *msg);
|
||||||
|
extern void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci, unsigned int csrow,
|
||||||
|
unsigned int channel, char *msg);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* edac_device APIs
|
* edac_device APIs
|
||||||
@ -795,7 +789,8 @@ extern void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
|
|||||||
extern struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
|
extern struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
|
||||||
unsigned nr_chans);
|
unsigned nr_chans);
|
||||||
extern void edac_mc_free(struct mem_ctl_info *mci);
|
extern void edac_mc_free(struct mem_ctl_info *mci);
|
||||||
extern int edac_device_add_device(struct edac_device_ctl_info *edac_dev, int edac_idx);
|
extern int edac_device_add_device(struct edac_device_ctl_info *edac_dev,
|
||||||
|
int edac_idx);
|
||||||
extern struct edac_device_ctl_info *edac_device_del_device(struct device *dev);
|
extern struct edac_device_ctl_info *edac_device_del_device(struct device *dev);
|
||||||
extern void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
|
extern void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
|
||||||
int inst_nr, int block_nr, const char *msg);
|
int inst_nr, int block_nr, const char *msg);
|
||||||
@ -805,8 +800,8 @@ extern void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
|
|||||||
/*
|
/*
|
||||||
* edac_pci APIs
|
* edac_pci APIs
|
||||||
*/
|
*/
|
||||||
extern struct edac_pci_ctl_info *
|
extern struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt, const char
|
||||||
edac_pci_alloc_ctl_info(unsigned int sz_pvt, const char *edac_pci_name);
|
*edac_pci_name);
|
||||||
|
|
||||||
extern void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci);
|
extern void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci);
|
||||||
|
|
||||||
@ -816,8 +811,8 @@ edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci, unsigned long value);
|
|||||||
extern int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx);
|
extern int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx);
|
||||||
extern struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev);
|
extern struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev);
|
||||||
|
|
||||||
extern struct edac_pci_ctl_info *
|
extern struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev, const char
|
||||||
edac_pci_create_generic_ctl(struct device *dev, const char *mod_name);
|
*mod_name);
|
||||||
|
|
||||||
extern void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci);
|
extern void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci);
|
||||||
extern int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci);
|
extern int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci);
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
static DECLARE_MUTEX(device_ctls_mutex);
|
static DECLARE_MUTEX(device_ctls_mutex);
|
||||||
static struct list_head edac_device_list = LIST_HEAD_INIT(edac_device_list);
|
static struct list_head edac_device_list = LIST_HEAD_INIT(edac_device_list);
|
||||||
|
|
||||||
|
|
||||||
static inline void lock_device_list(void)
|
static inline void lock_device_list(void)
|
||||||
{
|
{
|
||||||
down(&device_ctls_mutex);
|
down(&device_ctls_mutex);
|
||||||
@ -46,7 +45,6 @@ static inline void unlock_device_list(void)
|
|||||||
up(&device_ctls_mutex);
|
up(&device_ctls_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_EDAC_DEBUG
|
#ifdef CONFIG_EDAC_DEBUG
|
||||||
static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
|
static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
|
||||||
{
|
{
|
||||||
@ -71,7 +69,8 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
|
|||||||
char *edac_block_name,
|
char *edac_block_name,
|
||||||
unsigned nr_blocks,
|
unsigned nr_blocks,
|
||||||
unsigned offset_value,
|
unsigned offset_value,
|
||||||
struct edac_attrib_spec *attrib_spec,
|
struct edac_attrib_spec
|
||||||
|
*attrib_spec,
|
||||||
unsigned nr_attribs)
|
unsigned nr_attribs)
|
||||||
{
|
{
|
||||||
struct edac_device_ctl_info *dev_ctl;
|
struct edac_device_ctl_info *dev_ctl;
|
||||||
@ -127,8 +126,7 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
|
|||||||
(((char *)dev_ctl) + ((unsigned long)dev_blk));
|
(((char *)dev_ctl) + ((unsigned long)dev_blk));
|
||||||
dev_attrib = (struct edac_attrib *)
|
dev_attrib = (struct edac_attrib *)
|
||||||
(((char *)dev_ctl) + ((unsigned long)dev_attrib));
|
(((char *)dev_ctl) + ((unsigned long)dev_attrib));
|
||||||
pvt = sz_private ?
|
pvt = sz_private ? (((char *)dev_ctl) + ((unsigned long)pvt)) : NULL;
|
||||||
(((char *) dev_ctl) + ((unsigned long) pvt)) : NULL;
|
|
||||||
|
|
||||||
memset(dev_ctl, 0, total_size); /* clear all fields */
|
memset(dev_ctl, 0, total_size); /* clear all fields */
|
||||||
dev_ctl->nr_instances = nr_instances;
|
dev_ctl->nr_instances = nr_instances;
|
||||||
@ -153,9 +151,7 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
|
|||||||
inst->name[sizeof(inst->name) - 1] = '\0';
|
inst->name[sizeof(inst->name) - 1] = '\0';
|
||||||
|
|
||||||
/* Initialize every block in each instance */
|
/* Initialize every block in each instance */
|
||||||
for ( block = 0;
|
for (block = 0; block < nr_blocks; block++) {
|
||||||
block < nr_blocks;
|
|
||||||
block++) {
|
|
||||||
blk = &blk_p[block];
|
blk = &blk_p[block];
|
||||||
blk->instance = inst;
|
blk->instance = inst;
|
||||||
blk->nr_attribs = nr_attribs;
|
blk->nr_attribs = nr_attribs;
|
||||||
@ -190,6 +186,7 @@ struct edac_device_ctl_info *edac_device_alloc_ctl_info(
|
|||||||
|
|
||||||
return dev_ctl;
|
return dev_ctl;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_device_alloc_ctl_info);
|
EXPORT_SYMBOL_GPL(edac_device_alloc_ctl_info);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -197,19 +194,18 @@ EXPORT_SYMBOL_GPL(edac_device_alloc_ctl_info);
|
|||||||
* frees the memory allocated by the edac_device_alloc_ctl_info()
|
* frees the memory allocated by the edac_device_alloc_ctl_info()
|
||||||
* function
|
* function
|
||||||
*/
|
*/
|
||||||
void edac_device_free_ctl_info( struct edac_device_ctl_info *ctl_info) {
|
void edac_device_free_ctl_info(struct edac_device_ctl_info *ctl_info)
|
||||||
|
{
|
||||||
kfree(ctl_info);
|
kfree(ctl_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_device_free_ctl_info);
|
EXPORT_SYMBOL_GPL(edac_device_free_ctl_info);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* find_edac_device_by_dev
|
* find_edac_device_by_dev
|
||||||
* scans the edac_device list for a specific 'struct device *'
|
* scans the edac_device list for a specific 'struct device *'
|
||||||
*/
|
*/
|
||||||
static struct edac_device_ctl_info *
|
static struct edac_device_ctl_info *find_edac_device_by_dev(struct device *dev)
|
||||||
find_edac_device_by_dev(struct device *dev)
|
|
||||||
{
|
{
|
||||||
struct edac_device_ctl_info *edac_dev;
|
struct edac_device_ctl_info *edac_dev;
|
||||||
struct list_head *item;
|
struct list_head *item;
|
||||||
@ -271,7 +267,8 @@ fail0:
|
|||||||
fail1:
|
fail1:
|
||||||
edac_printk(KERN_WARNING, EDAC_MC,
|
edac_printk(KERN_WARNING, EDAC_MC,
|
||||||
"bug in low-level driver: attempt to assign\n"
|
"bug in low-level driver: attempt to assign\n"
|
||||||
" duplicate dev_idx %d in %s()\n", rover->dev_idx, __func__);
|
" duplicate dev_idx %d in %s()\n", rover->dev_idx,
|
||||||
|
__func__);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,8 +287,8 @@ static void complete_edac_device_list_del(struct rcu_head *head)
|
|||||||
/*
|
/*
|
||||||
* del_edac_device_from_global_list
|
* del_edac_device_from_global_list
|
||||||
*/
|
*/
|
||||||
static void del_edac_device_from_global_list(
|
static void del_edac_device_from_global_list(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *edac_device)
|
*edac_device)
|
||||||
{
|
{
|
||||||
list_del_rcu(&edac_device->link);
|
list_del_rcu(&edac_device->link);
|
||||||
init_completion(&edac_device->complete);
|
init_completion(&edac_device->complete);
|
||||||
@ -328,8 +325,8 @@ struct edac_device_ctl_info * edac_device_find(int idx)
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(edac_device_find);
|
|
||||||
|
|
||||||
|
EXPORT_SYMBOL(edac_device_find);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* edac_device_workq_function
|
* edac_device_workq_function
|
||||||
@ -339,8 +336,7 @@ EXPORT_SYMBOL(edac_device_find);
|
|||||||
static void edac_device_workq_function(struct work_struct *work_req)
|
static void edac_device_workq_function(struct work_struct *work_req)
|
||||||
{
|
{
|
||||||
struct delayed_work *d_work = (struct delayed_work *)work_req;
|
struct delayed_work *d_work = (struct delayed_work *)work_req;
|
||||||
struct edac_device_ctl_info *edac_dev =
|
struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work);
|
||||||
to_edac_device_ctl_work(d_work);
|
|
||||||
#else
|
#else
|
||||||
static void edac_device_workq_function(void *ptr)
|
static void edac_device_workq_function(void *ptr)
|
||||||
{
|
{
|
||||||
@ -403,8 +399,7 @@ void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev)
|
|||||||
* edac_device_reset_delay_period
|
* edac_device_reset_delay_period
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void edac_device_reset_delay_period(
|
void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
|
||||||
struct edac_device_ctl_info *edac_dev,
|
|
||||||
unsigned long value)
|
unsigned long value)
|
||||||
{
|
{
|
||||||
lock_device_list();
|
lock_device_list();
|
||||||
@ -468,7 +463,6 @@ int edac_device_add_device(struct edac_device_ctl_info *edac_dev, int edac_idx)
|
|||||||
edac_dev->op_state = OP_RUNNING_INTERRUPT;
|
edac_dev->op_state = OP_RUNNING_INTERRUPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Report action taken */
|
/* Report action taken */
|
||||||
edac_device_printk(edac_dev, KERN_INFO,
|
edac_device_printk(edac_dev, KERN_INFO,
|
||||||
"Giving out device to module '%s' controller '%s': DEV '%s' (%s)\n",
|
"Giving out device to module '%s' controller '%s': DEV '%s' (%s)\n",
|
||||||
@ -489,6 +483,7 @@ fail0:
|
|||||||
unlock_device_list();
|
unlock_device_list();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_device_add_device);
|
EXPORT_SYMBOL_GPL(edac_device_add_device);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -534,14 +529,12 @@ struct edac_device_ctl_info * edac_device_del_device(struct device *dev)
|
|||||||
edac_printk(KERN_INFO, EDAC_MC,
|
edac_printk(KERN_INFO, EDAC_MC,
|
||||||
"Removed device %d for %s %s: DEV %s\n",
|
"Removed device %d for %s %s: DEV %s\n",
|
||||||
edac_dev->dev_idx,
|
edac_dev->dev_idx,
|
||||||
edac_dev->mod_name,
|
edac_dev->mod_name, edac_dev->ctl_name, dev_name(edac_dev));
|
||||||
edac_dev->ctl_name,
|
|
||||||
dev_name(edac_dev));
|
|
||||||
|
|
||||||
return edac_dev;
|
return edac_dev;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(edac_device_del_device);
|
|
||||||
|
|
||||||
|
EXPORT_SYMBOL_GPL(edac_device_del_device);
|
||||||
|
|
||||||
static inline int edac_device_get_log_ce(struct edac_device_ctl_info *edac_dev)
|
static inline int edac_device_get_log_ce(struct edac_device_ctl_info *edac_dev)
|
||||||
{
|
{
|
||||||
@ -553,8 +546,8 @@ static inline int edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev)
|
|||||||
return edac_dev->log_ue;
|
return edac_dev->log_ue;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int edac_device_get_panic_on_ue(
|
static inline int edac_device_get_panic_on_ue(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *edac_dev)
|
*edac_dev)
|
||||||
{
|
{
|
||||||
return edac_dev->panic_on_ue;
|
return edac_dev->panic_on_ue;
|
||||||
}
|
}
|
||||||
@ -572,7 +565,8 @@ void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
|
|||||||
if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
|
if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
|
||||||
edac_device_printk(edac_dev, KERN_ERR,
|
edac_device_printk(edac_dev, KERN_ERR,
|
||||||
"INTERNAL ERROR: 'instance' out of range "
|
"INTERNAL ERROR: 'instance' out of range "
|
||||||
"(%d >= %d)\n", inst_nr, edac_dev->nr_instances);
|
"(%d >= %d)\n", inst_nr,
|
||||||
|
edac_dev->nr_instances);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,7 +575,8 @@ void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
|
|||||||
if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) {
|
if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) {
|
||||||
edac_device_printk(edac_dev, KERN_ERR,
|
edac_device_printk(edac_dev, KERN_ERR,
|
||||||
"INTERNAL ERROR: instance %d 'block' out of range "
|
"INTERNAL ERROR: instance %d 'block' out of range "
|
||||||
"(%d >= %d)\n", inst_nr, block_nr, instance->nr_blocks);
|
"(%d >= %d)\n", inst_nr, block_nr,
|
||||||
|
instance->nr_blocks);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -600,6 +595,7 @@ void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
|
|||||||
edac_dev->ctl_name, instance->name,
|
edac_dev->ctl_name, instance->name,
|
||||||
block ? block->name : "N/A", msg);
|
block ? block->name : "N/A", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_device_handle_ce);
|
EXPORT_SYMBOL_GPL(edac_device_handle_ce);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -615,7 +611,8 @@ void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
|
|||||||
if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
|
if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
|
||||||
edac_device_printk(edac_dev, KERN_ERR,
|
edac_device_printk(edac_dev, KERN_ERR,
|
||||||
"INTERNAL ERROR: 'instance' out of range "
|
"INTERNAL ERROR: 'instance' out of range "
|
||||||
"(%d >= %d)\n", inst_nr, edac_dev->nr_instances);
|
"(%d >= %d)\n", inst_nr,
|
||||||
|
edac_dev->nr_instances);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -624,7 +621,8 @@ void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
|
|||||||
if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) {
|
if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) {
|
||||||
edac_device_printk(edac_dev, KERN_ERR,
|
edac_device_printk(edac_dev, KERN_ERR,
|
||||||
"INTERNAL ERROR: instance %d 'block' out of range "
|
"INTERNAL ERROR: instance %d 'block' out of range "
|
||||||
"(%d >= %d)\n", inst_nr, block_nr, instance->nr_blocks);
|
"(%d >= %d)\n", inst_nr, block_nr,
|
||||||
|
instance->nr_blocks);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -648,5 +646,5 @@ void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
|
|||||||
edac_dev->ctl_name, instance->name,
|
edac_dev->ctl_name, instance->name,
|
||||||
block ? block->name : "N/A", msg);
|
block ? block->name : "N/A", msg);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(edac_device_handle_ue);
|
|
||||||
|
|
||||||
|
EXPORT_SYMBOL_GPL(edac_device_handle_ue);
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#include "edac_core.h"
|
#include "edac_core.h"
|
||||||
#include "edac_module.h"
|
#include "edac_module.h"
|
||||||
|
|
||||||
|
|
||||||
#define EDAC_DEVICE_SYMLINK "device"
|
#define EDAC_DEVICE_SYMLINK "device"
|
||||||
|
|
||||||
#define to_edacdev(k) container_of(k, struct edac_device_ctl_info, kobj)
|
#define to_edacdev(k) container_of(k, struct edac_device_ctl_info, kobj)
|
||||||
@ -48,14 +47,12 @@ static ssize_t edac_dev_ctl_name_show(struct edac_device_ctl_info *edac_dev,
|
|||||||
return sprintf(data, "%s\n", edac_dev->ctl_name);
|
return sprintf(data, "%s\n", edac_dev->ctl_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct edacdev_attribute {
|
struct edacdev_attribute {
|
||||||
struct attribute attr;
|
struct attribute attr;
|
||||||
ssize_t(*show) (struct edac_device_ctl_info *, char *);
|
ssize_t(*show) (struct edac_device_ctl_info *, char *);
|
||||||
ssize_t(*store) (struct edac_device_ctl_info *, const char *, size_t);
|
ssize_t(*store) (struct edac_device_ctl_info *, const char *, size_t);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* EDAC DEVICE show/store functions for top most object */
|
/* EDAC DEVICE show/store functions for top most object */
|
||||||
static ssize_t edacdev_show(struct kobject *kobj, struct attribute *attr,
|
static ssize_t edacdev_show(struct kobject *kobj, struct attribute *attr,
|
||||||
char *buffer)
|
char *buffer)
|
||||||
@ -102,7 +99,6 @@ EDACDEV_ATTR(seconds_since_reset,S_IRUGO,edac_dev_seconds_show,NULL);
|
|||||||
EDACDEV_ATTR(ue_count, S_IRUGO, edac_dev_ue_count_show, NULL);
|
EDACDEV_ATTR(ue_count, S_IRUGO, edac_dev_ue_count_show, NULL);
|
||||||
EDACDEV_ATTR(ce_count, S_IRUGO, edac_dev_ce_count_show, NULL);
|
EDACDEV_ATTR(ce_count, S_IRUGO, edac_dev_ce_count_show, NULL);
|
||||||
|
|
||||||
|
|
||||||
static struct edacdev_attribute *edacdev_attr[] = {
|
static struct edacdev_attribute *edacdev_attr[] = {
|
||||||
&edacdev_attr_reset_counters,
|
&edacdev_attr_reset_counters,
|
||||||
&edacdev_attr_mc_name,
|
&edacdev_attr_mc_name,
|
||||||
@ -139,15 +135,15 @@ static struct kobj_type ktype_device = {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* 'log_ue' */
|
/* 'log_ue' */
|
||||||
static ssize_t edac_device_ctl_log_ue_show(
|
static ssize_t edac_device_ctl_log_ue_show(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *ctl_info, char *data)
|
*ctl_info, char *data)
|
||||||
{
|
{
|
||||||
return sprintf(data, "%u\n", ctl_info->log_ue);
|
return sprintf(data, "%u\n", ctl_info->log_ue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t edac_device_ctl_log_ue_store(
|
static ssize_t edac_device_ctl_log_ue_store(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *ctl_info,
|
*ctl_info, const char *data,
|
||||||
const char *data,size_t count)
|
size_t count)
|
||||||
{
|
{
|
||||||
/* if parameter is zero, turn off flag, if non-zero turn on flag */
|
/* if parameter is zero, turn off flag, if non-zero turn on flag */
|
||||||
ctl_info->log_ue = (simple_strtoul(data, NULL, 0) != 0);
|
ctl_info->log_ue = (simple_strtoul(data, NULL, 0) != 0);
|
||||||
@ -156,15 +152,15 @@ static ssize_t edac_device_ctl_log_ue_store(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 'log_ce' */
|
/* 'log_ce' */
|
||||||
static ssize_t edac_device_ctl_log_ce_show(
|
static ssize_t edac_device_ctl_log_ce_show(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *ctl_info,char *data)
|
*ctl_info, char *data)
|
||||||
{
|
{
|
||||||
return sprintf(data, "%u\n", ctl_info->log_ce);
|
return sprintf(data, "%u\n", ctl_info->log_ce);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t edac_device_ctl_log_ce_store(
|
static ssize_t edac_device_ctl_log_ce_store(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *ctl_info,
|
*ctl_info, const char *data,
|
||||||
const char *data,size_t count)
|
size_t count)
|
||||||
{
|
{
|
||||||
/* if parameter is zero, turn off flag, if non-zero turn on flag */
|
/* if parameter is zero, turn off flag, if non-zero turn on flag */
|
||||||
ctl_info->log_ce = (simple_strtoul(data, NULL, 0) != 0);
|
ctl_info->log_ce = (simple_strtoul(data, NULL, 0) != 0);
|
||||||
@ -172,17 +168,16 @@ static ssize_t edac_device_ctl_log_ce_store(
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* 'panic_on_ue' */
|
/* 'panic_on_ue' */
|
||||||
static ssize_t edac_device_ctl_panic_on_ue_show(
|
static ssize_t edac_device_ctl_panic_on_ue_show(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *ctl_info, char *data)
|
*ctl_info, char *data)
|
||||||
{
|
{
|
||||||
return sprintf(data, "%u\n", ctl_info->panic_on_ue);
|
return sprintf(data, "%u\n", ctl_info->panic_on_ue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t edac_device_ctl_panic_on_ue_store(
|
static ssize_t edac_device_ctl_panic_on_ue_store(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *ctl_info,
|
*ctl_info, const char *data,
|
||||||
const char *data,size_t count)
|
size_t count)
|
||||||
{
|
{
|
||||||
/* if parameter is zero, turn off flag, if non-zero turn on flag */
|
/* if parameter is zero, turn off flag, if non-zero turn on flag */
|
||||||
ctl_info->panic_on_ue = (simple_strtoul(data, NULL, 0) != 0);
|
ctl_info->panic_on_ue = (simple_strtoul(data, NULL, 0) != 0);
|
||||||
@ -191,15 +186,15 @@ static ssize_t edac_device_ctl_panic_on_ue_store(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 'poll_msec' show and store functions*/
|
/* 'poll_msec' show and store functions*/
|
||||||
static ssize_t edac_device_ctl_poll_msec_show(
|
static ssize_t edac_device_ctl_poll_msec_show(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *ctl_info, char *data)
|
*ctl_info, char *data)
|
||||||
{
|
{
|
||||||
return sprintf(data, "%u\n", ctl_info->poll_msec);
|
return sprintf(data, "%u\n", ctl_info->poll_msec);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t edac_device_ctl_poll_msec_store(
|
static ssize_t edac_device_ctl_poll_msec_store(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *ctl_info,
|
*ctl_info, const char *data,
|
||||||
const char *data,size_t count)
|
size_t count)
|
||||||
{
|
{
|
||||||
unsigned long value;
|
unsigned long value;
|
||||||
|
|
||||||
@ -214,7 +209,6 @@ static ssize_t edac_device_ctl_poll_msec_store(
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* edac_device_ctl_info specific attribute structure */
|
/* edac_device_ctl_info specific attribute structure */
|
||||||
struct ctl_info_attribute {
|
struct ctl_info_attribute {
|
||||||
struct attribute attr;
|
struct attribute attr;
|
||||||
@ -227,8 +221,7 @@ struct ctl_info_attribute {
|
|||||||
|
|
||||||
/* Function to 'show' fields from the edac_dev 'ctl_info' structure */
|
/* Function to 'show' fields from the edac_dev 'ctl_info' structure */
|
||||||
static ssize_t edac_dev_ctl_info_show(struct kobject *kobj,
|
static ssize_t edac_dev_ctl_info_show(struct kobject *kobj,
|
||||||
struct attribute *attr,
|
struct attribute *attr, char *buffer)
|
||||||
char *buffer)
|
|
||||||
{
|
{
|
||||||
struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj);
|
struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj);
|
||||||
struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr);
|
struct ctl_info_attribute *ctl_info_attr = to_ctl_info_attr(attr);
|
||||||
@ -264,21 +257,16 @@ static struct ctl_info_attribute attr_ctl_info_##_name = { \
|
|||||||
.store = _store, \
|
.store = _store, \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Declare the various ctl_info attributes here and their respective ops */
|
/* Declare the various ctl_info attributes here and their respective ops */
|
||||||
CTL_INFO_ATTR(log_ue, S_IRUGO | S_IWUSR,
|
CTL_INFO_ATTR(log_ue, S_IRUGO | S_IWUSR,
|
||||||
edac_device_ctl_log_ue_show,
|
edac_device_ctl_log_ue_show, edac_device_ctl_log_ue_store);
|
||||||
edac_device_ctl_log_ue_store);
|
|
||||||
CTL_INFO_ATTR(log_ce, S_IRUGO | S_IWUSR,
|
CTL_INFO_ATTR(log_ce, S_IRUGO | S_IWUSR,
|
||||||
edac_device_ctl_log_ce_show,
|
edac_device_ctl_log_ce_show, edac_device_ctl_log_ce_store);
|
||||||
edac_device_ctl_log_ce_store);
|
|
||||||
CTL_INFO_ATTR(panic_on_ue, S_IRUGO | S_IWUSR,
|
CTL_INFO_ATTR(panic_on_ue, S_IRUGO | S_IWUSR,
|
||||||
edac_device_ctl_panic_on_ue_show,
|
edac_device_ctl_panic_on_ue_show,
|
||||||
edac_device_ctl_panic_on_ue_store);
|
edac_device_ctl_panic_on_ue_store);
|
||||||
CTL_INFO_ATTR(poll_msec, S_IRUGO | S_IWUSR,
|
CTL_INFO_ATTR(poll_msec, S_IRUGO | S_IWUSR,
|
||||||
edac_device_ctl_poll_msec_show,
|
edac_device_ctl_poll_msec_show, edac_device_ctl_poll_msec_store);
|
||||||
edac_device_ctl_poll_msec_store);
|
|
||||||
|
|
||||||
|
|
||||||
/* Base Attributes of the EDAC_DEVICE ECC object */
|
/* Base Attributes of the EDAC_DEVICE ECC object */
|
||||||
static struct ctl_info_attribute *device_ctrl_attr[] = {
|
static struct ctl_info_attribute *device_ctrl_attr[] = {
|
||||||
@ -306,7 +294,6 @@ static struct kobj_type ktype_device_ctrl = {
|
|||||||
.default_attrs = (struct attribute **)device_ctrl_attr,
|
.default_attrs = (struct attribute **)device_ctrl_attr,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**************** edac_device main kobj ctor/dtor code *********************/
|
/**************** edac_device main kobj ctor/dtor code *********************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -317,8 +304,7 @@ static struct kobj_type ktype_device_ctrl = {
|
|||||||
* Return: 0 SUCCESS
|
* Return: 0 SUCCESS
|
||||||
* !0 FAILURE
|
* !0 FAILURE
|
||||||
*/
|
*/
|
||||||
static int edac_device_register_main_kobj(
|
static int edac_device_register_main_kobj(struct edac_device_ctl_info *edac_dev)
|
||||||
struct edac_device_ctl_info *edac_dev)
|
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
struct sysdev_class *edac_class;
|
struct sysdev_class *edac_class;
|
||||||
@ -343,8 +329,7 @@ static int edac_device_register_main_kobj(
|
|||||||
edac_dev->kobj.parent = &edac_class->kset.kobj;
|
edac_dev->kobj.parent = &edac_class->kset.kobj;
|
||||||
|
|
||||||
/* generate sysfs "..../edac/<name>" */
|
/* generate sysfs "..../edac/<name>" */
|
||||||
debugf1("%s() set name of kobject to: %s\n",
|
debugf1("%s() set name of kobject to: %s\n", __func__, edac_dev->name);
|
||||||
__func__, edac_dev->name);
|
|
||||||
err = kobject_set_name(&edac_dev->kobj, "%s", edac_dev->name);
|
err = kobject_set_name(&edac_dev->kobj, "%s", edac_dev->name);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
@ -365,8 +350,8 @@ static int edac_device_register_main_kobj(
|
|||||||
* edac_device_unregister_main_kobj:
|
* edac_device_unregister_main_kobj:
|
||||||
* the '..../edac/<name>' kobject
|
* the '..../edac/<name>' kobject
|
||||||
*/
|
*/
|
||||||
static void edac_device_unregister_main_kobj(
|
static void edac_device_unregister_main_kobj(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *edac_dev)
|
*edac_dev)
|
||||||
{
|
{
|
||||||
debugf0("%s()\n", __func__);
|
debugf0("%s()\n", __func__);
|
||||||
debugf1("%s() name of kobject is: %s\n",
|
debugf1("%s() name of kobject is: %s\n",
|
||||||
@ -382,26 +367,23 @@ static void edac_device_unregister_main_kobj(
|
|||||||
wait_for_completion(&edac_dev->kobj_complete);
|
wait_for_completion(&edac_dev->kobj_complete);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************** edac_dev -> instance information ***********/
|
/*************** edac_dev -> instance information ***********/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set of low-level instance attribute show functions
|
* Set of low-level instance attribute show functions
|
||||||
*/
|
*/
|
||||||
static ssize_t instance_ue_count_show(
|
static ssize_t instance_ue_count_show(struct edac_device_instance *instance,
|
||||||
struct edac_device_instance *instance, char *data)
|
char *data)
|
||||||
{
|
{
|
||||||
return sprintf(data, "%u\n", instance->counters.ue_count);
|
return sprintf(data, "%u\n", instance->counters.ue_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t instance_ce_count_show(
|
static ssize_t instance_ce_count_show(struct edac_device_instance *instance,
|
||||||
struct edac_device_instance *instance, char *data)
|
char *data)
|
||||||
{
|
{
|
||||||
return sprintf(data, "%u\n", instance->counters.ce_count);
|
return sprintf(data, "%u\n", instance->counters.ce_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define to_instance(k) container_of(k, struct edac_device_instance, kobj)
|
#define to_instance(k) container_of(k, struct edac_device_instance, kobj)
|
||||||
#define to_instance_attr(a) container_of(a,struct instance_attribute,attr)
|
#define to_instance_attr(a) container_of(a,struct instance_attribute,attr)
|
||||||
|
|
||||||
@ -416,7 +398,6 @@ static void edac_device_ctrl_instance_release(struct kobject *kobj)
|
|||||||
complete(&instance->kobj_complete);
|
complete(&instance->kobj_complete);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* instance specific attribute structure */
|
/* instance specific attribute structure */
|
||||||
struct instance_attribute {
|
struct instance_attribute {
|
||||||
struct attribute attr;
|
struct attribute attr;
|
||||||
@ -424,11 +405,9 @@ struct instance_attribute {
|
|||||||
ssize_t(*store) (struct edac_device_instance *, const char *, size_t);
|
ssize_t(*store) (struct edac_device_instance *, const char *, size_t);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Function to 'show' fields from the edac_dev 'instance' structure */
|
/* Function to 'show' fields from the edac_dev 'instance' structure */
|
||||||
static ssize_t edac_dev_instance_show(struct kobject *kobj,
|
static ssize_t edac_dev_instance_show(struct kobject *kobj,
|
||||||
struct attribute *attr,
|
struct attribute *attr, char *buffer)
|
||||||
char *buffer)
|
|
||||||
{
|
{
|
||||||
struct edac_device_instance *instance = to_instance(kobj);
|
struct edac_device_instance *instance = to_instance(kobj);
|
||||||
struct instance_attribute *instance_attr = to_instance_attr(attr);
|
struct instance_attribute *instance_attr = to_instance_attr(attr);
|
||||||
@ -438,7 +417,6 @@ static ssize_t edac_dev_instance_show(struct kobject *kobj,
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Function to 'store' fields into the edac_dev 'instance' structure */
|
/* Function to 'store' fields into the edac_dev 'instance' structure */
|
||||||
static ssize_t edac_dev_instance_store(struct kobject *kobj,
|
static ssize_t edac_dev_instance_store(struct kobject *kobj,
|
||||||
struct attribute *attr,
|
struct attribute *attr,
|
||||||
@ -452,8 +430,6 @@ static ssize_t edac_dev_instance_store(struct kobject *kobj,
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* edac_dev file operations for an 'instance' */
|
/* edac_dev file operations for an 'instance' */
|
||||||
static struct sysfs_ops device_instance_ops = {
|
static struct sysfs_ops device_instance_ops = {
|
||||||
.show = edac_dev_instance_show,
|
.show = edac_dev_instance_show,
|
||||||
@ -489,26 +465,21 @@ static struct kobj_type ktype_instance_ctrl = {
|
|||||||
.default_attrs = (struct attribute **)device_instance_attr,
|
.default_attrs = (struct attribute **)device_instance_attr,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*************** edac_dev -> instance -> block information *********/
|
/*************** edac_dev -> instance -> block information *********/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set of low-level block attribute show functions
|
* Set of low-level block attribute show functions
|
||||||
*/
|
*/
|
||||||
static ssize_t block_ue_count_show(
|
static ssize_t block_ue_count_show(struct edac_device_block *block, char *data)
|
||||||
struct edac_device_block *block, char *data)
|
|
||||||
{
|
{
|
||||||
return sprintf(data, "%u\n", block->counters.ue_count);
|
return sprintf(data, "%u\n", block->counters.ue_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t block_ce_count_show(
|
static ssize_t block_ce_count_show(struct edac_device_block *block, char *data)
|
||||||
struct edac_device_block *block, char *data)
|
|
||||||
{
|
{
|
||||||
return sprintf(data, "%u\n", block->counters.ce_count);
|
return sprintf(data, "%u\n", block->counters.ce_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define to_block(k) container_of(k, struct edac_device_block, kobj)
|
#define to_block(k) container_of(k, struct edac_device_block, kobj)
|
||||||
#define to_block_attr(a) container_of(a,struct block_attribute,attr)
|
#define to_block_attr(a) container_of(a,struct block_attribute,attr)
|
||||||
|
|
||||||
@ -532,8 +503,7 @@ struct block_attribute {
|
|||||||
|
|
||||||
/* Function to 'show' fields from the edac_dev 'block' structure */
|
/* Function to 'show' fields from the edac_dev 'block' structure */
|
||||||
static ssize_t edac_dev_block_show(struct kobject *kobj,
|
static ssize_t edac_dev_block_show(struct kobject *kobj,
|
||||||
struct attribute *attr,
|
struct attribute *attr, char *buffer)
|
||||||
char *buffer)
|
|
||||||
{
|
{
|
||||||
struct edac_device_block *block = to_block(kobj);
|
struct edac_device_block *block = to_block(kobj);
|
||||||
struct block_attribute *block_attr = to_block_attr(attr);
|
struct block_attribute *block_attr = to_block_attr(attr);
|
||||||
@ -543,7 +513,6 @@ static ssize_t edac_dev_block_show(struct kobject *kobj,
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Function to 'store' fields into the edac_dev 'block' structure */
|
/* Function to 'store' fields into the edac_dev 'block' structure */
|
||||||
static ssize_t edac_dev_block_store(struct kobject *kobj,
|
static ssize_t edac_dev_block_store(struct kobject *kobj,
|
||||||
struct attribute *attr,
|
struct attribute *attr,
|
||||||
@ -557,14 +526,12 @@ static ssize_t edac_dev_block_store(struct kobject *kobj,
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* edac_dev file operations for a 'block' */
|
/* edac_dev file operations for a 'block' */
|
||||||
static struct sysfs_ops device_block_ops = {
|
static struct sysfs_ops device_block_ops = {
|
||||||
.show = edac_dev_block_show,
|
.show = edac_dev_block_show,
|
||||||
.store = edac_dev_block_store
|
.store = edac_dev_block_store
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define BLOCK_ATTR(_name,_mode,_show,_store) \
|
#define BLOCK_ATTR(_name,_mode,_show,_store) \
|
||||||
static struct block_attribute attr_block_##_name = { \
|
static struct block_attribute attr_block_##_name = { \
|
||||||
.attr = {.name = __stringify(_name), .mode = _mode }, \
|
.attr = {.name = __stringify(_name), .mode = _mode }, \
|
||||||
@ -575,7 +542,6 @@ static struct block_attribute attr_block_##_name = { \
|
|||||||
BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL);
|
BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL);
|
||||||
BLOCK_ATTR(ue_count, S_IRUGO, block_ue_count_show, NULL);
|
BLOCK_ATTR(ue_count, S_IRUGO, block_ue_count_show, NULL);
|
||||||
|
|
||||||
|
|
||||||
/* list of edac_dev 'block' attributes */
|
/* list of edac_dev 'block' attributes */
|
||||||
static struct block_attribute *device_block_attr[] = {
|
static struct block_attribute *device_block_attr[] = {
|
||||||
&attr_block_ce_count,
|
&attr_block_ce_count,
|
||||||
@ -590,14 +556,12 @@ static struct kobj_type ktype_block_ctrl = {
|
|||||||
.default_attrs = (struct attribute **)device_block_attr,
|
.default_attrs = (struct attribute **)device_block_attr,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/************** block ctor/dtor code ************/
|
/************** block ctor/dtor code ************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* edac_device_create_block
|
* edac_device_create_block
|
||||||
*/
|
*/
|
||||||
static int edac_device_create_block(
|
static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
|
||||||
struct edac_device_ctl_info *edac_dev,
|
|
||||||
struct edac_device_instance *instance,
|
struct edac_device_instance *instance,
|
||||||
int idx)
|
int idx)
|
||||||
{
|
{
|
||||||
@ -631,8 +595,7 @@ static int edac_device_create_block(
|
|||||||
/*
|
/*
|
||||||
* edac_device_delete_block(edac_dev,j);
|
* edac_device_delete_block(edac_dev,j);
|
||||||
*/
|
*/
|
||||||
static void edac_device_delete_block(
|
static void edac_device_delete_block(struct edac_device_ctl_info *edac_dev,
|
||||||
struct edac_device_ctl_info *edac_dev,
|
|
||||||
struct edac_device_instance *instance,
|
struct edac_device_instance *instance,
|
||||||
int idx)
|
int idx)
|
||||||
{
|
{
|
||||||
@ -652,8 +615,8 @@ static void edac_device_delete_block(
|
|||||||
* edac_device_create_instance
|
* edac_device_create_instance
|
||||||
* create just one instance of an edac_device 'instance'
|
* create just one instance of an edac_device 'instance'
|
||||||
*/
|
*/
|
||||||
static int edac_device_create_instance(
|
static int edac_device_create_instance(struct edac_device_ctl_info *edac_dev,
|
||||||
struct edac_device_ctl_info *edac_dev, int idx)
|
int idx)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
int err;
|
int err;
|
||||||
@ -703,8 +666,8 @@ static int edac_device_create_instance(
|
|||||||
* edac_device_remove_instance
|
* edac_device_remove_instance
|
||||||
* remove an edac_device instance
|
* remove an edac_device instance
|
||||||
*/
|
*/
|
||||||
static void edac_device_delete_instance(
|
static void edac_device_delete_instance(struct edac_device_ctl_info *edac_dev,
|
||||||
struct edac_device_ctl_info *edac_dev, int idx)
|
int idx)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct edac_device_instance *instance;
|
struct edac_device_instance *instance;
|
||||||
@ -790,8 +753,7 @@ int edac_device_create_sysfs(struct edac_device_ctl_info *edac_dev)
|
|||||||
* to the platform 'device' being used for this
|
* to the platform 'device' being used for this
|
||||||
*/
|
*/
|
||||||
err = sysfs_create_link(edac_kobj,
|
err = sysfs_create_link(edac_kobj,
|
||||||
&edac_dev->dev->kobj,
|
&edac_dev->dev->kobj, EDAC_DEVICE_SYMLINK);
|
||||||
EDAC_DEVICE_SYMLINK);
|
|
||||||
if (err) {
|
if (err) {
|
||||||
debugf0("%s() sysfs_create_link() returned err= %d\n",
|
debugf0("%s() sysfs_create_link() returned err= %d\n",
|
||||||
__func__, err);
|
__func__, err);
|
||||||
@ -834,4 +796,3 @@ void edac_device_remove_sysfs(struct edac_device_ctl_info *edac_dev)
|
|||||||
/* unregister the instance's main kobj */
|
/* unregister the instance's main kobj */
|
||||||
edac_device_unregister_main_kobj(edac_dev);
|
edac_device_unregister_main_kobj(edac_dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include "edac_core.h"
|
#include "edac_core.h"
|
||||||
#include "edac_module.h"
|
#include "edac_module.h"
|
||||||
|
|
||||||
|
|
||||||
/* lock to memory controller's control array */
|
/* lock to memory controller's control array */
|
||||||
static DEFINE_MUTEX(mem_ctls_mutex);
|
static DEFINE_MUTEX(mem_ctls_mutex);
|
||||||
static struct list_head mc_devices = LIST_HEAD_INIT(mc_devices);
|
static struct list_head mc_devices = LIST_HEAD_INIT(mc_devices);
|
||||||
@ -54,13 +53,11 @@ static void edac_mc_dump_csrow(struct csrow_info *csrow)
|
|||||||
{
|
{
|
||||||
debugf4("\tcsrow = %p\n", csrow);
|
debugf4("\tcsrow = %p\n", csrow);
|
||||||
debugf4("\tcsrow->csrow_idx = %d\n", csrow->csrow_idx);
|
debugf4("\tcsrow->csrow_idx = %d\n", csrow->csrow_idx);
|
||||||
debugf4("\tcsrow->first_page = 0x%lx\n",
|
debugf4("\tcsrow->first_page = 0x%lx\n", csrow->first_page);
|
||||||
csrow->first_page);
|
|
||||||
debugf4("\tcsrow->last_page = 0x%lx\n", csrow->last_page);
|
debugf4("\tcsrow->last_page = 0x%lx\n", csrow->last_page);
|
||||||
debugf4("\tcsrow->page_mask = 0x%lx\n", csrow->page_mask);
|
debugf4("\tcsrow->page_mask = 0x%lx\n", csrow->page_mask);
|
||||||
debugf4("\tcsrow->nr_pages = 0x%x\n", csrow->nr_pages);
|
debugf4("\tcsrow->nr_pages = 0x%x\n", csrow->nr_pages);
|
||||||
debugf4("\tcsrow->nr_channels = %d\n",
|
debugf4("\tcsrow->nr_channels = %d\n", csrow->nr_channels);
|
||||||
csrow->nr_channels);
|
|
||||||
debugf4("\tcsrow->channels = %p\n", csrow->channels);
|
debugf4("\tcsrow->channels = %p\n", csrow->channels);
|
||||||
debugf4("\tcsrow->mci = %p\n\n", csrow->mci);
|
debugf4("\tcsrow->mci = %p\n\n", csrow->mci);
|
||||||
}
|
}
|
||||||
@ -75,8 +72,7 @@ static void edac_mc_dump_mci(struct mem_ctl_info *mci)
|
|||||||
debugf3("\tmci->nr_csrows = %d, csrows = %p\n",
|
debugf3("\tmci->nr_csrows = %d, csrows = %p\n",
|
||||||
mci->nr_csrows, mci->csrows);
|
mci->nr_csrows, mci->csrows);
|
||||||
debugf3("\tdev = %p\n", mci->dev);
|
debugf3("\tdev = %p\n", mci->dev);
|
||||||
debugf3("\tmod_name:ctl_name = %s:%s\n",
|
debugf3("\tmod_name:ctl_name = %s:%s\n", mci->mod_name, mci->ctl_name);
|
||||||
mci->mod_name, mci->ctl_name);
|
|
||||||
debugf3("\tpvt_info = %p\n\n", mci->pvt_info);
|
debugf3("\tpvt_info = %p\n\n", mci->pvt_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,6 +184,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
|
|||||||
|
|
||||||
return mci;
|
return mci;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_mc_alloc);
|
EXPORT_SYMBOL_GPL(edac_mc_alloc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -198,6 +195,7 @@ void edac_mc_free(struct mem_ctl_info *mci)
|
|||||||
{
|
{
|
||||||
kfree(mci);
|
kfree(mci);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_mc_free);
|
EXPORT_SYMBOL_GPL(edac_mc_free);
|
||||||
|
|
||||||
static struct mem_ctl_info *find_mci_by_dev(struct device *dev)
|
static struct mem_ctl_info *find_mci_by_dev(struct device *dev)
|
||||||
@ -403,6 +401,7 @@ struct mem_ctl_info * edac_mc_find(int idx)
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(edac_mc_find);
|
EXPORT_SYMBOL(edac_mc_find);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -433,8 +432,8 @@ int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx)
|
|||||||
|
|
||||||
edac_mc_dump_csrow(&mci->csrows[i]);
|
edac_mc_dump_csrow(&mci->csrows[i]);
|
||||||
for (j = 0; j < mci->csrows[i].nr_channels; j++)
|
for (j = 0; j < mci->csrows[i].nr_channels; j++)
|
||||||
edac_mc_dump_channel(
|
edac_mc_dump_channel(&mci->csrows[i].
|
||||||
&mci->csrows[i].channels[j]);
|
channels[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -476,6 +475,7 @@ fail0:
|
|||||||
mutex_unlock(&mem_ctls_mutex);
|
mutex_unlock(&mem_ctls_mutex);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_mc_add_mc);
|
EXPORT_SYMBOL_GPL(edac_mc_add_mc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -511,6 +511,7 @@ struct mem_ctl_info * edac_mc_del_mc(struct device *dev)
|
|||||||
mci->mod_name, mci->ctl_name, dev_name(mci));
|
mci->mod_name, mci->ctl_name, dev_name(mci));
|
||||||
return mci;
|
return mci;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_mc_del_mc);
|
EXPORT_SYMBOL_GPL(edac_mc_del_mc);
|
||||||
|
|
||||||
static void edac_mc_scrub_block(unsigned long page, unsigned long offset,
|
static void edac_mc_scrub_block(unsigned long page, unsigned long offset,
|
||||||
@ -580,13 +581,15 @@ int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, unsigned long page)
|
|||||||
|
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_mc_find_csrow_by_page);
|
EXPORT_SYMBOL_GPL(edac_mc_find_csrow_by_page);
|
||||||
|
|
||||||
/* FIXME - setable log (warning/emerg) levels */
|
/* FIXME - setable log (warning/emerg) levels */
|
||||||
/* FIXME - integrate with evlog: http://evlog.sourceforge.net/ */
|
/* FIXME - integrate with evlog: http://evlog.sourceforge.net/ */
|
||||||
void edac_mc_handle_ce(struct mem_ctl_info *mci,
|
void edac_mc_handle_ce(struct mem_ctl_info *mci,
|
||||||
unsigned long page_frame_number, unsigned long offset_in_page,
|
unsigned long page_frame_number,
|
||||||
unsigned long syndrome, int row, int channel, const char *msg)
|
unsigned long offset_in_page, unsigned long syndrome,
|
||||||
|
int row, int channel, const char *msg)
|
||||||
{
|
{
|
||||||
unsigned long remapped_page;
|
unsigned long remapped_page;
|
||||||
|
|
||||||
@ -643,6 +646,7 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci,
|
|||||||
mci->csrows[row].grain);
|
mci->csrows[row].grain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_mc_handle_ce);
|
EXPORT_SYMBOL_GPL(edac_mc_handle_ce);
|
||||||
|
|
||||||
void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, const char *msg)
|
void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, const char *msg)
|
||||||
@ -654,11 +658,12 @@ void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, const char *msg)
|
|||||||
mci->ce_noinfo_count++;
|
mci->ce_noinfo_count++;
|
||||||
mci->ce_count++;
|
mci->ce_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_mc_handle_ce_no_info);
|
EXPORT_SYMBOL_GPL(edac_mc_handle_ce_no_info);
|
||||||
|
|
||||||
void edac_mc_handle_ue(struct mem_ctl_info *mci,
|
void edac_mc_handle_ue(struct mem_ctl_info *mci,
|
||||||
unsigned long page_frame_number, unsigned long offset_in_page,
|
unsigned long page_frame_number,
|
||||||
int row, const char *msg)
|
unsigned long offset_in_page, int row, const char *msg)
|
||||||
{
|
{
|
||||||
int len = EDAC_MC_LABEL_LEN * 4;
|
int len = EDAC_MC_LABEL_LEN * 4;
|
||||||
char labels[len + 1];
|
char labels[len + 1];
|
||||||
@ -695,8 +700,8 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci,
|
|||||||
edac_mc_printk(mci, KERN_EMERG,
|
edac_mc_printk(mci, KERN_EMERG,
|
||||||
"UE page 0x%lx, offset 0x%lx, grain %d, row %d, "
|
"UE page 0x%lx, offset 0x%lx, grain %d, row %d, "
|
||||||
"labels \"%s\": %s\n", page_frame_number,
|
"labels \"%s\": %s\n", page_frame_number,
|
||||||
offset_in_page, mci->csrows[row].grain, row, labels,
|
offset_in_page, mci->csrows[row].grain, row,
|
||||||
msg);
|
labels, msg);
|
||||||
|
|
||||||
if (edac_mc_get_panic_on_ue())
|
if (edac_mc_get_panic_on_ue())
|
||||||
panic("EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, "
|
panic("EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, "
|
||||||
@ -707,6 +712,7 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci,
|
|||||||
mci->ue_count++;
|
mci->ue_count++;
|
||||||
mci->csrows[row].ue_count++;
|
mci->csrows[row].ue_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_mc_handle_ue);
|
EXPORT_SYMBOL_GPL(edac_mc_handle_ue);
|
||||||
|
|
||||||
void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg)
|
void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg)
|
||||||
@ -720,8 +726,8 @@ void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg)
|
|||||||
mci->ue_noinfo_count++;
|
mci->ue_noinfo_count++;
|
||||||
mci->ue_count++;
|
mci->ue_count++;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(edac_mc_handle_ue_no_info);
|
|
||||||
|
|
||||||
|
EXPORT_SYMBOL_GPL(edac_mc_handle_ue_no_info);
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
* On Fully Buffered DIMM modules, this help function is
|
* On Fully Buffered DIMM modules, this help function is
|
||||||
@ -730,8 +736,7 @@ EXPORT_SYMBOL_GPL(edac_mc_handle_ue_no_info);
|
|||||||
void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
|
void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
|
||||||
unsigned int csrow,
|
unsigned int csrow,
|
||||||
unsigned int channela,
|
unsigned int channela,
|
||||||
unsigned int channelb,
|
unsigned int channelb, char *msg)
|
||||||
char *msg)
|
|
||||||
{
|
{
|
||||||
int len = EDAC_MC_LABEL_LEN * 4;
|
int len = EDAC_MC_LABEL_LEN * 4;
|
||||||
char labels[len + 1];
|
char labels[len + 1];
|
||||||
@ -773,7 +778,8 @@ void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
|
|||||||
/* Generate the DIMM labels from the specified channels */
|
/* Generate the DIMM labels from the specified channels */
|
||||||
chars = snprintf(pos, len + 1, "%s",
|
chars = snprintf(pos, len + 1, "%s",
|
||||||
mci->csrows[csrow].channels[channela].label);
|
mci->csrows[csrow].channels[channela].label);
|
||||||
len -= chars; pos += chars;
|
len -= chars;
|
||||||
|
pos += chars;
|
||||||
chars = snprintf(pos, len + 1, "-%s",
|
chars = snprintf(pos, len + 1, "-%s",
|
||||||
mci->csrows[csrow].channels[channelb].label);
|
mci->csrows[csrow].channels[channelb].label);
|
||||||
|
|
||||||
@ -788,6 +794,7 @@ void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
|
|||||||
"labels \"%s\": %s\n", csrow, channela,
|
"labels \"%s\": %s\n", csrow, channela,
|
||||||
channelb, labels, msg);
|
channelb, labels, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(edac_mc_handle_fbd_ue);
|
EXPORT_SYMBOL(edac_mc_handle_fbd_ue);
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
@ -795,9 +802,7 @@ EXPORT_SYMBOL(edac_mc_handle_fbd_ue);
|
|||||||
* called to process CE events
|
* called to process CE events
|
||||||
*/
|
*/
|
||||||
void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
|
void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
|
||||||
unsigned int csrow,
|
unsigned int csrow, unsigned int channel, char *msg)
|
||||||
unsigned int channel,
|
|
||||||
char *msg)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Ensure boundary values */
|
/* Ensure boundary values */
|
||||||
@ -823,15 +828,14 @@ void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
|
|||||||
edac_mc_printk(mci, KERN_WARNING,
|
edac_mc_printk(mci, KERN_WARNING,
|
||||||
"CE row %d, channel %d, label \"%s\": %s\n",
|
"CE row %d, channel %d, label \"%s\": %s\n",
|
||||||
csrow, channel,
|
csrow, channel,
|
||||||
mci->csrows[csrow].channels[channel].label,
|
mci->csrows[csrow].channels[channel].label, msg);
|
||||||
msg);
|
|
||||||
|
|
||||||
mci->ce_count++;
|
mci->ce_count++;
|
||||||
mci->csrows[csrow].ce_count++;
|
mci->csrows[csrow].ce_count++;
|
||||||
mci->csrows[csrow].channels[channel].ce_count++;
|
mci->csrows[csrow].channels[channel].ce_count++;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(edac_mc_handle_fbd_ce);
|
|
||||||
|
|
||||||
|
EXPORT_SYMBOL(edac_mc_handle_fbd_ce);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iterate over all MC instances and check for ECC, et al, errors
|
* Iterate over all MC instances and check for ECC, et al, errors
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Older .h file for edac, until all drivers are modified
|
* Older .h file for edac, until all drivers are modified
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "edac_core.h"
|
#include "edac_core.h"
|
||||||
|
|
||||||
|
@ -55,7 +55,6 @@ MODULE_PARM_DESC(edac_mc_log_ce,
|
|||||||
module_param(edac_mc_poll_msec, int, 0644);
|
module_param(edac_mc_poll_msec, int, 0644);
|
||||||
MODULE_PARM_DESC(edac_mc_poll_msec, "Polling period in milliseconds");
|
MODULE_PARM_DESC(edac_mc_poll_msec, "Polling period in milliseconds");
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* various constants for Memory Controllers
|
* various constants for Memory Controllers
|
||||||
*/
|
*/
|
||||||
@ -185,24 +184,16 @@ static struct memctrl_dev_attribute attr_##_name = { \
|
|||||||
|
|
||||||
/* csrow<id> control files */
|
/* csrow<id> control files */
|
||||||
MEMCTRL_ATTR(edac_mc_panic_on_ue,
|
MEMCTRL_ATTR(edac_mc_panic_on_ue,
|
||||||
S_IRUGO | S_IWUSR,
|
S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
|
||||||
memctrl_int_show,
|
|
||||||
memctrl_int_store);
|
|
||||||
|
|
||||||
MEMCTRL_ATTR(edac_mc_log_ue,
|
MEMCTRL_ATTR(edac_mc_log_ue,
|
||||||
S_IRUGO|S_IWUSR,
|
S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
|
||||||
memctrl_int_show,
|
|
||||||
memctrl_int_store);
|
|
||||||
|
|
||||||
MEMCTRL_ATTR(edac_mc_log_ce,
|
MEMCTRL_ATTR(edac_mc_log_ce,
|
||||||
S_IRUGO|S_IWUSR,
|
S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
|
||||||
memctrl_int_show,
|
|
||||||
memctrl_int_store);
|
|
||||||
|
|
||||||
MEMCTRL_ATTR(edac_mc_poll_msec,
|
MEMCTRL_ATTR(edac_mc_poll_msec,
|
||||||
S_IRUGO|S_IWUSR,
|
S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store);
|
||||||
memctrl_int_show,
|
|
||||||
memctrl_int_store);
|
|
||||||
|
|
||||||
/* Base Attributes of the memory ECC object */
|
/* Base Attributes of the memory ECC object */
|
||||||
static struct memctrl_dev_attribute *memctrl_attr[] = {
|
static struct memctrl_dev_attribute *memctrl_attr[] = {
|
||||||
@ -286,7 +277,6 @@ void edac_sysfs_memctrl_teardown(void)
|
|||||||
wait_for_completion(&edac_memctrl_kobj_complete);
|
wait_for_completion(&edac_memctrl_kobj_complete);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EDAC sysfs CSROW data structures and methods
|
/* EDAC sysfs CSROW data structures and methods
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -337,8 +327,7 @@ static ssize_t channel_dimm_label_show(struct csrow_info *csrow,
|
|||||||
|
|
||||||
static ssize_t channel_dimm_label_store(struct csrow_info *csrow,
|
static ssize_t channel_dimm_label_store(struct csrow_info *csrow,
|
||||||
const char *data,
|
const char *data,
|
||||||
size_t count,
|
size_t count, int channel)
|
||||||
int channel)
|
|
||||||
{
|
{
|
||||||
ssize_t max_size = 0;
|
ssize_t max_size = 0;
|
||||||
|
|
||||||
@ -351,8 +340,7 @@ static ssize_t channel_dimm_label_store(struct csrow_info *csrow,
|
|||||||
|
|
||||||
/* show function for dynamic chX_ce_count attribute */
|
/* show function for dynamic chX_ce_count attribute */
|
||||||
static ssize_t channel_ce_count_show(struct csrow_info *csrow,
|
static ssize_t channel_ce_count_show(struct csrow_info *csrow,
|
||||||
char *data,
|
char *data, int channel)
|
||||||
int channel)
|
|
||||||
{
|
{
|
||||||
return sprintf(data, "%u\n", csrow->channels[channel].ce_count);
|
return sprintf(data, "%u\n", csrow->channels[channel].ce_count);
|
||||||
}
|
}
|
||||||
@ -370,16 +358,14 @@ struct csrowdev_attribute {
|
|||||||
|
|
||||||
/* Set of show/store higher level functions for default csrow attributes */
|
/* Set of show/store higher level functions for default csrow attributes */
|
||||||
static ssize_t csrowdev_show(struct kobject *kobj,
|
static ssize_t csrowdev_show(struct kobject *kobj,
|
||||||
struct attribute *attr,
|
struct attribute *attr, char *buffer)
|
||||||
char *buffer)
|
|
||||||
{
|
{
|
||||||
struct csrow_info *csrow = to_csrow(kobj);
|
struct csrow_info *csrow = to_csrow(kobj);
|
||||||
struct csrowdev_attribute *csrowdev_attr = to_csrowdev_attr(attr);
|
struct csrowdev_attribute *csrowdev_attr = to_csrowdev_attr(attr);
|
||||||
|
|
||||||
if (csrowdev_attr->show)
|
if (csrowdev_attr->show)
|
||||||
return csrowdev_attr->show(csrow,
|
return csrowdev_attr->show(csrow,
|
||||||
buffer,
|
buffer, csrowdev_attr->private);
|
||||||
csrowdev_attr->private);
|
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,8 +378,7 @@ static ssize_t csrowdev_store(struct kobject *kobj, struct attribute *attr,
|
|||||||
if (csrowdev_attr->store)
|
if (csrowdev_attr->store)
|
||||||
return csrowdev_attr->store(csrow,
|
return csrowdev_attr->store(csrow,
|
||||||
buffer,
|
buffer,
|
||||||
count,
|
count, csrowdev_attr->private);
|
||||||
csrowdev_attr->private);
|
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,32 +414,19 @@ static struct csrowdev_attribute *default_csrow_attr[] = {
|
|||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* possible dynamic channel DIMM Label attribute files */
|
/* possible dynamic channel DIMM Label attribute files */
|
||||||
CSROWDEV_ATTR(ch0_dimm_label, S_IRUGO | S_IWUSR,
|
CSROWDEV_ATTR(ch0_dimm_label, S_IRUGO | S_IWUSR,
|
||||||
channel_dimm_label_show,
|
channel_dimm_label_show, channel_dimm_label_store, 0);
|
||||||
channel_dimm_label_store,
|
|
||||||
0 );
|
|
||||||
CSROWDEV_ATTR(ch1_dimm_label, S_IRUGO | S_IWUSR,
|
CSROWDEV_ATTR(ch1_dimm_label, S_IRUGO | S_IWUSR,
|
||||||
channel_dimm_label_show,
|
channel_dimm_label_show, channel_dimm_label_store, 1);
|
||||||
channel_dimm_label_store,
|
|
||||||
1 );
|
|
||||||
CSROWDEV_ATTR(ch2_dimm_label, S_IRUGO | S_IWUSR,
|
CSROWDEV_ATTR(ch2_dimm_label, S_IRUGO | S_IWUSR,
|
||||||
channel_dimm_label_show,
|
channel_dimm_label_show, channel_dimm_label_store, 2);
|
||||||
channel_dimm_label_store,
|
|
||||||
2 );
|
|
||||||
CSROWDEV_ATTR(ch3_dimm_label, S_IRUGO | S_IWUSR,
|
CSROWDEV_ATTR(ch3_dimm_label, S_IRUGO | S_IWUSR,
|
||||||
channel_dimm_label_show,
|
channel_dimm_label_show, channel_dimm_label_store, 3);
|
||||||
channel_dimm_label_store,
|
|
||||||
3 );
|
|
||||||
CSROWDEV_ATTR(ch4_dimm_label, S_IRUGO | S_IWUSR,
|
CSROWDEV_ATTR(ch4_dimm_label, S_IRUGO | S_IWUSR,
|
||||||
channel_dimm_label_show,
|
channel_dimm_label_show, channel_dimm_label_store, 4);
|
||||||
channel_dimm_label_store,
|
|
||||||
4 );
|
|
||||||
CSROWDEV_ATTR(ch5_dimm_label, S_IRUGO | S_IWUSR,
|
CSROWDEV_ATTR(ch5_dimm_label, S_IRUGO | S_IWUSR,
|
||||||
channel_dimm_label_show,
|
channel_dimm_label_show, channel_dimm_label_store, 5);
|
||||||
channel_dimm_label_store,
|
|
||||||
5 );
|
|
||||||
|
|
||||||
/* Total possible dynamic DIMM Label attribute file table */
|
/* Total possible dynamic DIMM Label attribute file table */
|
||||||
static struct csrowdev_attribute *dynamic_csrow_dimm_attr[] = {
|
static struct csrowdev_attribute *dynamic_csrow_dimm_attr[] = {
|
||||||
@ -467,30 +439,12 @@ static struct csrowdev_attribute *dynamic_csrow_dimm_attr[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* possible dynamic channel ce_count attribute files */
|
/* possible dynamic channel ce_count attribute files */
|
||||||
CSROWDEV_ATTR(ch0_ce_count,S_IRUGO|S_IWUSR,
|
CSROWDEV_ATTR(ch0_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 0);
|
||||||
channel_ce_count_show,
|
CSROWDEV_ATTR(ch1_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 1);
|
||||||
NULL,
|
CSROWDEV_ATTR(ch2_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 2);
|
||||||
0 );
|
CSROWDEV_ATTR(ch3_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 3);
|
||||||
CSROWDEV_ATTR(ch1_ce_count,S_IRUGO|S_IWUSR,
|
CSROWDEV_ATTR(ch4_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 4);
|
||||||
channel_ce_count_show,
|
CSROWDEV_ATTR(ch5_ce_count, S_IRUGO | S_IWUSR, channel_ce_count_show, NULL, 5);
|
||||||
NULL,
|
|
||||||
1 );
|
|
||||||
CSROWDEV_ATTR(ch2_ce_count,S_IRUGO|S_IWUSR,
|
|
||||||
channel_ce_count_show,
|
|
||||||
NULL,
|
|
||||||
2 );
|
|
||||||
CSROWDEV_ATTR(ch3_ce_count,S_IRUGO|S_IWUSR,
|
|
||||||
channel_ce_count_show,
|
|
||||||
NULL,
|
|
||||||
3 );
|
|
||||||
CSROWDEV_ATTR(ch4_ce_count,S_IRUGO|S_IWUSR,
|
|
||||||
channel_ce_count_show,
|
|
||||||
NULL,
|
|
||||||
4 );
|
|
||||||
CSROWDEV_ATTR(ch5_ce_count,S_IRUGO|S_IWUSR,
|
|
||||||
channel_ce_count_show,
|
|
||||||
NULL,
|
|
||||||
5 );
|
|
||||||
|
|
||||||
/* Total possible dynamic ce_count attribute file table */
|
/* Total possible dynamic ce_count attribute file table */
|
||||||
static struct csrowdev_attribute *dynamic_csrow_ce_count_attr[] = {
|
static struct csrowdev_attribute *dynamic_csrow_ce_count_attr[] = {
|
||||||
@ -502,7 +456,6 @@ static struct csrowdev_attribute *dynamic_csrow_ce_count_attr[] = {
|
|||||||
&attr_ch5_ce_count
|
&attr_ch5_ce_count
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define EDAC_NR_CHANNELS 6
|
#define EDAC_NR_CHANNELS 6
|
||||||
|
|
||||||
/* Create dynamic CHANNEL files, indexed by 'chan', under specifed CSROW */
|
/* Create dynamic CHANNEL files, indexed by 'chan', under specifed CSROW */
|
||||||
@ -515,12 +468,14 @@ static int edac_create_channel_files(struct kobject *kobj, int chan)
|
|||||||
|
|
||||||
/* create the DIMM label attribute file */
|
/* create the DIMM label attribute file */
|
||||||
err = sysfs_create_file(kobj,
|
err = sysfs_create_file(kobj,
|
||||||
(struct attribute *) dynamic_csrow_dimm_attr[chan]);
|
(struct attribute *)
|
||||||
|
dynamic_csrow_dimm_attr[chan]);
|
||||||
|
|
||||||
if (!err) {
|
if (!err) {
|
||||||
/* create the CE Count attribute file */
|
/* create the CE Count attribute file */
|
||||||
err = sysfs_create_file(kobj,
|
err = sysfs_create_file(kobj,
|
||||||
(struct attribute *)dynamic_csrow_ce_count_attr[chan]);
|
(struct attribute *)
|
||||||
|
dynamic_csrow_ce_count_attr[chan]);
|
||||||
} else {
|
} else {
|
||||||
debugf1("%s() dimm labels and ce_count files created",
|
debugf1("%s() dimm labels and ce_count files created",
|
||||||
__func__);
|
__func__);
|
||||||
@ -546,10 +501,8 @@ static struct kobj_type ktype_csrow = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Create a CSROW object under specifed edac_mc_device */
|
/* Create a CSROW object under specifed edac_mc_device */
|
||||||
static int edac_create_csrow_object(
|
static int edac_create_csrow_object(struct kobject *edac_mci_kobj,
|
||||||
struct kobject *edac_mci_kobj,
|
struct csrow_info *csrow, int index)
|
||||||
struct csrow_info *csrow,
|
|
||||||
int index)
|
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int chan;
|
int chan;
|
||||||
@ -767,7 +720,7 @@ MCIDEV_ATTR(ue_count,S_IRUGO,mci_ue_count_show,NULL);
|
|||||||
MCIDEV_ATTR(ce_count, S_IRUGO, mci_ce_count_show, NULL);
|
MCIDEV_ATTR(ce_count, S_IRUGO, mci_ce_count_show, NULL);
|
||||||
|
|
||||||
/* memory scrubber attribute file */
|
/* memory scrubber attribute file */
|
||||||
MCIDEV_ATTR(sdram_scrub_rate,S_IRUGO|S_IWUSR,mci_sdram_scrub_rate_show,\
|
MCIDEV_ATTR(sdram_scrub_rate, S_IRUGO | S_IWUSR, mci_sdram_scrub_rate_show,
|
||||||
mci_sdram_scrub_rate_store);
|
mci_sdram_scrub_rate_store);
|
||||||
|
|
||||||
static struct mcidev_attribute *mci_attr[] = {
|
static struct mcidev_attribute *mci_attr[] = {
|
||||||
@ -801,7 +754,6 @@ static struct kobj_type ktype_mci = {
|
|||||||
.default_attrs = (struct attribute **)mci_attr,
|
.default_attrs = (struct attribute **)mci_attr,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define EDAC_DEVICE_SYMLINK "device"
|
#define EDAC_DEVICE_SYMLINK "device"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -898,5 +850,3 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
|
|||||||
kobject_unregister(&mci->edac_mci_kobj);
|
kobject_unregister(&mci->edac_mci_kobj);
|
||||||
wait_for_completion(&mci->kobj_complete);
|
wait_for_completion(&mci->kobj_complete);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,7 +133,6 @@ static void edac_workqueue_teardown(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* edac_init
|
* edac_init
|
||||||
* module initialization entry point
|
* module initialization entry point
|
||||||
@ -220,4 +219,3 @@ MODULE_DESCRIPTION("Core library routines for EDAC reporting");
|
|||||||
module_param(edac_debug_level, int, 0644);
|
module_param(edac_debug_level, int, 0644);
|
||||||
MODULE_PARM_DESC(edac_debug_level, "Debug level");
|
MODULE_PARM_DESC(edac_debug_level, "Debug level");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -42,10 +42,8 @@ extern struct workqueue_struct *edac_workqueue;
|
|||||||
extern void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
|
extern void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
|
||||||
unsigned msec);
|
unsigned msec);
|
||||||
extern void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev);
|
extern void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev);
|
||||||
extern void edac_device_reset_delay_period(
|
extern void edac_device_reset_delay_period(struct edac_device_ctl_info
|
||||||
struct edac_device_ctl_info *edac_dev,
|
*edac_dev, unsigned long value);
|
||||||
unsigned long value);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* EDAC PCI functions
|
* EDAC PCI functions
|
||||||
@ -67,6 +65,4 @@ extern int edac_pci_get_poll_msec(void);
|
|||||||
#define edac_pci_get_poll_msec()
|
#define edac_pci_get_poll_msec()
|
||||||
#endif /* CONFIG_PCI */
|
#endif /* CONFIG_PCI */
|
||||||
|
|
||||||
|
|
||||||
#endif /* __EDAC_MODULE_H__ */
|
#endif /* __EDAC_MODULE_H__ */
|
||||||
|
|
||||||
|
@ -46,8 +46,7 @@ static inline void edac_unlock_pci_list(void)
|
|||||||
* structure. The chip driver will allocate one of these for each
|
* structure. The chip driver will allocate one of these for each
|
||||||
* edac_pci it is going to control/register with the EDAC CORE.
|
* edac_pci it is going to control/register with the EDAC CORE.
|
||||||
*/
|
*/
|
||||||
struct edac_pci_ctl_info * edac_pci_alloc_ctl_info(
|
struct edac_pci_ctl_info *edac_pci_alloc_ctl_info(unsigned int sz_pvt,
|
||||||
unsigned int sz_pvt,
|
|
||||||
const char *edac_pci_name)
|
const char *edac_pci_name)
|
||||||
{
|
{
|
||||||
struct edac_pci_ctl_info *pci;
|
struct edac_pci_ctl_info *pci;
|
||||||
@ -71,6 +70,7 @@ struct edac_pci_ctl_info * edac_pci_alloc_ctl_info(
|
|||||||
|
|
||||||
return pci;
|
return pci;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info);
|
EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -81,6 +81,7 @@ void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci)
|
|||||||
{
|
{
|
||||||
kfree(pci);
|
kfree(pci);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_pci_free_ctl_info);
|
EXPORT_SYMBOL_GPL(edac_pci_free_ctl_info);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -149,7 +150,8 @@ fail0:
|
|||||||
fail1:
|
fail1:
|
||||||
edac_printk(KERN_WARNING, EDAC_PCI,
|
edac_printk(KERN_WARNING, EDAC_PCI,
|
||||||
"but in low-level driver: attempt to assign\n"
|
"but in low-level driver: attempt to assign\n"
|
||||||
"\tduplicate pci_idx %d in %s()\n", rover->pci_idx, __func__);
|
"\tduplicate pci_idx %d in %s()\n", rover->pci_idx,
|
||||||
|
__func__);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,6 +207,7 @@ struct edac_pci_ctl_info * edac_pci_find(int idx)
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_pci_find);
|
EXPORT_SYMBOL_GPL(edac_pci_find);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -225,8 +228,7 @@ static void edac_pci_workq_function(void *ptr)
|
|||||||
edac_lock_pci_list();
|
edac_lock_pci_list();
|
||||||
|
|
||||||
if ((pci->op_state == OP_RUNNING_POLL) &&
|
if ((pci->op_state == OP_RUNNING_POLL) &&
|
||||||
(pci->edac_check != NULL) &&
|
(pci->edac_check != NULL) && (edac_pci_get_check_errors()))
|
||||||
(edac_pci_get_check_errors()))
|
|
||||||
pci->edac_check(pci);
|
pci->edac_check(pci);
|
||||||
|
|
||||||
edac_unlock_pci_list();
|
edac_unlock_pci_list();
|
||||||
@ -282,6 +284,7 @@ void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci,
|
|||||||
|
|
||||||
edac_unlock_pci_list();
|
edac_unlock_pci_list();
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
|
EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -328,8 +331,7 @@ int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx)
|
|||||||
" DEV '%s' (%s)\n",
|
" DEV '%s' (%s)\n",
|
||||||
pci->mod_name,
|
pci->mod_name,
|
||||||
pci->ctl_name,
|
pci->ctl_name,
|
||||||
dev_name(pci),
|
dev_name(pci), edac_op_state_toString(pci->op_state));
|
||||||
edac_op_state_toString(pci->op_state));
|
|
||||||
|
|
||||||
edac_unlock_pci_list();
|
edac_unlock_pci_list();
|
||||||
return 0;
|
return 0;
|
||||||
@ -340,6 +342,7 @@ fail0:
|
|||||||
edac_unlock_pci_list();
|
edac_unlock_pci_list();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_pci_add_device);
|
EXPORT_SYMBOL_GPL(edac_pci_add_device);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -380,13 +383,11 @@ struct edac_pci_ctl_info * edac_pci_del_device(struct device *dev)
|
|||||||
|
|
||||||
edac_printk(KERN_INFO, EDAC_PCI,
|
edac_printk(KERN_INFO, EDAC_PCI,
|
||||||
"Removed device %d for %s %s: DEV %s\n",
|
"Removed device %d for %s %s: DEV %s\n",
|
||||||
pci->pci_idx,
|
pci->pci_idx, pci->mod_name, pci->ctl_name, dev_name(pci));
|
||||||
pci->mod_name,
|
|
||||||
pci->ctl_name,
|
|
||||||
dev_name(pci));
|
|
||||||
|
|
||||||
return pci;
|
return pci;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_pci_del_device);
|
EXPORT_SYMBOL_GPL(edac_pci_del_device);
|
||||||
|
|
||||||
void edac_pci_generic_check(struct edac_pci_ctl_info *pci)
|
void edac_pci_generic_check(struct edac_pci_ctl_info *pci)
|
||||||
@ -401,8 +402,8 @@ struct edac_pci_gen_data {
|
|||||||
int edac_idx;
|
int edac_idx;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct edac_pci_ctl_info *
|
struct edac_pci_ctl_info *edac_pci_create_generic_ctl(struct device *dev,
|
||||||
edac_pci_create_generic_ctl(struct device *dev, const char *mod_name)
|
const char *mod_name)
|
||||||
{
|
{
|
||||||
struct edac_pci_ctl_info *pci;
|
struct edac_pci_ctl_info *pci;
|
||||||
struct edac_pci_gen_data *pdata;
|
struct edac_pci_gen_data *pdata;
|
||||||
@ -430,6 +431,7 @@ edac_pci_create_generic_ctl(struct device *dev, const char *mod_name)
|
|||||||
|
|
||||||
return pci;
|
return pci;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_pci_create_generic_ctl);
|
EXPORT_SYMBOL_GPL(edac_pci_create_generic_ctl);
|
||||||
|
|
||||||
void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci)
|
void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci)
|
||||||
@ -437,4 +439,5 @@ void edac_pci_release_generic_ctl(struct edac_pci_ctl_info *pci)
|
|||||||
edac_pci_del_device(pci->dev);
|
edac_pci_del_device(pci->dev);
|
||||||
edac_pci_free_ctl_info(pci);
|
edac_pci_free_ctl_info(pci);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_pci_release_generic_ctl);
|
EXPORT_SYMBOL_GPL(edac_pci_release_generic_ctl);
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#include "edac_core.h"
|
#include "edac_core.h"
|
||||||
#include "edac_module.h"
|
#include "edac_module.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
|
|
||||||
#define EDAC_PCI_SYMLINK "device"
|
#define EDAC_PCI_SYMLINK "device"
|
||||||
@ -90,8 +89,7 @@ struct instance_attribute {
|
|||||||
|
|
||||||
/* Function to 'show' fields from the edac_pci 'instance' structure */
|
/* Function to 'show' fields from the edac_pci 'instance' structure */
|
||||||
static ssize_t edac_pci_instance_show(struct kobject *kobj,
|
static ssize_t edac_pci_instance_show(struct kobject *kobj,
|
||||||
struct attribute *attr,
|
struct attribute *attr, char *buffer)
|
||||||
char *buffer)
|
|
||||||
{
|
{
|
||||||
struct edac_pci_ctl_info *pci = to_instance(kobj);
|
struct edac_pci_ctl_info *pci = to_instance(kobj);
|
||||||
struct instance_attribute *instance_attr = to_instance_attr(attr);
|
struct instance_attribute *instance_attr = to_instance_attr(attr);
|
||||||
@ -101,7 +99,6 @@ static ssize_t edac_pci_instance_show(struct kobject *kobj,
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Function to 'store' fields into the edac_pci 'instance' structure */
|
/* Function to 'store' fields into the edac_pci 'instance' structure */
|
||||||
static ssize_t edac_pci_instance_store(struct kobject *kobj,
|
static ssize_t edac_pci_instance_store(struct kobject *kobj,
|
||||||
struct attribute *attr,
|
struct attribute *attr,
|
||||||
@ -215,7 +212,8 @@ static ssize_t edac_pci_dev_show(struct kobject *kobj, struct attribute *attr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t edac_pci_dev_store(struct kobject *kobj,
|
static ssize_t edac_pci_dev_store(struct kobject *kobj,
|
||||||
struct attribute *attr, const char *buffer, size_t count)
|
struct attribute *attr, const char *buffer,
|
||||||
|
size_t count)
|
||||||
{
|
{
|
||||||
struct edac_pci_dev_attribute *edac_pci_dev;
|
struct edac_pci_dev_attribute *edac_pci_dev;
|
||||||
edac_pci_dev = (struct edac_pci_dev_attribute *)attr;
|
edac_pci_dev = (struct edac_pci_dev_attribute *)attr;
|
||||||
@ -359,12 +357,9 @@ int edac_pci_create_sysfs(struct edac_pci_ctl_info *pci)
|
|||||||
edac_pci_unregister_main_kobj();
|
edac_pci_unregister_main_kobj();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
debugf0("%s() idx=%d\n", __func__, pci->pci_idx);
|
debugf0("%s() idx=%d\n", __func__, pci->pci_idx);
|
||||||
|
|
||||||
err = sysfs_create_link(edac_kobj,
|
err = sysfs_create_link(edac_kobj, &pci->dev->kobj, EDAC_PCI_SYMLINK);
|
||||||
&pci->dev->kobj,
|
|
||||||
EDAC_PCI_SYMLINK);
|
|
||||||
if (err) {
|
if (err) {
|
||||||
debugf0("%s() sysfs_create_link() returned err= %d\n",
|
debugf0("%s() sysfs_create_link() returned err= %d\n",
|
||||||
__func__, err);
|
__func__, err);
|
||||||
@ -485,8 +480,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
|
|||||||
/* On bridges, need to examine secondary status register */
|
/* On bridges, need to examine secondary status register */
|
||||||
status = get_pci_parity_status(dev, 1);
|
status = get_pci_parity_status(dev, 1);
|
||||||
|
|
||||||
debugf2("PCI SEC_STATUS= 0x%04x %s\n",
|
debugf2("PCI SEC_STATUS= 0x%04x %s\n", status, dev->dev.bus_id);
|
||||||
status, dev->dev.bus_id );
|
|
||||||
|
|
||||||
/* check the secondary status reg for errors */
|
/* check the secondary status reg for errors */
|
||||||
if (status) {
|
if (status) {
|
||||||
@ -590,6 +584,7 @@ void edac_pci_handle_pe(struct edac_pci_ctl_info *pci, const char *msg)
|
|||||||
*/
|
*/
|
||||||
edac_pci_do_parity_check();
|
edac_pci_do_parity_check();
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_pci_handle_pe);
|
EXPORT_SYMBOL_GPL(edac_pci_handle_pe);
|
||||||
|
|
||||||
void edac_pci_handle_npe(struct edac_pci_ctl_info *pci, const char *msg)
|
void edac_pci_handle_npe(struct edac_pci_ctl_info *pci, const char *msg)
|
||||||
@ -609,6 +604,7 @@ void edac_pci_handle_npe(struct edac_pci_ctl_info *pci, const char *msg)
|
|||||||
*/
|
*/
|
||||||
edac_pci_do_parity_check();
|
edac_pci_do_parity_check();
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(edac_pci_handle_npe);
|
EXPORT_SYMBOL_GPL(edac_pci_handle_npe);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -30,6 +30,7 @@ inline int edac_handler_set(void)
|
|||||||
|
|
||||||
return atomic_read(&edac_handlers);
|
return atomic_read(&edac_handlers);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(edac_handler_set);
|
EXPORT_SYMBOL(edac_handler_set);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -39,4 +40,5 @@ inline void edac_atomic_assert_error(void)
|
|||||||
{
|
{
|
||||||
edac_err_assert++;
|
edac_err_assert++;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(edac_atomic_assert_error);
|
EXPORT_SYMBOL(edac_atomic_assert_error);
|
||||||
|
Loading…
Reference in New Issue
Block a user