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

Commit f0f3680e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull EDAC fixes from Mauro Carvalho Chehab:
 "A series of EDAC driver fixes.  It also has one core fix at the
  documentation, and a rename patch, fixing the name of the struct that
  contains the rank information."

* 'linux_next' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac:
  edac: rename channel_info to rank_info
  i5400_edac: Avoid calling pci_put_device() twice
  edac: i5100 ack error detection register after each read
  edac: i5100 fix erroneous define for M1Err
  edac: sb_edac: Fix a wrong value setting for the previous value
  edac: sb_edac: Fix a INTERLEAVE_MODE() misuse
  edac: sb_edac: Let the driver depend on PCI_MMCONFIG
  edac: Improve the comments to better describe the memory concepts
  edac/ppc4xx_edac: Fix compilation
  Fix sb_edac compilation with 32 bits kernels
parents 61e5191c a4b4be3f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -215,7 +215,7 @@ config EDAC_I7300
config EDAC_SBRIDGE
config EDAC_SBRIDGE
	tristate "Intel Sandy-Bridge Integrated MC"
	tristate "Intel Sandy-Bridge Integrated MC"
	depends on EDAC_MM_EDAC && PCI && X86_64 && X86_MCE_INTEL
	depends on EDAC_MM_EDAC && PCI && X86_64 && X86_MCE_INTEL
	depends on EXPERIMENTAL
	depends on PCI_MMCONFIG && EXPERIMENTAL
	help
	help
	  Support for error detection and correction the Intel
	  Support for error detection and correction the Intel
	  Sandy Bridge Integrated Memory Controller.
	  Sandy Bridge Integrated Memory Controller.
+3 −3
Original line number Original line Diff line number Diff line
@@ -39,7 +39,7 @@ static LIST_HEAD(mc_devices);


#ifdef CONFIG_EDAC_DEBUG
#ifdef CONFIG_EDAC_DEBUG


