Commit b52c6402 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac

Pull EDAC fixes from Mauro Carvalho Chehab:
 "One EDAC core fix, and a few driver fixes (i7300, i9275x, i7core)."

* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac:
  i7core_edac: fix panic when accessing sysfs files
  i7300_edac: Fix error flag testing
  edac: Fix the dimm filling for csrows-based layouts
  i82975x_edac: Fix dimm label initialization
parents 4ba00329 42709efb
...@@ -416,11 +416,19 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, ...@@ -416,11 +416,19 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
dimm->cschannel = chn; dimm->cschannel = chn;
/* Increment csrow location */ /* Increment csrow location */
if (layers[0].is_virt_csrow) {
chn++;
if (chn == tot_channels) {
chn = 0;
row++;
}
} else {
row++; row++;
if (row == tot_csrows) { if (row == tot_csrows) {
row = 0; row = 0;
chn++; chn++;
} }
}
/* Increment dimm location */ /* Increment dimm location */
for (j = n_layers - 1; j >= 0; j--) { for (j = n_layers - 1; j >= 0; j--) {
......
...@@ -197,8 +197,8 @@ static const char *ferr_fat_fbd_name[] = { ...@@ -197,8 +197,8 @@ static const char *ferr_fat_fbd_name[] = {
[0] = "Memory Write error on non-redundant retry or " [0] = "Memory Write error on non-redundant retry or "
"FBD configuration Write error on retry", "FBD configuration Write error on retry",
}; };
#define GET_FBD_FAT_IDX(fbderr) (fbderr & (3 << 28)) #define GET_FBD_FAT_IDX(fbderr) (((fbderr) >> 28) & 3)
#define FERR_FAT_FBD_ERR_MASK ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3)) #define FERR_FAT_FBD_ERR_MASK ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 22))
#define FERR_NF_FBD 0xa0 #define FERR_NF_FBD 0xa0
static const char *ferr_nf_fbd_name[] = { static const char *ferr_nf_fbd_name[] = {
...@@ -225,7 +225,7 @@ static const char *ferr_nf_fbd_name[] = { ...@@ -225,7 +225,7 @@ static const char *ferr_nf_fbd_name[] = {
[1] = "Aliased Uncorrectable Non-Mirrored Demand Data ECC", [1] = "Aliased Uncorrectable Non-Mirrored Demand Data ECC",
[0] = "Uncorrectable Data ECC on Replay", [0] = "Uncorrectable Data ECC on Replay",
}; };
#define GET_FBD_NF_IDX(fbderr) (fbderr & (3 << 28)) #define GET_FBD_NF_IDX(fbderr) (((fbderr) >> 28) & 3)
#define FERR_NF_FBD_ERR_MASK ((1 << 24) | (1 << 23) | (1 << 22) | (1 << 21) |\ #define FERR_NF_FBD_ERR_MASK ((1 << 24) | (1 << 23) | (1 << 22) | (1 << 21) |\
(1 << 18) | (1 << 17) | (1 << 16) | (1 << 15) |\ (1 << 18) | (1 << 17) | (1 << 16) | (1 << 15) |\
(1 << 14) | (1 << 13) | (1 << 11) | (1 << 10) |\ (1 << 14) | (1 << 13) | (1 << 11) | (1 << 10) |\
...@@ -464,7 +464,7 @@ static void i7300_process_fbd_error(struct mem_ctl_info *mci) ...@@ -464,7 +464,7 @@ static void i7300_process_fbd_error(struct mem_ctl_info *mci)
errnum = find_first_bit(&errors, errnum = find_first_bit(&errors,
ARRAY_SIZE(ferr_nf_fbd_name)); ARRAY_SIZE(ferr_nf_fbd_name));
specific = GET_ERR_FROM_TABLE(ferr_nf_fbd_name, errnum); specific = GET_ERR_FROM_TABLE(ferr_nf_fbd_name, errnum);
branch = (GET_FBD_FAT_IDX(error_reg) == 2) ? 1 : 0; branch = (GET_FBD_NF_IDX(error_reg) == 2) ? 1 : 0;
pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map, pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map,
REDMEMA, &syndrome); REDMEMA, &syndrome);
......
...@@ -816,7 +816,7 @@ static ssize_t i7core_inject_store_##param( \ ...@@ -816,7 +816,7 @@ static ssize_t i7core_inject_store_##param( \
struct device_attribute *mattr, \ struct device_attribute *mattr, \
const char *data, size_t count) \ const char *data, size_t count) \
{ \ { \
struct mem_ctl_info *mci = to_mci(dev); \ struct mem_ctl_info *mci = dev_get_drvdata(dev); \
struct i7core_pvt *pvt; \ struct i7core_pvt *pvt; \
long value; \ long value; \
int rc; \ int rc; \
...@@ -845,7 +845,7 @@ static ssize_t i7core_inject_show_##param( \ ...@@ -845,7 +845,7 @@ static ssize_t i7core_inject_show_##param( \
struct device_attribute *mattr, \ struct device_attribute *mattr, \
char *data) \ char *data) \
{ \ { \
struct mem_ctl_info *mci = to_mci(dev); \ struct mem_ctl_info *mci = dev_get_drvdata(dev); \
struct i7core_pvt *pvt; \ struct i7core_pvt *pvt; \
\ \
pvt = mci->pvt_info; \ pvt = mci->pvt_info; \
...@@ -1052,7 +1052,7 @@ static ssize_t i7core_show_counter_##param( \ ...@@ -1052,7 +1052,7 @@ static ssize_t i7core_show_counter_##param( \
struct device_attribute *mattr, \ struct device_attribute *mattr, \
char *data) \ char *data) \
{ \ { \
struct mem_ctl_info *mci = to_mci(dev); \ struct mem_ctl_info *mci = dev_get_drvdata(dev); \
struct i7core_pvt *pvt = mci->pvt_info; \ struct i7core_pvt *pvt = mci->pvt_info; \
\ \
edac_dbg(1, "\n"); \ edac_dbg(1, "\n"); \
......
...@@ -370,10 +370,6 @@ static enum dev_type i82975x_dram_type(void __iomem *mch_window, int rank) ...@@ -370,10 +370,6 @@ static enum dev_type i82975x_dram_type(void __iomem *mch_window, int rank)
static void i82975x_init_csrows(struct mem_ctl_info *mci, static void i82975x_init_csrows(struct mem_ctl_info *mci,
struct pci_dev *pdev, void __iomem *mch_window) struct pci_dev *pdev, void __iomem *mch_window)
{ {
static const char *labels[4] = {
"DIMM A1", "DIMM A2",
"DIMM B1", "DIMM B2"
};
struct csrow_info *csrow; struct csrow_info *csrow;
unsigned long last_cumul_size; unsigned long last_cumul_size;
u8 value; u8 value;
...@@ -423,9 +419,10 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci, ...@@ -423,9 +419,10 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci,
dimm = mci->csrows[index]->channels[chan]->dimm; dimm = mci->csrows[index]->channels[chan]->dimm;
dimm->nr_pages = nr_pages / csrow->nr_channels; dimm->nr_pages = nr_pages / csrow->nr_channels;
strncpy(csrow->channels[chan]->dimm->label,
labels[(index >> 1) + (chan * 2)], snprintf(csrow->channels[chan]->dimm->label, EDAC_MC_LABEL_LEN, "DIMM %c%d",
EDAC_MC_LABEL_LEN); (chan == 0) ? 'A' : 'B',
index);
dimm->grain = 1 << 7; /* 128Byte cache-line resolution */ dimm->grain = 1 << 7; /* 128Byte cache-line resolution */
dimm->dtype = i82975x_dram_type(mch_window, index); dimm->dtype = i82975x_dram_type(mch_window, index);
dimm->mtype = MEM_DDR2; /* I82975x supports only DDR2 */ dimm->mtype = MEM_DDR2; /* I82975x supports only DDR2 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment