i3200_edac.c (e644dae645e167d154c0526358940986682a72b0) i3200_edac.c (084a4fccef39ac7abb039511f32380f28d0b67e6)
1/*
2 * Intel 3200/3210 Memory Controller kernel module
3 * Copyright (C) 2008-2009 Akamai Technologies, Inc.
4 * Portions by Hitoshi Mitake <h.mitake@gmail.com>.
5 *
6 * This file may be distributed under the terms of the
7 * GNU General Public License.
8 */

--- 305 unchanged lines hidden (view full) ---

314
315 n <<= (I3200_DRB_SHIFT - PAGE_SHIFT);
316 return n;
317}
318
319static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
320{
321 int rc;
1/*
2 * Intel 3200/3210 Memory Controller kernel module
3 * Copyright (C) 2008-2009 Akamai Technologies, Inc.
4 * Portions by Hitoshi Mitake <h.mitake@gmail.com>.
5 *
6 * This file may be distributed under the terms of the
7 * GNU General Public License.
8 */

--- 305 unchanged lines hidden (view full) ---

314
315 n <<= (I3200_DRB_SHIFT - PAGE_SHIFT);
316 return n;
317}
318
319static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
320{
321 int rc;
322 int i;
322 int i, j;
323 struct mem_ctl_info *mci = NULL;
324 unsigned long last_page;
325 u16 drbs[I3200_CHANNELS][I3200_RANKS_PER_CHANNEL];
326 bool stacked;
327 void __iomem *window;
328 struct i3200_priv *priv;
329
330 debugf0("MC: %s()\n", __func__);

--- 39 unchanged lines hidden (view full) ---

370 for (i = 0; i < mci->nr_csrows; i++) {
371 unsigned long nr_pages;
372 struct csrow_info *csrow = &mci->csrows[i];
373
374 nr_pages = drb_to_nr_pages(drbs, stacked,
375 i / I3200_RANKS_PER_CHANNEL,
376 i % I3200_RANKS_PER_CHANNEL);
377
323 struct mem_ctl_info *mci = NULL;
324 unsigned long last_page;
325 u16 drbs[I3200_CHANNELS][I3200_RANKS_PER_CHANNEL];
326 bool stacked;
327 void __iomem *window;
328 struct i3200_priv *priv;
329
330 debugf0("MC: %s()\n", __func__);

--- 39 unchanged lines hidden (view full) ---

370 for (i = 0; i < mci->nr_csrows; i++) {
371 unsigned long nr_pages;
372 struct csrow_info *csrow = &mci->csrows[i];
373
374 nr_pages = drb_to_nr_pages(drbs, stacked,
375 i / I3200_RANKS_PER_CHANNEL,
376 i % I3200_RANKS_PER_CHANNEL);
377
378 if (nr_pages == 0) {
379 csrow->mtype = MEM_EMPTY;
378 if (nr_pages == 0)
380 continue;
379 continue;
381 }
382
383 csrow->first_page = last_page + 1;
384 last_page += nr_pages;
385 csrow->last_page = last_page;
386 csrow->nr_pages = nr_pages;
387
380
381 csrow->first_page = last_page + 1;
382 last_page += nr_pages;
383 csrow->last_page = last_page;
384 csrow->nr_pages = nr_pages;
385
388 csrow->grain = nr_pages << PAGE_SHIFT;
389 csrow->mtype = MEM_DDR2;
390 csrow->dtype = DEV_UNKNOWN;
391 csrow->edac_mode = EDAC_UNKNOWN;
386 for (j = 0; j < nr_channels; j++) {
387 struct dimm_info *dimm = csrow->channels[j].dimm;
388
389 dimm->grain = nr_pages << PAGE_SHIFT;
390 dimm->mtype = MEM_DDR2;
391 dimm->dtype = DEV_UNKNOWN;
392 dimm->edac_mode = EDAC_UNKNOWN;
393 }
392 }
393
394 i3200_clear_error_info(mci);
395
396 rc = -ENODEV;
397 if (edac_mc_add_mc(mci)) {
398 debugf3("MC: %s(): failed edac_mc_add_mc()\n", __func__);
399 goto fail;

--- 129 unchanged lines hidden ---
394 }
395
396 i3200_clear_error_info(mci);
397
398 rc = -ENODEV;
399 if (edac_mc_add_mc(mci)) {
400 debugf3("MC: %s(): failed edac_mc_add_mc()\n", __func__);
401 goto fail;

--- 129 unchanged lines hidden ---