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

Commit 537fba28 authored by Dave Peterson's avatar Dave Peterson Committed by Linus Torvalds
Browse files

[PATCH] EDAC: printk cleanup



This implements the following idea:

On Monday 30 January 2006 19:22, Eric W. Biederman wrote:
> One piece missing from this conversation is the issue that we need errors
> in a uniform format.  That is why edac_mc has helper functions.
>
> However there will always be errors that don't fit any particular model.
> Could we add a edac_printk(dev, );  That is similar to dev_printk but
> prints out an EDAC header and the device on which the error was found?
> Letting the rest of the string be user specified.
>
> For actual control that interface may be to blunt, but at least for people
> looking in the logs it allows all of the errors to be detected and
> harvested.

Signed-off-by: default avatarDavid S. Peterson <dsp@llnl.gov>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f2fe42ab
Loading
Loading
Loading
Loading
+15 −8
Original line number Diff line number Diff line
@@ -25,6 +25,14 @@
#include "edac_mc.h"


#define amd76x_printk(level, fmt, arg...) \
    edac_printk(level, "amd76x", fmt, ##arg)


#define amd76x_mc_printk(mci, level, fmt, arg...) \
    edac_mc_chipset_printk(mci, level, "amd76x", fmt, ##arg)


#define AMD76X_NR_CSROWS 8
#define AMD76X_NR_CHANS  1
#define AMD76X_NR_DIMMS  4
@@ -174,7 +182,7 @@ static int amd76x_process_error_info (struct mem_ctl_info *mci,
static void amd76x_check(struct mem_ctl_info *mci)
{
	struct amd76x_error_info info;
	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);
	amd76x_get_error_info(mci, &info);
	amd76x_process_error_info(mci, &info, 1);
}
@@ -204,7 +212,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
	u32 ems;
	u32 ems_mode;

	debugf0("MC: " __FILE__ ": %s()\n", __func__);
	debugf0("%s()\n", __func__);

	pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS, &ems);
	ems_mode = (ems >> 10) & 0x3;
@@ -216,7 +224,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
		goto fail;
	}

	debugf0("MC: " __FILE__ ": %s(): mci = %p\n", __func__, mci);
	debugf0("%s(): mci = %p\n", __func__, mci);

	mci->pdev = pci_dev_get(pdev);
	mci->mtype_cap = MEM_FLAG_RDDR;
@@ -267,13 +275,12 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
			 (u32) (0x3 << 8));

	if (edac_mc_add_mc(mci)) {
		debugf3("MC: " __FILE__
			": %s(): failed edac_mc_add_mc()\n", __func__);
		debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
		goto fail;
	}

	/* get this far and it's successful */
	debugf3("MC: " __FILE__ ": %s(): success\n", __func__);
	debugf3("%s(): success\n", __func__);
	return 0;

fail:
@@ -289,7 +296,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
static int __devinit amd76x_init_one(struct pci_dev *pdev,
				     const struct pci_device_id *ent)
{
	debugf0("MC: " __FILE__ ": %s()\n", __func__);
	debugf0("%s()\n", __func__);

	/* don't need to call pci_device_enable() */
	return amd76x_probe1(pdev, ent->driver_data);
@@ -309,7 +316,7 @@ static void __devexit amd76x_remove_one(struct pci_dev *pdev)
{
	struct mem_ctl_info *mci;

	debugf0(__FILE__ ": %s()\n", __func__);
	debugf0("%s()\n", __func__);

	if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL)
		return;
+47 −43
Original line number Diff line number Diff line
@@ -30,6 +30,14 @@
#include "edac_mc.h"


#define e752x_printk(level, fmt, arg...) \
    edac_printk(level, "e752x", fmt, ##arg)


#define e752x_mc_printk(mci, level, fmt, arg...) \
    edac_mc_chipset_printk(mci, level, "e752x", fmt, ##arg)


#ifndef PCI_DEVICE_ID_INTEL_7520_0
#define PCI_DEVICE_ID_INTEL_7520_0      0x3590
#endif				/* PCI_DEVICE_ID_INTEL_7520_0      */
@@ -215,7 +223,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
	u32 remap;
	struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info;

	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);

	if (page < pvt->tolm)
		return page;
@@ -224,7 +232,7 @@ static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
	remap = (page - pvt->tolm) + pvt->remapbase;
	if (remap < pvt->remaplimit)
		return remap;
	printk(KERN_ERR "Invalid page %lx - out of range\n", page);
	e752x_printk(KERN_ERR, "Invalid page %lx - out of range\n", page);
	return pvt->tolm - 1;
}

@@ -237,7 +245,7 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one,
	int i;
	struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info;

	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);

	/* convert the addr to 4k page */
	page = sec1_add >> (PAGE_SHIFT - 4);
@@ -246,7 +254,7 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one,
	if (pvt->mc_symmetric) {
		/* chip select are bits 14 & 13 */
		row = ((page >> 1) & 3);
		printk(KERN_WARNING
		e752x_printk(KERN_WARNING,
			     "Test row %d Table %d %d %d %d %d %d %d %d\n",
			     row, pvt->map[0], pvt->map[1], pvt->map[2],
			     pvt->map[3], pvt->map[4], pvt->map[5],
@@ -257,13 +265,12 @@ static void do_process_ce(struct mem_ctl_info *mci, u16 error_one,
			if (pvt->map[i] == row)
				break;
		}
		printk(KERN_WARNING "Test computed row %d\n", i);
		e752x_printk(KERN_WARNING, "Test computed row %d\n", i);
		if (i < 8)
			row = i;
		else
			printk(KERN_WARNING
			       "MC%d: row %d not found in remap table\n",
			       mci->mc_idx, row);
			e752x_mc_printk(mci, KERN_WARNING,
			    "row %d not found in remap table\n", row);
	} else
		row = edac_mc_find_csrow_by_page(mci, page);
	/* 0 = channel A, 1 = channel B */
@@ -293,7 +300,7 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, u32 ded_add,
	int row;
	struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info;

	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);

	if (error_one & 0x0202) {
		error_2b = ded_add;
@@ -336,7 +343,7 @@ static inline void process_ue_no_info_wr(struct mem_ctl_info *mci,
	if (!handle_error)
		return;

	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);
	edac_mc_handle_ue_no_info(mci, "e752x UE log memory write");
}

@@ -352,9 +359,9 @@ static void do_process_ded_retry(struct mem_ctl_info *mci, u16 error,
	row = pvt->mc_symmetric ?
	    ((page >> 1) & 3) :	/* chip select are bits 14 & 13 */
	    edac_mc_find_csrow_by_page(mci, page);
	printk(KERN_WARNING
	       "MC%d: CE page 0x%lx, row %d : Memory read retry\n",
	       mci->mc_idx, (long unsigned int) page, row);
	e752x_mc_printk(mci, KERN_WARNING,
	    "CE page 0x%lx, row %d : Memory read retry\n",
	    (long unsigned int) page, row);
}

static inline void process_ded_retry(struct mem_ctl_info *mci, u16 error,
@@ -372,8 +379,7 @@ static inline void process_threshold_ce(struct mem_ctl_info *mci, u16 error,
	*error_found = 1;

	if (handle_error)
		printk(KERN_WARNING "MC%d: Memory threshold CE\n",
		       mci->mc_idx);
		e752x_mc_printk(mci, KERN_WARNING, "Memory threshold CE\n");
}

static char *global_message[11] = {
@@ -391,7 +397,7 @@ static void do_global_error(int fatal, u32 errors)

	for (i = 0; i < 11; i++) {
		if (errors & (1 << i))
			printk(KERN_WARNING "%sError %s\n",
			e752x_printk(KERN_WARNING, "%sError %s\n",
			       fatal_message[fatal], global_message[i]);
	}
}
@@ -418,7 +424,7 @@ static void do_hub_error(int fatal, u8 errors)

	for (i = 0; i < 7; i++) {
		if (errors & (1 << i))
			printk(KERN_WARNING "%sError %s\n",
			e752x_printk(KERN_WARNING, "%sError %s\n",
			       fatal_message[fatal], hub_message[i]);
	}
}
@@ -445,7 +451,7 @@ static void do_membuf_error(u8 errors)

	for (i = 0; i < 4; i++) {
		if (errors & (1 << i))
			printk(KERN_WARNING "Non-Fatal Error %s\n",
			e752x_printk(KERN_WARNING, "Non-Fatal Error %s\n",
			       membuf_message[i]);
	}
}
@@ -478,7 +484,7 @@ static void do_sysbus_error(int fatal, u32 errors)

	for (i = 0; i < 10; i++) {
		if (errors & (1 << i))
			printk(KERN_WARNING "%sError System Bus %s\n",
			e752x_printk(KERN_WARNING, "%sError System Bus %s\n",
			       fatal_message[fatal], global_message[i]);
	}
}
@@ -727,7 +733,7 @@ static int e752x_process_error_info (struct mem_ctl_info *mci,
static void e752x_check(struct mem_ctl_info *mci)
{
	struct e752x_error_info info;
	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);
	e752x_get_error_info(mci, &info);
	e752x_process_error_info(mci, &info, 1);
}
@@ -752,7 +758,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
	struct pci_dev *pres_dev;
	struct pci_dev *dev = NULL;

	debugf0("MC: " __FILE__ ": %s(): mci\n", __func__);
	debugf0("%s(): mci\n", __func__);
	debugf0("Starting Probe1\n");

	/* enable device 0 function 1 */
@@ -776,7 +782,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
		goto fail;
	}

	debugf3("MC: " __FILE__ ": %s(): init mci\n", __func__);
	debugf3("%s(): init mci\n", __func__);

	mci->mtype_cap = MEM_FLAG_RDDR;
	mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED |
@@ -786,7 +792,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
	mci->mod_ver = "$Revision: 1.5.2.11 $";
	mci->pdev = pdev;

	debugf3("MC: " __FILE__ ": %s(): init pvt\n", __func__);
	debugf3("%s(): init pvt\n", __func__);
	pvt = (struct e752x_pvt *) mci->pvt_info;
	pvt->dev_info = &e752x_devs[dev_idx];
	pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
@@ -796,14 +802,14 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
		pvt->bridge_ck = pci_scan_single_device(pdev->bus,
							PCI_DEVFN(0, 1));
	if (pvt->bridge_ck == NULL) {
		printk(KERN_ERR "MC: error reporting device not found:"
		e752x_printk(KERN_ERR, "error reporting device not found:"
		       "vendor %x device 0x%x (broken BIOS?)\n",
		       PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev);
		goto fail;
	}
	pvt->mc_symmetric = ((ddrcsr & 0x10) != 0);

	debugf3("MC: " __FILE__ ": %s(): more mci init\n", __func__);
	debugf3("%s(): more mci init\n", __func__);
	mci->ctl_name = pvt->dev_info->ctl_name;
	mci->edac_check = e752x_check;
	mci->ctl_page_to_phys = ctl_page_to_phys;
@@ -828,8 +834,8 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
		pci_read_config_byte(mci->pdev, E752X_DRB + index, &value);
		/* convert a 128 or 64 MiB DRB to a page size. */
		cumul_size = value << (25 + drc_drbg - PAGE_SHIFT);
		debugf3("MC: " __FILE__ ": %s(): (%d) cumul_size 0x%x\n",
			__func__, index, cumul_size);
		debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
			cumul_size);
		if (cumul_size == last_cumul_size)
			continue;	/* not populated */

@@ -897,8 +903,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)

	mci->edac_cap |= EDAC_FLAG_NONE;

	debugf3("MC: " __FILE__ ": %s(): tolm, remapbase, remaplimit\n",
		__func__);
	debugf3("%s(): tolm, remapbase, remaplimit\n", __func__);
	/* load the top of low memory, remap base, and remap limit vars */
	pci_read_config_word(mci->pdev, E752X_TOLM, &pci_data);
	pvt->tolm = ((u32) pci_data) << 4;
@@ -906,13 +911,12 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
	pvt->remapbase = ((u32) pci_data) << 14;
	pci_read_config_word(mci->pdev, E752X_REMAPLIMIT, &pci_data);
	pvt->remaplimit = ((u32) pci_data) << 14;
	printk("tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm,
	       pvt->remapbase, pvt->remaplimit);
	e752x_printk(KERN_INFO,
		     "tolm = %x, remapbase = %x, remaplimit = %x\n",
		     pvt->tolm, pvt->remapbase, pvt->remaplimit);

	if (edac_mc_add_mc(mci)) {
		debugf3("MC: " __FILE__
			": %s(): failed edac_mc_add_mc()\n",
			__func__);
		debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
		goto fail;
	}

@@ -975,7 +979,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
	pci_write_config_word(dev, E752X_DRAM_NERR, stat16);

	/* get this far and it's successful */
	debugf3("MC: " __FILE__ ": %s(): success\n", __func__);
	debugf3("%s(): success\n", __func__);
	return 0;

fail:
@@ -995,7 +999,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
static int __devinit e752x_init_one(struct pci_dev *pdev,
				    const struct pci_device_id *ent)
{
	debugf0("MC: " __FILE__ ": %s()\n", __func__);
	debugf0("%s()\n", __func__);

	/* wake up and enable device */
	if(pci_enable_device(pdev) < 0)
@@ -1009,7 +1013,7 @@ static void __devexit e752x_remove_one(struct pci_dev *pdev)
	struct mem_ctl_info *mci;
	struct e752x_pvt *pvt;

	debugf0(__FILE__ ": %s()\n", __func__);
	debugf0("%s()\n", __func__);

	if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL)
		return;
@@ -1050,7 +1054,7 @@ static int __init e752x_init(void)
{
	int pci_rc;

	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);
	pci_rc = pci_register_driver(&e752x_driver);
	return (pci_rc < 0) ? pci_rc : 0;
}
@@ -1058,7 +1062,7 @@ static int __init e752x_init(void)

static void __exit e752x_exit(void)
{
	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);
	pci_unregister_driver(&e752x_driver);
}

+34 −28
Original line number Diff line number Diff line
@@ -32,6 +32,14 @@
#include "edac_mc.h"


#define e7xxx_printk(level, fmt, arg...) \
    edac_printk(level, "e7xxx", fmt, ##arg)


#define e7xxx_mc_printk(mci, level, fmt, arg...) \
    edac_mc_chipset_printk(mci, level, "e7xxx", fmt, ##arg)


#ifndef PCI_DEVICE_ID_INTEL_7205_0
#define PCI_DEVICE_ID_INTEL_7205_0	0x255d
#endif				/* PCI_DEVICE_ID_INTEL_7205_0 */
@@ -161,7 +169,7 @@ static const struct e7xxx_dev_info e7xxx_devs[] = {
/* FIXME - is this valid for both SECDED and S4ECD4ED? */
static inline int e7xxx_find_channel(u16 syndrome)
{
	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);

	if ((syndrome & 0xff00) == 0)
		return 0;
@@ -179,7 +187,7 @@ ctl_page_to_phys(struct mem_ctl_info *mci, unsigned long page)
	u32 remap;
	struct e7xxx_pvt *pvt = (struct e7xxx_pvt *) mci->pvt_info;

	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);

	if ((page < pvt->tolm) ||
	    ((page >= 0x100000) && (page < pvt->remapbase)))
@@ -187,7 +195,7 @@ ctl_page_to_phys(struct mem_ctl_info *mci, unsigned long page)
	remap = (page - pvt->tolm) + pvt->remapbase;
	if (remap < pvt->remaplimit)
		return remap;
	printk(KERN_ERR "Invalid page %lx - out of range\n", page);
	e7xxx_printk(KERN_ERR, "Invalid page %lx - out of range\n", page);
	return pvt->tolm - 1;
}

@@ -199,7 +207,7 @@ static void process_ce(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
	int row;
	int channel;

	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);

	/* read the error address */
	error_1b = info->dram_celog_add;
@@ -218,7 +226,7 @@ static void process_ce(struct mem_ctl_info *mci, struct e7xxx_error_info *info)

static void process_ce_no_info(struct mem_ctl_info *mci)
{
	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);
	edac_mc_handle_ce_no_info(mci, "e7xxx CE log register overflow");
}

@@ -228,7 +236,7 @@ static void process_ue(struct mem_ctl_info *mci, struct e7xxx_error_info *info)
	u32 error_2b, block_page;
	int row;

	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);

	/* read the error address */
	error_2b = info->dram_uelog_add;
@@ -241,7 +249,7 @@ static void process_ue(struct mem_ctl_info *mci, struct e7xxx_error_info *info)

static void process_ue_no_info(struct mem_ctl_info *mci)
{
	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);
	edac_mc_handle_ue_no_info(mci, "e7xxx UE log register overflow");
}

@@ -330,7 +338,7 @@ static void e7xxx_check(struct mem_ctl_info *mci)
{
	struct e7xxx_error_info info;

	debugf3("MC: " __FILE__ ": %s()\n", __func__);
	debugf3("%s()\n", __func__);
	e7xxx_get_error_info(mci, &info);
	e7xxx_process_error_info(mci, &info, 1);
}
@@ -351,7 +359,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
	unsigned long last_cumul_size;


	debugf0("MC: " __FILE__ ": %s(): mci\n", __func__);
	debugf0("%s(): mci\n", __func__);

	/* need to find out the number of channels */
	pci_read_config_dword(pdev, E7XXX_DRC, &drc);
@@ -369,7 +377,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
		goto fail;
	}

	debugf3("MC: " __FILE__ ": %s(): init mci\n", __func__);
	debugf3("%s(): init mci\n", __func__);

	mci->mtype_cap = MEM_FLAG_RDDR;
	mci->edac_ctl_cap =
