Re: [PATCH 3/8] drivers edac new pasemi driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 13 Jul 2007 10:53:10 -0600
[email protected] wrote:

> From: Egor Martovetsky <[email protected]>
> 
> NEW EDAC driver for the memory controllers on PA Semi PA6T-1682M.
> 
> Changes since last submission:
> 
> * Rebased on top of 2.6.22-rc4-mm2 with the EDAC changes merged there.
> * Minor checkpatch.pl cleanups
> * Renamed ctl_name
> * Added dev_name
> * edac_mc.h -> edac_core.h
> 
> ...
>
> +static int pasemi_edac_init_csrows(struct mem_ctl_info *mci,
> +				   struct pci_dev *pdev,
> +				   enum edac_type edac_mode)
> +{
> +	struct csrow_info *csrow;
> +	u32 rankcfg;
> +	int index;
> +
> +	for (index = 0; index < mci->nr_csrows; index++) {
> +		csrow = &mci->csrows[index];
> +
> +		pci_read_config_dword(pdev,
> +				      MCDRAM_RANKCFG + (index * 12),
> +				      &rankcfg);
> +
> +		if (!(rankcfg & MCDRAM_RANKCFG_EN))
> +			continue;
> +
> +		switch ((rankcfg & MCDRAM_RANKCFG_TYPE_SIZE_M) >>
> +			MCDRAM_RANKCFG_TYPE_SIZE_S) {
> +		case 0:
> +			csrow->nr_pages = 128 << (20 - PAGE_SHIFT);
> +			break;
> +		case 1:
> +			csrow->nr_pages = 256 << (20 - PAGE_SHIFT);
> +			break;
> +		case 2:
> +		case 3:
> +			csrow->nr_pages = 512 << (20 - PAGE_SHIFT);
> +			break;
> +		case 4:
> +			csrow->nr_pages = 1024 << (20 - PAGE_SHIFT);
> +			break;
> +		case 5:
> +			csrow->nr_pages = 2048 << (20 - PAGE_SHIFT);
> +			break;
> +		default:
> +			edac_mc_printk(mci, KERN_ERR,
> +				       "Unrecognized Rank Config\n");

If this message ever comes out, you're gonna say "argh, I wish I'd printed
rankcfg".

Do you want to do this??

--- a/drivers/edac/pasemi_edac.c~drivers-edac-new-pasemi-driver-fix
+++ a/drivers/edac/pasemi_edac.c
@@ -168,7 +168,8 @@ static int pasemi_edac_init_csrows(struc
 			break;
 		default:
 			edac_mc_printk(mci, KERN_ERR,
-				       "Unrecognized Rank Config\n");
+				"Unrecognized Rank Config. rankcfg=%u\n",
+				rankcfg);
 			return -EINVAL;
 		}
 
@@ -244,9 +245,8 @@ static int __devinit pasemi_edac_probe(s
 	 */
 	pasemi_edac_get_error_info(mci);
 
-	if (edac_mc_add_mc(mci, system_mmc_id++)) {
+	if (edac_mc_add_mc(mci, system_mmc_id++))
 		goto fail;
-	}
 
 	/* get this far and it's successful */
 	return 0;
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux