Commit 95b93287 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

i3200_edac: convert driver to use the new edac ABI

The legacy edac ABI is going to be removed. Port the driver to use
and benefit from the new API functionality.

Cc: Hitoshi Mitake <h.mitake@gmail.com>
Cc: Borislav Petkov <borislav.petkov@amd.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 884906f1
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#define PCI_DEVICE_ID_INTEL_3200_HB 0x29f0 #define PCI_DEVICE_ID_INTEL_3200_HB 0x29f0
#define I3200_DIMMS 4
#define I3200_RANKS 8 #define I3200_RANKS 8
#define I3200_RANKS_PER_CHANNEL 4 #define I3200_RANKS_PER_CHANNEL 4
#define I3200_CHANNELS 2 #define I3200_CHANNELS 2
...@@ -217,21 +218,25 @@ static void i3200_process_error_info(struct mem_ctl_info *mci, ...@@ -217,21 +218,25 @@ static void i3200_process_error_info(struct mem_ctl_info *mci,
return; return;
if ((info->errsts ^ info->errsts2) & I3200_ERRSTS_BITS) { if ((info->errsts ^ info->errsts2) & I3200_ERRSTS_BITS) {
edac_mc_handle_ce_no_info(mci, "UE overwrote CE"); edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 0, 0, 0,
-1, -1, -1, "UE overwrote CE", "", NULL);
info->errsts = info->errsts2; info->errsts = info->errsts2;
} }
for (channel = 0; channel < nr_channels; channel++) { for (channel = 0; channel < nr_channels; channel++) {
log = info->eccerrlog[channel]; log = info->eccerrlog[channel];
if (log & I3200_ECCERRLOG_UE) { if (log & I3200_ECCERRLOG_UE) {
edac_mc_handle_ue(mci, 0, 0, edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci,
eccerrlog_row(channel, log), 0, 0, 0,
"i3200 UE"); eccerrlog_row(channel, log),
-1, -1,
"i3000 UE", "", NULL);
} else if (log & I3200_ECCERRLOG_CE) { } else if (log & I3200_ECCERRLOG_CE) {
edac_mc_handle_ce(mci, 0, 0, edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci,
eccerrlog_syndrome(log), 0, 0, eccerrlog_syndrome(log),
eccerrlog_row(channel, log), 0, eccerrlog_row(channel, log),
"i3200 CE"); -1, -1,
"i3000 UE", "", NULL);
} }
} }
} }
...@@ -321,6 +326,7 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx) ...@@ -321,6 +326,7 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
int rc; int rc;
int i, j; int i, j;
struct mem_ctl_info *mci = NULL; struct mem_ctl_info *mci = NULL;
struct edac_mc_layer layers[2];
u16 drbs[I3200_CHANNELS][I3200_RANKS_PER_CHANNEL]; u16 drbs[I3200_CHANNELS][I3200_RANKS_PER_CHANNEL];
bool stacked; bool stacked;
void __iomem *window; void __iomem *window;
...@@ -335,8 +341,14 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx) ...@@ -335,8 +341,14 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
i3200_get_drbs(window, drbs); i3200_get_drbs(window, drbs);
nr_channels = how_many_channels(pdev); nr_channels = how_many_channels(pdev);
mci = edac_mc_alloc(sizeof(struct i3200_priv), I3200_RANKS, layers[0].type = EDAC_MC_LAYER_CHIP_SELECT;
nr_channels, 0); layers[0].size = I3200_DIMMS;
layers[0].is_virt_csrow = true;
layers[1].type = EDAC_MC_LAYER_CHANNEL;
layers[1].size = nr_channels;
layers[1].is_virt_csrow = false;
mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers,
sizeof(struct i3200_priv));
if (!mci) if (!mci)
return -ENOMEM; return -ENOMEM;
......
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