Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61691
b: refs/heads/master
c: 4de78c6
h: refs/heads/master
i:
  61689: 10947b1
  61687: 31afcd0
v: v3
  • Loading branch information
Dave Jiang authored and Linus Torvalds committed Jul 19, 2007
1 parent 5422d43 commit 31fa788
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 78 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 66ee2f940ac8ab25f0c43a1e717d25dc46bfe74d
refs/heads/master: 4de78c6877ec21142582ac19453c2d453d1ea298
7 changes: 0 additions & 7 deletions trunk/drivers/edac/edac_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,13 +646,6 @@ struct edac_pci_ctl_info {

int pci_idx;

/* Per instance controls for this edac_device */
int check_parity_error; /* boolean for checking parity errs */
int log_parity_error; /* boolean for logging parity errs */
int panic_on_pe; /* boolean for panic'ing on a PE */
unsigned poll_msec; /* number of milliseconds to poll interval */
unsigned long delay; /* number of jiffies for poll_msec */

struct sysdev_class *edac_class; /* pointer to class */

/* the internal state of this controller instance */
Expand Down
21 changes: 11 additions & 10 deletions trunk/drivers/edac/edac_mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ static void edac_mc_workq_function(void *ptr)
mutex_unlock(&mem_ctls_mutex);

/* Reschedule */
queue_delayed_work(edac_workqueue, &mci->work, edac_mc_get_poll_msec());
queue_delayed_work(edac_workqueue, &mci->work,
msecs_to_jiffies(edac_mc_get_poll_msec()));
}

/*
Expand Down Expand Up @@ -611,7 +612,7 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci,
return;
}

if (edac_get_log_ce())
if (edac_mc_get_log_ce())
/* FIXME - put in DIMM location */
edac_mc_printk(mci, KERN_WARNING,
"CE page 0x%lx, offset 0x%lx, grain %d, syndrome "
Expand Down Expand Up @@ -646,7 +647,7 @@ EXPORT_SYMBOL_GPL(edac_mc_handle_ce);

void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, const char *msg)
{
if (edac_get_log_ce())
if (edac_mc_get_log_ce())
edac_mc_printk(mci, KERN_WARNING,
"CE - no information available: %s\n", msg);

Expand Down Expand Up @@ -690,14 +691,14 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci,
pos += chars;
}

if (edac_get_log_ue())
if (edac_mc_get_log_ue())
edac_mc_printk(mci, KERN_EMERG,
"UE page 0x%lx, offset 0x%lx, grain %d, row %d, "
"labels \"%s\": %s\n", page_frame_number,
offset_in_page, mci->csrows[row].grain, row, labels,
msg);

if (edac_get_panic_on_ue())
if (edac_mc_get_panic_on_ue())
panic("EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, "
"row %d, labels \"%s\": %s\n", mci->mc_idx,
page_frame_number, offset_in_page,
Expand All @@ -710,10 +711,10 @@ EXPORT_SYMBOL_GPL(edac_mc_handle_ue);

void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg)
{
if (edac_get_panic_on_ue())
if (edac_mc_get_panic_on_ue())
panic("EDAC MC%d: Uncorrected Error", mci->mc_idx);

if (edac_get_log_ue())
if (edac_mc_get_log_ue())
edac_mc_printk(mci, KERN_WARNING,
"UE - no information available: %s\n", msg);
mci->ue_noinfo_count++;
Expand Down Expand Up @@ -776,13 +777,13 @@ void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
chars = snprintf(pos, len + 1, "-%s",
mci->csrows[csrow].channels[channelb].label);

if (edac_get_log_ue())
if (edac_mc_get_log_ue())
edac_mc_printk(mci, KERN_EMERG,
"UE row %d, channel-a= %d channel-b= %d "
"labels \"%s\": %s\n", csrow, channela, channelb,
labels, msg);

if (edac_get_panic_on_ue())
if (edac_mc_get_panic_on_ue())
panic("UE row %d, channel-a= %d channel-b= %d "
"labels \"%s\": %s\n", csrow, channela,
channelb, labels, msg);
Expand Down Expand Up @@ -817,7 +818,7 @@ void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
return;
}