@@ -379,21 +387,21 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
	mci->mod_ver = "$Revision: 1.5.2.9 $";
	mci->pdev = pdev;

	debugf3("MC: " __FILE__ ": %s(): init pvt\n", __func__);
	debugf3("%s(): init pvt\n", __func__);
	pvt = (struct e7xxx_pvt *) mci->pvt_info;
	pvt->dev_info = &e7xxx_devs[dev_idx];
	pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
					 pvt->dev_info->err_dev,
					 pvt->bridge_ck);
	if (!pvt->bridge_ck) {
		printk(KERN_ERR
		       "MC: error reporting device not found:"
		e7xxx_printk(KERN_ERR, "error reporting device not found:"
			     "vendor %x device 0x%x (broken BIOS?)\n",
		       PCI_VENDOR_ID_INTEL, e7xxx_devs[dev_idx].err_dev);
			     PCI_VENDOR_ID_INTEL,
			     e7xxx_devs[dev_idx].err_dev);
		goto fail;
	}

	debugf3("MC: " __FILE__ ": %s(): more mci init\n", __func__);
	debugf3("%s(): more mci init\n", __func__);
	mci->ctl_name = pvt->dev_info->ctl_name;

	mci->edac_check = e7xxx_check;
@@ -418,8 +426,8 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
		pci_read_config_byte(mci->pdev, E7XXX_DRB + index, &value);
		/* convert a 64 or 32 MiB DRB to a page size. */
		cumul_size = value << (25 + drc_drbg - PAGE_SHIFT);
		debugf3("MC: " __FILE__ ": %s(): (%d) cumul_size 0x%x\n",
			__func__, index, cumul_size);
		debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
			cumul_size);
		if (cumul_size == last_cumul_size)
			continue;	/* not populated */

