aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/amd76x_edac.c
diff options
context:
space:
mode:
authorDave Peterson <dsp@llnl.gov>2006-03-26 04:38:40 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:57:06 -0500
commit537fba28928c01b7db1580627450691a4bb0b9b3 (patch)
tree1fd5adaa38ba639e28b56e014bfb309c0d1e181e /drivers/edac/amd76x_edac.c
parentf2fe42abbf0d99a8c4b96f1cc55db10ac35d2fb9 (diff)
[PATCH] EDAC: printk cleanup
This implements the following idea: On Monday 30 January 2006 19:22, Eric W. Biederman wrote: > One piece missing from this conversation is the issue that we need errors > in a uniform format. That is why edac_mc has helper functions. > > However there will always be errors that don't fit any particular model. > Could we add a edac_printk(dev, ); That is similar to dev_printk but > prints out an EDAC header and the device on which the error was found? > Letting the rest of the string be user specified. > > For actual control that interface may be to blunt, but at least for people > looking in the logs it allows all of the errors to be detected and > harvested. Signed-off-by: David S. Peterson <dsp@llnl.gov> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/edac/amd76x_edac.c')
-rw-r--r--drivers/edac/amd76x_edac.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c
index 2fcc8120b53c..60535bb9275f 100644
--- a/drivers/edac/amd76x_edac.c
+++ b/drivers/edac/amd76x_edac.c
@@ -25,6 +25,14 @@
25#include "edac_mc.h" 25#include "edac_mc.h"
26 26
27 27
28#define amd76x_printk(level, fmt, arg...) \
29 edac_printk(level, "amd76x", fmt, ##arg)
30
31
32#define amd76x_mc_printk(mci, level, fmt, arg...) \
33 edac_mc_chipset_printk(mci, level, "amd76x", fmt, ##arg)
34
35
28#define AMD76X_NR_CSROWS 8 36#define AMD76X_NR_CSROWS 8
29#define AMD76X_NR_CHANS 1 37#define AMD76X_NR_CHANS 1
30#define AMD76X_NR_DIMMS 4 38#define AMD76X_NR_DIMMS 4
@@ -174,7 +182,7 @@ static int amd76x_process_error_info (struct mem_ctl_info *mci,
174static void amd76x_check(struct mem_ctl_info *mci) 182static void amd76x_check(struct mem_ctl_info *mci)
175{ 183{
176 struct amd76x_error_info info; 184 struct amd76x_error_info info;
177 debugf3("MC: " __FILE__ ": %s()\n", __func__); 185 debugf3("%s()\n", __func__);
178 amd76x_get_error_info(mci, &info); 186 amd76x_get_error_info(mci, &info);
179 amd76x_process_error_info(mci, &info, 1); 187 amd76x_process_error_info(mci, &info, 1);
180} 188}
@@ -204,7 +212,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
204 u32 ems; 212 u32 ems;
205 u32 ems_mode; 213 u32 ems_mode;
206 214
207 debugf0("MC: " __FILE__ ": %s()\n", __func__); 215 debugf0("%s()\n", __func__);
208 216
209 pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS, &ems); 217 pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS, &ems);
210 ems_mode = (ems >> 10) & 0x3; 218 ems_mode = (ems >> 10) & 0x3;
@@ -216,7 +224,7 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
216 goto fail; 224 goto fail;
217 } 225 }
218 226
219 debugf0("MC: " __FILE__ ": %s(): mci = %p\n", __func__, mci); 227 debugf0("%s(): mci = %p\n", __func__, mci);
220 228
221 mci->pdev = pci_dev_get(pdev); 229 mci->pdev = pci_dev_get(pdev);
222 mci->mtype_cap = MEM_FLAG_RDDR; 230 mci->mtype_cap = MEM_FLAG_RDDR;
@@ -267,13 +275,12 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
267 (u32) (0x3 << 8)); 275 (u32) (0x3 << 8));
268 276
269 if (edac_mc_add_mc(mci)) { 277 if (edac_mc_add_mc(mci)) {
270 debugf3("MC: " __FILE__ 278 debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
271 ": %s(): failed edac_mc_add_mc()\n", __func__);
272 goto fail; 279 goto fail;
273 } 280 }
274 281
275 /* get this far and it's successful */ 282 /* get this far and it's successful */
276 debugf3("MC: " __FILE__ ": %s(): success\n", __func__); 283 debugf3("%s(): success\n", __func__);
277 return 0; 284 return 0;
278 285
279fail: 286fail:
@@ -289,7 +296,7 @@ fail:
289static int __devinit amd76x_init_one(struct pci_dev *pdev, 296static int __devinit amd76x_init_one(struct pci_dev *pdev,
290 const struct pci_device_id *ent) 297 const struct pci_device_id *ent)
291{ 298{
292 debugf0("MC: " __FILE__ ": %s()\n", __func__); 299 debugf0("%s()\n", __func__);
293 300
294 /* don't need to call pci_device_enable() */ 301 /* don't need to call pci_device_enable() */
295 return amd76x_probe1(pdev, ent->driver_data); 302 return amd76x_probe1(pdev, ent->driver_data);
@@ -309,7 +316,7 @@ static void __devexit amd76x_remove_one(struct pci_dev *pdev)
309{ 316{
310 struct mem_ctl_info *mci; 317 struct mem_ctl_info *mci;
311 318
312 debugf0(__FILE__ ": %s()\n", __func__); 319 debugf0("%s()\n", __func__);
313 320
314 if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL) 321 if ((mci = edac_mc_find_mci_by_pdev(pdev)) == NULL)
315 return; 322 return;