if (edac_get_log_ce())
if (edac_mc_get_log_ce())
/* FIXME - put in DIMM location */
edac_mc_printk(mci, KERN_WARNING,
"CE row %d, channel %d, label \"%s\": %s\n",
Expand Down
76 changes: 44 additions & 32 deletions trunk/drivers/edac/edac_mc_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,44 @@
#include "edac_module.h"

/* MC EDAC Controls, setable by module parameter, and sysfs */
static int log_ue = 1;
static int log_ce = 1;
static int panic_on_ue;
static int poll_msec = 1000;
static int edac_mc_log_ue = 1;
static int edac_mc_log_ce = 1;
static int edac_mc_panic_on_ue = 0;
static int edac_mc_poll_msec = 1000;

/* Getter functions for above */
int edac_get_log_ue(void)
int edac_mc_get_log_ue(void)
{
return log_ue;
return edac_mc_log_ue;
}

int edac_get_log_ce(void)
int edac_mc_get_log_ce(void)
{
return log_ce;
return edac_mc_log_ce;
}

int edac_get_panic_on_ue(void)
int edac_mc_get_panic_on_ue(void)
{
return panic_on_ue;
return edac_mc_panic_on_ue;
}

/* this is temporary */
int edac_mc_get_poll_msec(void)
{
return edac_get_poll_msec();
}

int edac_get_poll_msec(void)
{
return poll_msec;
return edac_mc_poll_msec;
}

/* Parameter declarations for above */
module_param(panic_on_ue, int, 0644);
MODULE_PARM_DESC(panic_on_ue, "Panic on uncorrected error: 0=off 1=on");
module_param(log_ue, int, 0644);
MODULE_PARM_DESC(log_ue, "Log uncorrectable error to console: 0=off 1=on");
module_param(log_ce, int, 0644);
MODULE_PARM_DESC(log_ce, "Log correctable error to console: 0=off 1=on");
module_param(poll_msec, int, 0644);
MODULE_PARM_DESC(poll_msec, "Polling period in milliseconds");
module_param(edac_mc_panic_on_ue, int, 0644);
MODULE_PARM_DESC(edac_mc_panic_on_ue, "Panic on uncorrected error: 0=off 1=on");
module_param(edac_mc_log_ue, int, 0644);
MODULE_PARM_DESC(edac_mc_log_ue,
"Log uncorrectable error to console: 0=off 1=on");
module_param(edac_mc_log_ce, int, 0644);
MODULE_PARM_DESC(edac_mc_log_ce,
"Log correctable error to console: 0=off 1=on");
module_param(edac_mc_poll_msec, int, 0644);
MODULE_PARM_DESC(edac_mc_poll_msec, "Polling period in milliseconds");


/*
Expand Down Expand Up @@ -187,17 +184,32 @@ static struct memctrl_dev_attribute attr_##_name = { \
};

/* csrow<id> control files */
MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store);
MEMCTRL_ATTR(log_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store);
MEMCTRL_ATTR(log_ce,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store);
MEMCTRL_ATTR(poll_msec,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store);
MEMCTRL_ATTR(edac_mc_panic_on_ue,
S_IRUGO | S_IWUSR,
memctrl_int_show,
memctrl_int_store);

MEMCTRL_ATTR(edac_mc_log_ue,
S_IRUGO|S_IWUSR,
memctrl_int_show,
memctrl_int_store);

MEMCTRL_ATTR(edac_mc_log_ce,
S_IRUGO|S_IWUSR,
memctrl_int_show,
memctrl_int_store);

MEMCTRL_ATTR(edac_mc_poll_msec,
S_IRUGO|S_IWUSR,
memctrl_int_show,
memctrl_int_store);

/* Base Attributes of the memory ECC object */
static struct memctrl_dev_attribute *memctrl_attr[] = {
&attr_panic_on_ue,
&attr_log_ue,
&attr_log_ce,
&attr_poll_msec,
&attr_edac_mc_panic_on_ue,
&attr_edac_mc_log_ue,
&attr_edac_mc_log_ce,
&attr_edac_mc_poll_msec,
NULL,
};

Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/edac/edac_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ extern void edac_check_mc_devices(void);
extern int edac_get_log_ue(void);
extern int edac_get_log_ce(void);
extern int edac_get_panic_on_ue(void);
extern int edac_mc_get_log_ue(void);
extern int edac_mc_get_log_ce(void);
extern int edac_mc_get_panic_on_ue(void);
extern int edac_get_poll_msec(void);
extern int edac_mc_get_poll_msec(void);

Expand All @@ -52,12 +55,16 @@ extern void edac_pci_do_parity_check(void);
extern void edac_pci_clear_parity_errors(void);
extern int edac_sysfs_pci_setup(void);
extern void edac_sysfs_pci_teardown(void);
extern int edac_pci_get_check_errors(void);
extern int edac_pci_get_poll_msec(void);
#else /* CONFIG_PCI */
/* pre-process these away */
#define edac_pci_do_parity_check()
#define edac_pci_clear_parity_errors()
#define edac_sysfs_pci_setup() (0)
#define edac_sysfs_pci_teardown()
#define edac_pci_get_check_errors()
#define edac_pci_get_poll_msec()
#endif /* CONFIG_PCI */


Expand Down
21 changes: 5 additions & 16 deletions trunk/drivers/edac/edac_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,14 @@ static void edac_pci_workq_function(void *ptr)

if ((pci->op_state == OP_RUNNING_POLL) &&
(pci->edac_check != NULL) &&
(pci->check_parity_error))
(edac_pci_get_check_errors()))
pci->edac_check(pci);

edac_unlock_pci_list();

/* Reschedule */
queue_delayed_work(edac_workqueue, &pci->work, pci->delay);
queue_delayed_work(edac_workqueue, &pci->work,
msecs_to_jiffies(edac_pci_get_poll_msec()));
}

/*
Expand All @@ -245,15 +246,13 @@ static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci,
{
debugf0("%s()\n", __func__);

pci->poll_msec = msec;
edac_calc_delay(pci);

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
INIT_DELAYED_WORK(&pci->work, edac_pci_workq_function);
#else
INIT_WORK(&pci->work, edac_pci_workq_function, pci);
#endif
queue_delayed_work(edac_workqueue, &pci->work, pci->delay);
queue_delayed_work(edac_workqueue, &pci->work,
msecs_to_jiffies(edac_pci_get_poll_msec()));
}

/*
Expand Down Expand Up @@ -390,16 +389,6 @@ struct edac_pci_ctl_info * edac_pci_del_device(struct device *dev)
}
EXPORT_SYMBOL_GPL(edac_pci_del_device);

static inline int edac_pci_get_log_pe(struct edac_pci_ctl_info *pci)
{
return pci->log_parity_error;
}

static inline int edac_pci_get_panic_on_pe(struct edac_pci_ctl_info *pci)
{
return pci->panic_on_pe;
}

void edac_pci_generic_check(struct edac_pci_ctl_info *pci)
{
edac_pci_do_parity_check();
Expand Down
Loading

0 comments on commit 31fa788

Please sign in to comment.