@@ -449,8 +457,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)

	mci->edac_cap |= EDAC_FLAG_NONE;

	debugf3("MC: " __FILE__ ": %s(): tolm, remapbase, remaplimit\n",
		__func__);
	debugf3("%s(): tolm, remapbase, remaplimit\n", __func__);
	/* load the top of low memory, remap base, and remap limit vars */
	pci_read_config_word(mci->pdev, E7XXX_TOLM, &pci_data);
	pvt->tolm = ((u32) pci_data) << 4;
@@ -458,22 +465,21 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
	pvt->remapbase = ((u32) pci_data) << 14;
	pci_read_config_word(mci->pdev, E7XXX_REMAPLIMIT, &pci_data);
	pvt->remaplimit = ((u32) pci_data) << 14;
	printk("tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm,
	       pvt->remapbase, pvt->remaplimit);
	e7xxx_printk(KERN_INFO,
		     "tolm = %x, remapbase = %x, remaplimit = %x\n",
		     pvt->tolm, pvt->remapbase, pvt->remaplimit);

	/* clear any pending errors, or initial state bits */
	pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_FERR, 0x03, 0x03);
	pci_write_bits8(pvt->bridge_ck, E7XXX_DRAM_NERR, 0x03, 0x03);

	if (edac_mc_add_mc(mci) != 0) {
		debugf3("MC: " __FILE__
			": %s(): failed edac_mc_add_mc()\n",
			__func__);
		debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
		goto fail;
	}

	/* get this far and it's successful */
	debugf3("MC: " __FILE__ ": %s(): success\n", __func__);
	debugf3("%s(): success\n", __func__);
	return 0;

fail:
@@ -490,7 +496,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
static int __devinit
e7xxx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
	debugf0("MC: " __FILE__ ": %s()\n", __func__);
	debugf0("%s()\n", __func__);

	/* wake up and enable device */
	return pci_enable_device(pdev) ?
@@ -503,7 +509,7 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
	struct mem_ctl_info *mci;
	struct e7xxx_pvt *pvt;

	debugf0(__FILE__ ": %s()\n", __func__);
	debugf0("%s()\n", __func__);

	if (((mci = edac_mc_find_mci_by_pdev(pdev)) != 0) &&
	    edac_mc_del_mc(mci)) {
+85 −101

File changed.

Preview size limit exceeded, changes collapsed.

+21 −2
Original line number Diff line number Diff line
@@ -43,10 +43,29 @@
#define PAGES_TO_MiB( pages )	( ( pages ) << ( PAGE_SHIFT - 20 ) )
#endif

#define edac_printk(level, prefix, fmt, arg...) \
    printk(level "EDAC " prefix ": " fmt, ##arg)

#define edac_mc_printk(mci, level, fmt, arg...) \
    printk(level "EDAC MC%d: " fmt, mci->mc_idx, ##arg)

#define edac_mc_chipset_printk(mci, level, prefix, fmt, arg...) \
    printk(level "EDAC " prefix " MC%d: " fmt, mci->mc_idx, ##arg)

/* prefixes for edac_printk() and edac_mc_printk() */
#define EDAC_MC "MC"
#define EDAC_PCI "PCI"
#define EDAC_DEBUG "DEBUG"

#ifdef CONFIG_EDAC_DEBUG
extern int edac_debug_level;
#define edac_debug_printk(level, fmt, args...) \
do { if (level <= edac_debug_level) printk(KERN_DEBUG fmt, ##args); } while(0)

#define edac_debug_printk(level, fmt, arg...)                            \
	do {                                                             \
		if (level <= edac_debug_level)                           \
			edac_printk(KERN_DEBUG, EDAC_DEBUG, fmt, ##arg); \
	} while(0)

#define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ )
#define debugf1( ... ) edac_debug_printk(1, __VA_ARGS__ )
#define debugf2( ... ) edac_debug_printk(2, __VA_ARGS__ )
Loading