public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: dougthompson@xmission.com
Cc: greg@kroah.com, alan@lxorguk.ukuu.org.uk,
	linux-kernel@vger.kernel.org, Egor Martovetsky <egor@pasemi.com>
Subject: Re: [PATCH 3/8] drivers edac new pasemi driver
Date: Fri, 13 Jul 2007 11:36:41 -0700	[thread overview]
Message-ID: <20070713113641.52157b67.akpm@linux-foundation.org> (raw)
In-Reply-To: <4697adf6.ml1pGGjvWEkYBXbh%dougthompson@xmission.com>

On Fri, 13 Jul 2007 10:53:10 -0600
dougthompson@xmission.com wrote:

> From: Egor Martovetsky <egor@pasemi.com>
> 
> 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;
_


  reply	other threads:[~2007-07-13 18:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-13 16:53 [PATCH 3/8] drivers edac new pasemi driver dougthompson
2007-07-13 18:36 ` Andrew Morton [this message]
2007-07-15  0:12   ` Doug Thompson
2007-07-15  4:51     ` Andrew Morton
2007-07-15  0:21   ` Olof Johansson
  -- strict thread matches above, loose matches on Subject: below --
2007-07-09 17:10 dougthompson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070713113641.52157b67.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dougthompson@xmission.com \
    --cc=egor@pasemi.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox