diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-16 14:12:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-28 18:13:49 -0400 |
commit | e2acc357ee9e77e543861b841aa47fc62c528543 (patch) | |
tree | 836eccbd25150c8404b9cfb7f8396c4cc3b26a8a /drivers/edac | |
parent | 40467db77050592cd514304db770739385b53cc6 (diff) |
x38_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: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/x38_edac.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c index e3247997aa00..8f8cda914534 100644 --- a/drivers/edac/x38_edac.c +++ b/drivers/edac/x38_edac.c | |||
@@ -215,19 +215,26 @@ static void x38_process_error_info(struct mem_ctl_info *mci, | |||
215 | return; | 215 | return; |
216 | 216 | ||
217 | if ((info->errsts ^ info->errsts2) & X38_ERRSTS_BITS) { | 217 | if ((info->errsts ^ info->errsts2) & X38_ERRSTS_BITS) { |
218 | edac_mc_handle_ce_no_info(mci, "UE overwrote CE"); | 218 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 0, 0, 0, |
219 | -1, -1, -1, | ||
220 | "UE overwrote CE", "", NULL); | ||
219 | info->errsts = info->errsts2; | 221 | info->errsts = info->errsts2; |
220 | } | 222 | } |
221 | 223 | ||
222 | for (channel = 0; channel < x38_channel_num; channel++) { | 224 | for (channel = 0; channel < x38_channel_num; channel++) { |
223 | log = info->eccerrlog[channel]; | 225 | log = info->eccerrlog[channel]; |
224 | if (log & X38_ECCERRLOG_UE) { | 226 | if (log & X38_ECCERRLOG_UE) { |
225 | edac_mc_handle_ue(mci, 0, 0, | 227 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, |
226 | eccerrlog_row(channel, log), "x38 UE"); | 228 | 0, 0, 0, |
229 | eccerrlog_row(channel, log), | ||
230 | -1, -1, | ||
231 | "x38 UE", "", NULL); | ||
227 | } else if (log & X38_ECCERRLOG_CE) { | 232 | } else if (log & X38_ECCERRLOG_CE) { |
228 | edac_mc_handle_ce(mci, 0, 0, | 233 | edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, |
229 | eccerrlog_syndrome(log), | 234 | 0, 0, eccerrlog_syndrome(log), |
230 | eccerrlog_row(channel, log), 0, "x38 CE"); | 235 | eccerrlog_row(channel, log), |
236 | -1, -1, | ||
237 | "x38 CE", "", NULL); | ||
231 | } | 238 | } |
232 | } | 239 | } |
233 | } | 240 | } |
@@ -319,6 +326,7 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx) | |||
319 | int rc; | 326 | int rc; |
320 | int i, j; | 327 | int i, j; |
321 | struct mem_ctl_info *mci = NULL; | 328 | struct mem_ctl_info *mci = NULL; |
329 | struct edac_mc_layer layers[2]; | ||
322 | u16 drbs[X38_CHANNELS][X38_RANKS_PER_CHANNEL]; | 330 | u16 drbs[X38_CHANNELS][X38_RANKS_PER_CHANNEL]; |
323 | bool stacked; | 331 | bool stacked; |
324 | void __iomem *window; | 332 | void __iomem *window; |
@@ -334,7 +342,13 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx) | |||
334 | how_many_channel(pdev); | 342 | how_many_channel(pdev); |
335 | 343 | ||
336 | /* FIXME: unconventional pvt_info usage */ | 344 | /* FIXME: unconventional pvt_info usage */ |
337 | mci = edac_mc_alloc(0, X38_RANKS, x38_channel_num, 0); | 345 | layers[0].type = EDAC_MC_LAYER_CHIP_SELECT; |
346 | layers[0].size = X38_RANKS; | ||
347 | layers[0].is_virt_csrow = true; | ||
348 | layers[1].type = EDAC_MC_LAYER_CHANNEL; | ||
349 | layers[1].size = x38_channel_num; | ||
350 | layers[1].is_virt_csrow = false; | ||
351 | mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0); | ||
338 | if (!mci) | 352 | if (!mci) |
339 | return -ENOMEM; | 353 | return -ENOMEM; |
340 | 354 | ||