aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/i82860_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/i82860_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/i82860_edac.c')
-rw-r--r--drivers/edac/i82860_edac.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/edac/i82860_edac.c b/drivers/edac/i82860_edac.c
index 52596e75f9c2..fa9ab84fa5c9 100644
--- a/drivers/edac/i82860_edac.c
+++ b/drivers/edac/i82860_edac.c
@@ -19,6 +19,14 @@
19#include "edac_mc.h" 19#include "edac_mc.h"
20 20
21 21
22#define i82860_printk(level, fmt, arg...) \
23 edac_printk(level, "i82860", fmt, ##arg)
24
25
26#define i82860_mc_printk(mci, level, fmt, arg...) \
27 edac_mc_chipset_printk(mci, level, "i82860", fmt, ##arg)
28
29
22#ifndef PCI_DEVICE_ID_INTEL_82860_0 30#ifndef PCI_DEVICE_ID_INTEL_82860_0
23#define PCI_DEVICE_ID_INTEL_82860_0 0x2531 31#define PCI_DEVICE_ID_INTEL_82860_0 0x2531
24#endif /* PCI_DEVICE_ID_INTEL_82860_0 */ 32#endif /* PCI_DEVICE_ID_INTEL_82860_0 */
@@ -117,7 +125,7 @@ static void i82860_check(struct mem_ctl_info *mci)
117{ 125{
118 struct i82860_error_info info; 126 struct i82860_error_info info;
119 127
120 debugf1("MC%d: " __FILE__ ": %s()\n", mci->mc_idx, __func__); 128 debugf1("MC%d: %s()\n", mci->mc_idx, __func__);
121 i82860_get_error_info(mci, &info); 129 i82860_get_error_info(mci, &info);
122 i82860_process_error_info(mci, &info, 1); 130 i82860_process_error_info(mci, &info, 1);
123} 131}
@@ -143,7 +151,7 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
143 if (!mci) 151 if (!mci)
144 return -ENOMEM; 152 return -ENOMEM;
145 153
146 debugf3("MC: " __FILE__ ": %s(): init mci\n", __func__); 154 debugf3("%s(): init mci\n", __func__);
147 155
148 mci->pdev = pdev; 156 mci->pdev = pdev;
149 mci->mtype_cap = MEM_FLAG_DDR; 157 mci->mtype_cap = MEM_FLAG_DDR;
@@ -179,8 +187,8 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
179 187
180 cumul_size = (value & I82860_GBA_MASK) << 188 cumul_size = (value & I82860_GBA_MASK) <<
181 (I82860_GBA_SHIFT - PAGE_SHIFT); 189 (I82860_GBA_SHIFT - PAGE_SHIFT);
182 debugf3("MC: " __FILE__ ": %s(): (%d) cumul_size 0x%x\n", 190 debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
183 __func__, index, cumul_size); 191 cumul_size);
184 if (cumul_size == last_cumul_size) 192 if (cumul_size == last_cumul_size)
185 continue; /* not populated */ 193 continue; /* not populated */
186 194
@@ -198,13 +206,11 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
198 pci_write_bits16(mci->pdev, I82860_ERRSTS, 0x0003, 0x0003); 206 pci_write_bits16(mci->pdev, I82860_ERRSTS, 0x0003, 0x0003);
199 207
200 if (edac_mc_add_mc(mci)) { 208 if (edac_mc_add_mc(mci)) {
201 debugf3("MC: " __FILE__ 209 debugf3("%s(): failed edac_mc_add_mc()\n", __func__);
202 ": %s(): failed edac_mc_add_mc()\n",
203 __func__);
204 edac_mc_free(mci); 210 edac_mc_free(mci);
205 } else { 211 } else {
206 /* get this far and it's successful */ 212 /* get this far and it's successful */
207 debugf3("MC: " __FILE__ ": %s(): success\n", __func__); 213 debugf3("%s(): success\n", __func__);
208 rc = 0; 214 rc = 0;
209 } 215 }
210 return rc; 216 return rc;
@@ -216,9 +222,9 @@ static int __devinit i82860_init_one(struct pci_dev *pdev,
216{ 222{
217 int rc; 223 int rc;
218 224
219 debugf0("MC: " __FILE__ ": %s()\n", __func__); 225 debugf0("%s()\n", __func__);
220 226
221 printk(KERN_INFO "i82860 init one\n"); 227 i82860_printk(KERN_INFO, "i82860 init one\n");
222 if(pci_enable_device(pdev) < 0) 228 if(pci_enable_device(pdev) < 0)
223 return -EIO; 229 return -EIO;
224 rc = i82860_probe1(pdev, ent->driver_data); 230 rc = i82860_probe1(pdev, ent->driver_data);
@@ -231,7 +237,7 @@ static void __devexit i82860_remove_one(struct pci_dev *pdev)
231{ 237{
232 struct mem_ctl_info *mci; 238 struct mem_ctl_info *mci;
233 239
234 debugf0(__FILE__ ": %s()\n", __func__); 240 debugf0("%s()\n", __func__);
235 241
236 mci = edac_mc_find_mci_by_pdev(pdev); 242 mci = edac_mc_find_mci_by_pdev(pdev);
237 if ((mci != NULL) && (edac_mc_del_mc(mci) == 0)) 243 if ((mci != NULL) && (edac_mc_del_mc(mci) == 0))
@@ -257,7 +263,7 @@ static int __init i82860_init(void)
257{ 263{
258 int pci_rc; 264 int pci_rc;
259 265
260 debugf3("MC: " __FILE__ ": %s()\n", __func__); 266 debugf3("%s()\n", __func__);
261 if ((pci_rc = pci_register_driver(&i82860_driver)) < 0) 267 if ((pci_rc = pci_register_driver(&i82860_driver)) < 0)
262 return pci_rc; 268 return pci_rc;
263 269
@@ -281,7 +287,7 @@ static int __init i82860_init(void)
281 287
282static void __exit i82860_exit(void) 288static void __exit i82860_exit(void)
283{ 289{
284 debugf3("MC: " __FILE__ ": %s()\n", __func__); 290 debugf3("%s()\n", __func__);
285 291
286 pci_unregister_driver(&i82860_driver); 292 pci_unregister_driver(&i82860_driver);
287 if (!i82860_registered) { 293 if (!i82860_registered) {