static void edac_mc_dump_channel(struct channel_info *chan)
static void edac_mc_dump_channel(struct rank_info *chan)
{
{
	debugf4("\tchannel = %p\n", chan);
	debugf4("\tchannel = %p\n", chan);
	debugf4("\tchannel->chan_idx = %d\n", chan->chan_idx);
	debugf4("\tchannel->chan_idx = %d\n", chan->chan_idx);
@@ -156,7 +156,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
{
{
	struct mem_ctl_info *mci;
	struct mem_ctl_info *mci;
	struct csrow_info *csi, *csrow;
	struct csrow_info *csi, *csrow;
	struct channel_info *chi, *chp, *chan;
	struct rank_info *chi, *chp, *chan;
	void *pvt;
	void *pvt;
	unsigned size;
	unsigned size;
	int row, chn;
	int row, chn;
@@ -181,7 +181,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
	 * rather than an imaginary chunk of memory located at address 0.
	 * rather than an imaginary chunk of memory located at address 0.
	 */
	 */
	csi = (struct csrow_info *)(((char *)mci) + ((unsigned long)csi));
	csi = (struct csrow_info *)(((char *)mci) + ((unsigned long)csi));
	chi = (struct channel_info *)(((char *)mci) + ((unsigned long)chi));
	chi = (struct rank_info *)(((char *)mci) + ((unsigned long)chi));
	pvt = sz_pvt ? (((char *)mci) + ((unsigned long)pvt)) : NULL;
	pvt = sz_pvt ? (((char *)mci) + ((unsigned long)pvt)) : NULL;


	/* setup index and various internal pointers */
	/* setup index and various internal pointers */
+5 −8
Original line number Original line Diff line number Diff line
@@ -49,7 +49,7 @@
#define		I5100_FERR_NF_MEM_M6ERR_MASK	(1 << 6)
#define		I5100_FERR_NF_MEM_M6ERR_MASK	(1 << 6)
#define		I5100_FERR_NF_MEM_M5ERR_MASK	(1 << 5)
#define		I5100_FERR_NF_MEM_M5ERR_MASK	(1 << 5)
#define		I5100_FERR_NF_MEM_M4ERR_MASK	(1 << 4)
#define		I5100_FERR_NF_MEM_M4ERR_MASK	(1 << 4)
#define		I5100_FERR_NF_MEM_M1ERR_MASK	1
#define		I5100_FERR_NF_MEM_M1ERR_MASK	(1 << 1)
#define		I5100_FERR_NF_MEM_ANY_MASK	\
#define		I5100_FERR_NF_MEM_ANY_MASK	\
			(I5100_FERR_NF_MEM_M16ERR_MASK | \
			(I5100_FERR_NF_MEM_M16ERR_MASK | \
			I5100_FERR_NF_MEM_M15ERR_MASK | \
			I5100_FERR_NF_MEM_M15ERR_MASK | \
@@ -535,23 +535,20 @@ static void i5100_read_log(struct mem_ctl_info *mci, int chan,
static void i5100_check_error(struct mem_ctl_info *mci)
static void i5100_check_error(struct mem_ctl_info *mci)
{
{
	struct i5100_priv *priv = mci->pvt_info;
	struct i5100_priv *priv = mci->pvt_info;
	u32 dw;
	u32 dw, dw2;



	pci_read_config_dword(priv->mc, I5100_FERR_NF_MEM, &dw);
	pci_read_config_dword(priv->mc, I5100_FERR_NF_MEM, &dw);
	if (i5100_ferr_nf_mem_any(dw)) {
	if (i5100_ferr_nf_mem_any(dw)) {
		u32 dw2;


		pci_read_config_dword(priv->mc, I5100_NERR_NF_MEM, &dw2);
		pci_read_config_dword(priv->mc, I5100_NERR_NF_MEM, &dw2);
		if (dw2)
			pci_write_config_dword(priv->mc, I5100_NERR_NF_MEM,
					       dw2);
		pci_write_config_dword(priv->mc, I5100_FERR_NF_MEM, dw);


		i5100_read_log(mci, i5100_ferr_nf_mem_chan_indx(dw),
		i5100_read_log(mci, i5100_ferr_nf_mem_chan_indx(dw),
			       i5100_ferr_nf_mem_any(dw),
			       i5100_ferr_nf_mem_any(dw),
			       i5100_nerr_nf_mem_any(dw2));
			       i5100_nerr_nf_mem_any(dw2));

		pci_write_config_dword(priv->mc, I5100_NERR_NF_MEM, dw2);
	}
	}
	pci_write_config_dword(priv->mc, I5100_FERR_NF_MEM, dw);
}
}


/* The i5100 chipset will scrub the entire memory once, then
/* The i5100 chipset will scrub the entire memory once, then
+38 −16
Original line number Original line Diff line number Diff line
@@ -735,7 +735,7 @@ static int i5400_get_devices(struct mem_ctl_info *mci, int dev_idx)


	/* Attempt to 'get' the MCH register we want */
	/* Attempt to 'get' the MCH register we want */
	pdev = NULL;
	pdev = NULL;
	while (!pvt->branchmap_werrors || !pvt->fsb_error_regs) {
	while (1) {
		pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
		pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
				      PCI_DEVICE_ID_INTEL_5400_ERR, pdev);
				      PCI_DEVICE_ID_INTEL_5400_ERR, pdev);
		if (!pdev) {
		if (!pdev) {
@@ -743,23 +743,42 @@ static int i5400_get_devices(struct mem_ctl_info *mci, int dev_idx)
			i5400_printk(KERN_ERR,
			i5400_printk(KERN_ERR,
				"'system address,Process Bus' "
				"'system address,Process Bus' "
				"device not found:"
				"device not found:"
				"vendor 0x%x device 0x%x ERR funcs "
				"vendor 0x%x device 0x%x ERR func 1 "
				"(broken BIOS?)\n",
				"(broken BIOS?)\n",
				PCI_VENDOR_ID_INTEL,
				PCI_VENDOR_ID_INTEL,
				PCI_DEVICE_ID_INTEL_5400_ERR);
				PCI_DEVICE_ID_INTEL_5400_ERR);
			goto error;
			return -ENODEV;
		}
		}


		/* Store device 16 funcs 1 and 2 */
		/* Store device 16 func 1 */
		switch (PCI_FUNC(pdev->devfn)) {
		if (PCI_FUNC(pdev->devfn) == 1)
		case 1:
			pvt->branchmap_werrors = pdev;
			break;
		case 2:
			pvt->fsb_error_regs = pdev;
			break;
			break;
	}
	}
	pvt->branchmap_werrors = pdev;

	pdev = NULL;
	while (1) {
		pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
				      PCI_DEVICE_ID_INTEL_5400_ERR, pdev);
		if (!pdev) {
			/* End of list, leave */
			i5400_printk(KERN_ERR,
				"'system address,Process Bus' "
				"device not found:"
				"vendor 0x%x device 0x%x ERR func 2 "
				"(broken BIOS?)\n",
				PCI_VENDOR_ID_INTEL,
				PCI_DEVICE_ID_INTEL_5400_ERR);

			pci_dev_put(pvt->branchmap_werrors);
			return -ENODEV;
		}

		/* Store device 16 func 2 */
		if (PCI_FUNC(pdev->devfn) == 2)
			break;
	}
	}
	pvt->fsb_error_regs = pdev;


	debugf1("System Address, processor bus- PCI Bus ID: %s  %x:%x\n",
	debugf1("System Address, processor bus- PCI Bus ID: %s  %x:%x\n",
		pci_name(pvt->system_address),
		pci_name(pvt->system_address),
@@ -778,7 +797,10 @@ static int i5400_get_devices(struct mem_ctl_info *mci, int dev_idx)
			"MC: 'BRANCH 0' device not found:"
			"MC: 'BRANCH 0' device not found:"
			"vendor 0x%x device 0x%x Func 0 (broken BIOS?)\n",
			"vendor 0x%x device 0x%x Func 0 (broken BIOS?)\n",
			PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5400_FBD0);
			PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5400_FBD0);
		goto error;

		pci_dev_put(pvt->fsb_error_regs);
		pci_dev_put(pvt->branchmap_werrors);
		return -ENODEV;
	}
	}


	/* If this device claims to have more than 2 channels then
	/* If this device claims to have more than 2 channels then
@@ -796,14 +818,14 @@ static int i5400_get_devices(struct mem_ctl_info *mci, int dev_idx)
			"(broken BIOS?)\n",
			"(broken BIOS?)\n",
			PCI_VENDOR_ID_INTEL,
			PCI_VENDOR_ID_INTEL,
			PCI_DEVICE_ID_INTEL_5400_FBD1);
			PCI_DEVICE_ID_INTEL_5400_FBD1);
		goto error;

		pci_dev_put(pvt->branch_0);
		pci_dev_put(pvt->fsb_error_regs);
		pci_dev_put(pvt->branchmap_werrors);
		return -ENODEV;
	}
	}


	return 0;
	return 0;

error:
	i5400_put_devices(mci);
	return -ENODEV;
}
}


/*
/*
+2 −2
Original line number Original line Diff line number Diff line
@@ -184,7 +184,7 @@ struct ppc4xx_ecc_status {


/* Function Prototypes */
/* Function Prototypes */


static int ppc4xx_edac_probe(struct platform_device *device)
static int ppc4xx_edac_probe(struct platform_device *device);
static int ppc4xx_edac_remove(struct platform_device *device);
static int ppc4xx_edac_remove(struct platform_device *device);


/* Global Variables */
/* Global Variables */
@@ -1068,7 +1068,7 @@ ppc4xx_edac_mc_init(struct mem_ctl_info *mci,


	mci->mod_name		= PPC4XX_EDAC_MODULE_NAME;
	mci->mod_name		= PPC4XX_EDAC_MODULE_NAME;
	mci->mod_ver		= PPC4XX_EDAC_MODULE_REVISION;
	mci->mod_ver		= PPC4XX_EDAC_MODULE_REVISION;
	mci->ctl_name		= match->compatible,
	mci->ctl_name		= ppc4xx_edac_match->compatible,
	mci->dev_name		= np->full_name;
	mci->dev_name		= np->full_name;


	/* Initialize callbacks */
	/* Initialize callbacks */
Loading