diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-16 14:09:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-28 18:11:01 -0400 |
commit | 95b93287c6eac639538fb0a2689d3ecc2916c0ec (patch) | |
tree | 688fdc40f7b8d548497e5d87ade145c36e46ebd4 /drivers/edac/i3200_edac.c | |
parent | 884906f197ccfa75787dd908e215fc3fab9dde39 (diff) |
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: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac/i3200_edac.c')
-rw-r--r-- | drivers/edac/i3200_edac.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/edac/i3200_edac.c b/drivers/edac/i3200_edac.c index 3b3622209f3e..d152662ffc66 100644 --- a/drivers/edac/i3200_edac.c +++ b/drivers/edac/i3200_edac.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #define PCI_DEVICE_ID_INTEL_3200_HB 0x29f0 | 24 | #define PCI_DEVICE_ID_INTEL_3200_HB 0x29f0 |
25 | 25 | ||
26 | #define I3200_DIMMS 4 | ||
26 | #define I3200_RANKS 8 | 27 | #define I3200_RANKS 8 |
27 | #define I3200_RANKS_PER_CHANNEL 4 | 28 | #define I3200_RANKS_PER_CHANNEL 4 |
28 | #define I3200_CHANNELS 2 | 29 | #define I3200_CHANNELS 2 |
@@ -217,21 +218,25 @@ static void i3200_process_error_info(struct mem_ctl_info *mci, | |||
217 | return; | 218 | return; |
218 | 219 | ||
219 | if ((info->errsts ^ info->errsts2) & I3200_ERRSTS_BITS) { | 220 | if ((info->errsts ^ info->errsts2) & I3200_ERRSTS_BITS) { |
220 | edac_mc_handle_ce_no_info(mci, "UE overwrote CE"); | 221 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 0, 0, 0, |
222 | -1, -1, -1, "UE overwrote CE", "", NULL); | ||
221 | info->errsts = info->errsts2; | 223 | info->errsts = info->errsts2; |
222 | } | 224 | } |
223 | 225 | ||
224 | for (channel = 0; channel < nr_channels; channel++) { | 226 | for (channel = 0; channel < nr_channels; channel++) { |
225 | log = info->eccerrlog[channel]; | 227 | log = info->eccerrlog[channel]; |
226 | if (log & I3200_ECCERRLOG_UE) { | 228 | if (log & I3200_ECCERRLOG_UE) { |
227 | edac_mc_handle_ue(mci, 0, 0, | 229 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, |
228 | eccerrlog_row(channel, log), | 230 | 0, 0, 0, |
229 | "i3200 UE"); | 231 | eccerrlog_row(channel, log), |
232 | -1, -1, | ||
233 | "i3000 UE", "", NULL); | ||
230 | } else if (log & I3200_ECCERRLOG_CE) { | 234 | } else if (log & I3200_ECCERRLOG_CE) { |
231 | edac_mc_handle_ce(mci, 0, 0, | 235 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, |
232 | eccerrlog_syndrome(log), | 236 | 0, 0, eccerrlog_syndrome(log), |
233 | eccerrlog_row(channel, log), 0, | 237 | eccerrlog_row(channel, log), |
234 | "i3200 CE"); | 238 | -1, -1, |
239 | "i3000 UE", "", NULL); | ||
235 | } | 240 | } |
236 | } | 241 | } |
237 | } | 242 | } |
@@ -321,6 +326,7 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx) | |||
321 | int rc; | 326 | int rc; |
322 | int i, j; | 327 | int i, j; |
323 | struct mem_ctl_info *mci = NULL; | 328 | struct mem_ctl_info *mci = NULL; |
329 | struct edac_mc_layer layers[2]; | ||
324 | u16 drbs[I3200_CHANNELS][I3200_RANKS_PER_CHANNEL]; | 330 | u16 drbs[I3200_CHANNELS][I3200_RANKS_PER_CHANNEL]; |
325 | bool stacked; | 331 | bool stacked; |
326 | void __iomem *window; | 332 | void __iomem *window; |
@@ -335,8 +341,14 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx) | |||
335 | i3200_get_drbs(window, drbs); | 341 | i3200_get_drbs(window, drbs); |
336 | nr_channels = how_many_channels(pdev); | 342 | nr_channels = how_many_channels(pdev); |
337 | 343 | ||
338 | mci = edac_mc_alloc(sizeof(struct i3200_priv), I3200_RANKS, | 344 | layers[0].type = EDAC_MC_LAYER_CHIP_SELECT; |
339 | nr_channels, 0); | 345 | layers[0].size = I3200_DIMMS; |
346 | layers[0].is_virt_csrow = true; | ||
347 | layers[1].type = EDAC_MC_LAYER_CHANNEL; | ||
348 | layers[1].size = nr_channels; | ||
349 | layers[1].is_virt_csrow = false; | ||
350 | mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, | ||
351 | sizeof(struct i3200_priv)); | ||
340 | if (!mci) | 352 | if (!mci) |
341 | return -ENOMEM; | 353 | return -ENOMEM; |
342 | 354 | ||