Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4de78c68 authored by Dave Jiang's avatar Dave Jiang Committed by Linus Torvalds
Browse files

drivers/edac: mod PCI poll names



Fixup poll values for MC and PCI.
Also make mc function names unique to mc.

Signed-off-by: default avatarDave Jiang <djiang@mvista.com>
Signed-off-by: default avatarDouglas Thompson <dougthompson@xmissin.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 66ee2f94
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -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 */
+11 −10
Original line number Diff line number Diff line
@@ -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()));
}

/*
@@ -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 "
@@ -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);

@@ -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,
@@ -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++;
@@ -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);
@@ -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",
+44 −32
Original line number Diff line number Diff line
@@ -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");


/*
@@ -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,
};

+7 −0
Original line number Diff line number Diff line
@@ -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);

@@ -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 */


+5 −16
Original line number Diff line number Diff line
@@ -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()));
}

/*
@@ -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()));
}

/*
@@ -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();
Loading