Skip to content

Commit b52c640

Browse files
committed
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
2 parents 4ba0032 + 42709ef commit b52c640

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

drivers/edac/edac_mc.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,18 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
416416
dimm->cschannel = chn;
417417

418418
/* Increment csrow location */
419-
row++;
420-
if (row == tot_csrows) {
421-
row = 0;
419+
if (layers[0].is_virt_csrow) {
422420
chn++;
421+
if (chn == tot_channels) {
422+
chn = 0;
423+
row++;
424+
}
425+
} else {
426+
row++;
427+
if (row == tot_csrows) {
428+
row = 0;
429+
chn++;
430+
}
423431
}
424432

425433
/* Increment dimm location */

drivers/edac/i7300_edac.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ static const char *ferr_fat_fbd_name[] = {
197197
[0] = "Memory Write error on non-redundant retry or "
198198
"FBD configuration Write error on retry",
199199
};
200-
#define GET_FBD_FAT_IDX(fbderr) (fbderr & (3 << 28))
201-
#define FERR_FAT_FBD_ERR_MASK ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3))
200+
#define GET_FBD_FAT_IDX(fbderr) (((fbderr) >> 28) & 3)
201+
#define FERR_FAT_FBD_ERR_MASK ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 22))
202202

203203
#define FERR_NF_FBD 0xa0
204204
static const char *ferr_nf_fbd_name[] = {
@@ -225,7 +225,7 @@ static const char *ferr_nf_fbd_name[] = {
225225
[1] = "Aliased Uncorrectable Non-Mirrored Demand Data ECC",
226226
[0] = "Uncorrectable Data ECC on Replay",
227227
};
228-
#define GET_FBD_NF_IDX(fbderr) (fbderr & (3 << 28))
228+
#define GET_FBD_NF_IDX(fbderr) (((fbderr) >> 28) & 3)
229229
#define FERR_NF_FBD_ERR_MASK ((1 << 24) | (1 << 23) | (1 << 22) | (1 << 21) |\
230230
(1 << 18) | (1 << 17) | (1 << 16) | (1 << 15) |\
231231
(1 << 14) | (1 << 13) | (1 << 11) | (1 << 10) |\
@@ -464,7 +464,7 @@ static void i7300_process_fbd_error(struct mem_ctl_info *mci)
464464
errnum = find_first_bit(&errors,
465465
ARRAY_SIZE(ferr_nf_fbd_name));
466466
specific = GET_ERR_FROM_TABLE(ferr_nf_fbd_name, errnum);
467-
branch = (GET_FBD_FAT_IDX(error_reg) == 2) ? 1 : 0;
467+
branch = (GET_FBD_NF_IDX(error_reg) == 2) ? 1 : 0;
468468

469469
pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map,
470470
REDMEMA, &syndrome);

drivers/edac/i7core_edac.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ static ssize_t i7core_inject_store_##param( \
816816
struct device_attribute *mattr, \
817817
const char *data, size_t count) \
818818
{ \
819-
struct mem_ctl_info *mci = to_mci(dev); \
819+
struct mem_ctl_info *mci = dev_get_drvdata(dev); \
820820
struct i7core_pvt *pvt; \
821821
long value; \
822822
int rc; \
@@ -845,7 +845,7 @@ static ssize_t i7core_inject_show_##param( \
845845
struct device_attribute *mattr, \
846846
char *data) \
847847
{ \
848-
struct mem_ctl_info *mci = to_mci(dev); \
848+
struct mem_ctl_info *mci = dev_get_drvdata(dev); \
849849
struct i7core_pvt *pvt; \
850850
\
851851
pvt = mci->pvt_info; \
@@ -1052,7 +1052,7 @@ static ssize_t i7core_show_counter_##param( \
10521052
struct device_attribute *mattr, \
10531053
char *data) \
10541054
{ \
1055-
struct mem_ctl_info *mci = to_mci(dev); \
1055+
struct mem_ctl_info *mci = dev_get_drvdata(dev); \
10561056
struct i7core_pvt *pvt = mci->pvt_info; \
10571057
\
10581058
edac_dbg(1, "\n"); \

drivers/edac/i82975x_edac.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,6 @@ static enum dev_type i82975x_dram_type(void __iomem *mch_window, int rank)
370370
static void i82975x_init_csrows(struct mem_ctl_info *mci,
371371
struct pci_dev *pdev, void __iomem *mch_window)
372372
{
373-
static const char *labels[4] = {
374-
"DIMM A1", "DIMM A2",
375-
"DIMM B1", "DIMM B2"
376-
};
377373
struct csrow_info *csrow;
378374
unsigned long last_cumul_size;
379375
u8 value;
@@ -423,9 +419,10 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci,
423419
dimm = mci->csrows[index]->channels[chan]->dimm;
424420

425421
dimm->nr_pages = nr_pages / csrow->nr_channels;
426-
strncpy(csrow->channels[chan]->dimm->label,
427-
labels[(index >> 1) + (chan * 2)],
428-
EDAC_MC_LABEL_LEN);
422+
423+
snprintf(csrow->channels[chan]->dimm->label, EDAC_MC_LABEL_LEN, "DIMM %c%d",
424+
(chan == 0) ? 'A' : 'B',
425+
index);
429426
dimm->grain = 1 << 7; /* 128Byte cache-line resolution */
430427
dimm->dtype = i82975x_dram_type(mch_window, index);
431428
dimm->mtype = MEM_DDR2; /* I82975x supports only DDR2 */

0 commit comments

Comments
 (0)