omap: i2c: add a timeout to the busy waiting
[safe/jmp/linux-2.6] / drivers / edac / i5000_edac.c
index 7d045ad..adc10a2 100644 (file)
@@ -511,8 +511,23 @@ static void i5000_process_fatal_error_info(struct mem_ctl_info *mci,
                                "retry";
                break;
        case FERR_FAT_M3ERR:
+               {
+               static int done;
+
+               /*
+                * This error is generated to inform that the intelligent
+                * throttling is disabled and the temperature passed the
+                * specified middle point. Since this is something the BIOS
+                * should take care of, we'll warn only once to avoid
+                * worthlessly flooding the log.
+                */
+               if (done)
+                       return;
+               done++;
+
                specific = ">Tmid Thermal event with intelligent "
-                               "throttling disabled";
+                          "throttling disabled";
+               }
                break;
        }
 
@@ -562,7 +577,13 @@ static void i5000_process_nonfatal_error_info(struct mem_ctl_info *mci,
                debugf0("\tUncorrected bits= 0x%x\n", ue_errors);
 
                branch = EXTRACT_FBDCHAN_INDX(info->ferr_nf_fbd);
-               channel = branch;
+
+               /*
+                * According with i5000 datasheet, bit 28 has no significance
+                * for errors M4Err-M12Err and M17Err-M21Err, on FERR_NF_FBD
+                */
+               channel = branch & 2;
+
                bank = NREC_BANK(info->nrecmema);
                rank = NREC_RANK(info->nrecmema);
                rdwr = NREC_RDWR(info->nrecmema);
@@ -1158,7 +1179,7 @@ static void i5000_get_mc_regs(struct mem_ctl_info *mci)
                        pci_read_config_word(pvt->branch_1, where,
                                        &pvt->b1_mtr[slot_row]);
                        debugf2("MTR%d where=0x%x B1 value=0x%x\n", slot_row,
-                               where, pvt->b0_mtr[slot_row]);
+                               where, pvt->b1_mtr[slot_row]);
                } else {
                        pvt->b1_mtr[slot_row] = 0;
                }
@@ -1217,7 +1238,7 @@ static int i5000_init_csrows(struct mem_ctl_info *mci)
        struct csrow_info *p_csrow;
        int empty, channel_count;
        int max_csrows;
-       int mtr;
+       int mtr, mtr1;
        int csrow_megs;
        int channel;
        int csrow;
@@ -1236,9 +1257,10 @@ static int i5000_init_csrows(struct mem_ctl_info *mci)
 
                /* use branch 0 for the basis */
                mtr = pvt->b0_mtr[csrow >> 1];
+               mtr1 = pvt->b1_mtr[csrow >> 1];
 
                /* if no DIMMS on this row, continue */
-               if (!MTR_DIMMS_PRESENT(mtr))
+               if (!MTR_DIMMS_PRESENT(mtr) && !MTR_DIMMS_PRESENT(mtr1))
                        continue;
 
                /* FAKE OUT VALUES, FIXME */
@@ -1366,6 +1388,7 @@ static int i5000_probe1(struct pci_dev *pdev, int dev_idx)
        if (mci == NULL)
                return -ENOMEM;
 
+       kobject_get(&mci->edac_mci_kobj);
        debugf0("MC: " __FILE__ ": %s(): mci = %p\n", __func__, mci);
 
        mci->dev = &pdev->dev;  /* record ptr  to the generic device */
@@ -1438,6 +1461,7 @@ fail1:
        i5000_put_devices(mci);
 
 fail0:
+       kobject_put(&mci->edac_mci_kobj);
        edac_mc_free(mci);
        return -ENODEV;
 }
@@ -1483,7 +1507,7 @@ static void __devexit i5000_remove_one(struct pci_dev *pdev)
 
        /* retrieve references to resources, and free those resources */
        i5000_put_devices(mci);
-
+       kobject_put(&mci->edac_mci_kobj);
        edac_mc_free(mci);
 }