edac_device.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. /*
  2. * edac_device.c
  3. * (C) 2007 www.douglaskthompson.com
  4. *
  5. * This file may be distributed under the terms of the
  6. * GNU General Public License.
  7. *
  8. * Written by Doug Thompson <norsk5@xmission.com>
  9. *
  10. * edac_device API implementation
  11. * 19 Jan 2007
  12. */
  13. #include <linux/module.h>
  14. #include <linux/types.h>
  15. #include <linux/smp.h>
  16. #include <linux/init.h>
  17. #include <linux/sysctl.h>
  18. #include <linux/highmem.h>
  19. #include <linux/timer.h>
  20. #include <linux/slab.h>
  21. #include <linux/spinlock.h>
  22. #include <linux/list.h>
  23. #include <linux/sysdev.h>
  24. #include <linux/ctype.h>
  25. #include <linux/workqueue.h>
  26. #include <asm/uaccess.h>
  27. #include <asm/page.h>
  28. #include "edac_core.h"
  29. #include "edac_module.h"
  30. /* lock to memory controller's control array */
  31. static DECLARE_MUTEX(device_ctls_mutex);
  32. static struct list_head edac_device_list = LIST_HEAD_INIT(edac_device_list);
  33. static inline void lock_device_list(void)
  34. {
  35. down(&device_ctls_mutex);
  36. }
  37. static inline void unlock_device_list(void)
  38. {
  39. up(&device_ctls_mutex);
  40. }
  41. #ifdef CONFIG_EDAC_DEBUG
  42. static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
  43. {
  44. debugf3("\tedac_dev = %p dev_idx=%d \n", edac_dev,edac_dev->dev_idx);
  45. debugf4("\tedac_dev->edac_check = %p\n", edac_dev->edac_check);
  46. debugf3("\tdev = %p\n", edac_dev->dev);
  47. debugf3("\tmod_name:ctl_name = %s:%s\n",
  48. edac_dev->mod_name, edac_dev->ctl_name);
  49. debugf3("\tpvt_info = %p\n\n", edac_dev->pvt_info);
  50. }
  51. #endif /* CONFIG_EDAC_DEBUG */
  52. /*
  53. * The alloc() and free() functions for the 'edac_device' control info
  54. * structure. A MC driver will allocate one of these for each edac_device
  55. * it is going to control/register with the EDAC CORE.
  56. */
  57. struct edac_device_ctl_info *edac_device_alloc_ctl_info(
  58. unsigned sz_private,
  59. char *edac_device_name,
  60. unsigned nr_instances,
  61. char *edac_block_name,
  62. unsigned nr_blocks,
  63. unsigned offset_value,
  64. struct edac_attrib_spec *attrib_spec,
  65. unsigned nr_attribs)
  66. {
  67. struct edac_device_ctl_info *dev_ctl;
  68. struct edac_device_instance *dev_inst, *inst;
  69. struct edac_device_block *dev_blk, *blk_p, *blk;
  70. struct edac_attrib *dev_attrib, *attrib_p, *attrib;
  71. unsigned total_size;
  72. unsigned count;
  73. unsigned instance, block, attr;
  74. void *pvt;
  75. debugf1("%s() instances=%d blocks=%d\n",
  76. __func__,nr_instances,nr_blocks);
  77. /* Figure out the offsets of the various items from the start of an
  78. * ctl_info structure. We want the alignment of each item
  79. * to be at least as stringent as what the compiler would
  80. * provide if we could simply hardcode everything into a single struct.
  81. */
  82. dev_ctl = (struct edac_device_ctl_info *) 0;
  83. /* Calc the 'end' offset past the ctl_info structure */
  84. dev_inst = (struct edac_device_instance *)
  85. edac_align_ptr(&dev_ctl[1],sizeof(*dev_inst));
  86. /* Calc the 'end' offset past the instance array */
  87. dev_blk = (struct edac_device_block *)
  88. edac_align_ptr(&dev_inst[nr_instances],sizeof(*dev_blk));
  89. /* Calc the 'end' offset past the dev_blk array */
  90. count = nr_instances * nr_blocks;
  91. dev_attrib = (struct edac_attrib *)
  92. edac_align_ptr(&dev_blk[count],sizeof(*dev_attrib));
  93. /* Check for case of NO attributes specified */
  94. if (nr_attribs > 0)
  95. count *= nr_attribs;
  96. /* Calc the 'end' offset past the attributes array */
  97. pvt = edac_align_ptr(&dev_attrib[count],sz_private);
  98. total_size = ((unsigned long) pvt) + sz_private;
  99. /* Allocate the amount of memory for the set of control structures */
  100. if ((dev_ctl = kmalloc(total_size, GFP_KERNEL)) == NULL)
  101. return NULL;
  102. /* Adjust pointers so they point within the memory we just allocated
  103. * rather than an imaginary chunk of memory located at address 0.
  104. */
  105. dev_inst = (struct edac_device_instance *)
  106. (((char *) dev_ctl) + ((unsigned long) dev_inst));
  107. dev_blk = (struct edac_device_block *)
  108. (((char *) dev_ctl) + ((unsigned long) dev_blk));
  109. dev_attrib = (struct edac_attrib *)
  110. (((char *) dev_ctl) + ((unsigned long) dev_attrib));
  111. pvt = sz_private ?
  112. (((char *) dev_ctl) + ((unsigned long) pvt)) : NULL;
  113. memset(dev_ctl, 0, total_size); /* clear all fields */
  114. dev_ctl->nr_instances = nr_instances;
  115. dev_ctl->instances = dev_inst;
  116. dev_ctl->pvt_info = pvt;
  117. /* Name of this edac device, ensure null terminated */
  118. snprintf(dev_ctl->name,sizeof(dev_ctl->name),"%s", edac_device_name);
  119. dev_ctl->name[sizeof(dev_ctl->name)-1] = '\0';
  120. /* Initialize every Instance */
  121. for (instance = 0; instance < nr_instances; instance++) {
  122. inst = &dev_inst[instance];
  123. inst->ctl = dev_ctl;
  124. inst->nr_blocks = nr_blocks;
  125. blk_p = &dev_blk[instance * nr_blocks];
  126. inst->blocks = blk_p;
  127. /* name of this instance */
  128. snprintf(inst->name, sizeof(inst->name),
  129. "%s%u", edac_device_name, instance);
  130. inst->name[sizeof(inst->name)-1] = '\0';
  131. /* Initialize every block in each instance */
  132. for ( block = 0;
  133. block < nr_blocks;
  134. block++) {
  135. blk = &blk_p[block];
  136. blk->instance = inst;
  137. blk->nr_attribs = nr_attribs;
  138. attrib_p = &dev_attrib[block * nr_attribs];
  139. blk->attribs = attrib_p;
  140. snprintf(blk->name, sizeof(blk->name),
  141. "%s%d", edac_block_name,block+1);
  142. blk->name[sizeof(blk->name)-1] = '\0';
  143. debugf1("%s() instance=%d block=%d name=%s\n",
  144. __func__, instance,block,blk->name);
  145. if (attrib_spec != NULL) {
  146. /* when there is an attrib_spec passed int then
  147. * Initialize every attrib of each block
  148. */
  149. for (attr = 0; attr < nr_attribs; attr++) {
  150. attrib = &attrib_p[attr];
  151. attrib->block = blk;
  152. /* Link each attribute to the caller's
  153. * spec entry, for name and type
  154. */
  155. attrib->spec = &attrib_spec[attr];
  156. }
  157. }
  158. }
  159. }
  160. /* Mark this instance as merely ALLOCATED */
  161. dev_ctl->op_state = OP_ALLOC;
  162. return dev_ctl;
  163. }
  164. EXPORT_SYMBOL_GPL(edac_device_alloc_ctl_info);
  165. /*
  166. * edac_device_free_ctl_info()
  167. * frees the memory allocated by the edac_device_alloc_ctl_info()
  168. * function
  169. */
  170. void edac_device_free_ctl_info( struct edac_device_ctl_info *ctl_info) {
  171. kfree(ctl_info);
  172. }
  173. EXPORT_SYMBOL_GPL(edac_device_free_ctl_info);
  174. /*
  175. * find_edac_device_by_dev
  176. * scans the edac_device list for a specific 'struct device *'
  177. */
  178. static struct edac_device_ctl_info *
  179. find_edac_device_by_dev(struct device *dev)
  180. {
  181. struct edac_device_ctl_info *edac_dev;
  182. struct list_head *item;
  183. debugf3("%s()\n", __func__);
  184. list_for_each(item, &edac_device_list) {
  185. edac_dev = list_entry(item, struct edac_device_ctl_info, link);
  186. if (edac_dev->dev == dev)
  187. return edac_dev;
  188. }
  189. return NULL;
  190. }
  191. /*
  192. * add_edac_dev_to_global_list
  193. * Before calling this function, caller must
  194. * assign a unique value to edac_dev->dev_idx.
  195. * Return:
  196. * 0 on success
  197. * 1 on failure.
  198. */
  199. static int add_edac_dev_to_global_list (struct edac_device_ctl_info *edac_dev)
  200. {
  201. struct list_head *item, *insert_before;
  202. struct edac_device_ctl_info *rover;
  203. insert_before = &edac_device_list;
  204. /* Determine if already on the list */
  205. if (unlikely((rover = find_edac_device_by_dev(edac_dev->dev)) != NULL))
  206. goto fail0;
  207. /* Insert in ascending order by 'dev_idx', so find position */
  208. list_for_each(item, &edac_device_list) {
  209. rover = list_entry(item, struct edac_device_ctl_info, link);
  210. if (rover->dev_idx >= edac_dev->dev_idx) {
  211. if (unlikely(rover->dev_idx == edac_dev->dev_idx))
  212. goto fail1;
  213. insert_before = item;
  214. break;
  215. }
  216. }
  217. list_add_tail_rcu(&edac_dev->link, insert_before);
  218. return 0;
  219. fail0:
  220. edac_printk(KERN_WARNING, EDAC_MC,
  221. "%s (%s) %s %s already assigned %d\n",
  222. rover->dev->bus_id, dev_name(rover->dev),
  223. rover->mod_name, rover->ctl_name, rover->dev_idx);
  224. return 1;
  225. fail1:
  226. edac_printk(KERN_WARNING, EDAC_MC,
  227. "bug in low-level driver: attempt to assign\n"
  228. " duplicate dev_idx %d in %s()\n", rover->dev_idx, __func__);
  229. return 1;
  230. }
  231. /*
  232. * complete_edac_device_list_del
  233. */
  234. static void complete_edac_device_list_del(struct rcu_head *head)
  235. {
  236. struct edac_device_ctl_info *edac_dev;
  237. edac_dev = container_of(head, struct edac_device_ctl_info, rcu);
  238. INIT_LIST_HEAD(&edac_dev->link);
  239. complete(&edac_dev->complete);
  240. }
  241. /*
  242. * del_edac_device_from_global_list
  243. */
  244. static void del_edac_device_from_global_list(
  245. struct edac_device_ctl_info *edac_device)
  246. {
  247. list_del_rcu(&edac_device->link);
  248. init_completion(&edac_device->complete);
  249. call_rcu(&edac_device->rcu, complete_edac_device_list_del);
  250. wait_for_completion(&edac_device->complete);
  251. }
  252. /**
  253. * edac_device_find
  254. * Search for a edac_device_ctl_info structure whose index is 'idx'.
  255. *
  256. * If found, return a pointer to the structure.
  257. * Else return NULL.
  258. *
  259. * Caller must hold device_ctls_mutex.
  260. */
  261. struct edac_device_ctl_info * edac_device_find(int idx)
  262. {
  263. struct list_head *item;
  264. struct edac_device_ctl_info *edac_dev;
  265. /* Iterate over list, looking for exact match of ID */
  266. list_for_each(item, &edac_device_list) {
  267. edac_dev = list_entry(item, struct edac_device_ctl_info, link);
  268. if (edac_dev->dev_idx >= idx) {
  269. if (edac_dev->dev_idx == idx)
  270. return edac_dev;
  271. /* not on list, so terminate early */
  272. break;
  273. }
  274. }
  275. return NULL;
  276. }
  277. EXPORT_SYMBOL(edac_device_find);
  278. /*
  279. * edac_workq_function
  280. * performs the operation scheduled by a workq request
  281. */
  282. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
  283. static void edac_workq_function(struct work_struct *work_req)
  284. {
  285. struct delayed_work *d_work = (struct delayed_work*) work_req;
  286. struct edac_device_ctl_info *edac_dev =
  287. to_edac_device_ctl_work(d_work);
  288. #else
  289. static void edac_workq_function(void *ptr)
  290. {
  291. struct edac_device_ctl_info *edac_dev =
  292. (struct edac_device_ctl_info *) ptr;
  293. #endif
  294. //debugf0("%s() here and running\n", __func__);
  295. lock_device_list();
  296. /* Only poll controllers that are running polled and have a check */
  297. if ((edac_dev->op_state == OP_RUNNING_POLL) &&
  298. (edac_dev->edac_check != NULL)) {
  299. edac_dev->edac_check(edac_dev);
  300. }
  301. unlock_device_list();
  302. /* Reschedule */
  303. queue_delayed_work(edac_workqueue,&edac_dev->work, edac_dev->delay);
  304. }
  305. /*
  306. * edac_workq_setup
  307. * initialize a workq item for this edac_device instance
  308. * passing in the new delay period in msec
  309. */
  310. void edac_workq_setup(struct edac_device_ctl_info *edac_dev, unsigned msec)
  311. {
  312. debugf0("%s()\n", __func__);
  313. edac_dev->poll_msec = msec;
  314. edac_device_calc_delay(edac_dev); /* Calc delay jiffies */
  315. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
  316. INIT_DELAYED_WORK(&edac_dev->work,edac_workq_function);
  317. #else
  318. INIT_WORK(&edac_dev->work,edac_workq_function,edac_dev);
  319. #endif
  320. queue_delayed_work(edac_workqueue,&edac_dev->work, edac_dev->delay);
  321. }
  322. /*
  323. * edac_workq_teardown
  324. * stop the workq processing on this edac_dev
  325. */
  326. void edac_workq_teardown(struct edac_device_ctl_info *edac_dev)
  327. {
  328. int status;
  329. status = cancel_delayed_work(&edac_dev->work);
  330. if (status == 0) {
  331. /* workq instance might be running, wait for it */
  332. flush_workqueue(edac_workqueue);
  333. }
  334. }
  335. /*
  336. * edac_device_reset_delay_period
  337. */
  338. void edac_device_reset_delay_period(
  339. struct edac_device_ctl_info *edac_dev,
  340. unsigned long value)
  341. {
  342. lock_device_list();
  343. /* cancel the current workq request */
  344. edac_workq_teardown(edac_dev);
  345. /* restart the workq request, with new delay value */
  346. edac_workq_setup(edac_dev, value);
  347. unlock_device_list();
  348. }
  349. /*
  350. * edac_op_state_toString(edac_dev)
  351. */
  352. static char *edac_op_state_toString(struct edac_device_ctl_info *edac_dev)
  353. {
  354. int opstate = edac_dev->op_state;
  355. if (opstate == OP_RUNNING_POLL)
  356. return "POLLED";
  357. else if (opstate == OP_RUNNING_INTERRUPT)
  358. return "INTERRUPT";
  359. else if (opstate == OP_RUNNING_POLL_INTR)
  360. return "POLL-INTR";
  361. else if (opstate == OP_ALLOC)
  362. return "ALLOC";
  363. else if (opstate == OP_OFFLINE)
  364. return "OFFLINE";
  365. return "UNKNOWN";
  366. }
  367. /**
  368. * edac_device_add_device: Insert the 'edac_dev' structure into the
  369. * edac_device global list and create sysfs entries associated with
  370. * edac_device structure.
  371. * @edac_device: pointer to the edac_device structure to be added to the list
  372. * @edac_idx: A unique numeric identifier to be assigned to the
  373. * 'edac_device' structure.
  374. *
  375. * Return:
  376. * 0 Success
  377. * !0 Failure
  378. */
  379. int edac_device_add_device(struct edac_device_ctl_info *edac_dev, int edac_idx)
  380. {
  381. debugf0("%s()\n", __func__);
  382. edac_dev->dev_idx = edac_idx;
  383. #ifdef CONFIG_EDAC_DEBUG
  384. if (edac_debug_level >= 3)
  385. edac_device_dump_device(edac_dev);
  386. #endif
  387. lock_device_list();
  388. if (add_edac_dev_to_global_list(edac_dev))
  389. goto fail0;
  390. /* set load time so that error rate can be tracked */
  391. edac_dev->start_time = jiffies;
  392. /* create this instance's sysfs entries */
  393. if (edac_device_create_sysfs(edac_dev)) {
  394. edac_device_printk(edac_dev, KERN_WARNING,
  395. "failed to create sysfs device\n");
  396. goto fail1;
  397. }
  398. /* If there IS a check routine, then we are running POLLED */
  399. if (edac_dev->edac_check != NULL) {
  400. /* This instance is NOW RUNNING */
  401. edac_dev->op_state = OP_RUNNING_POLL;
  402. /* enable workq processing on this instance, default = 1000 msec */
  403. edac_workq_setup(edac_dev, 1000);
  404. } else {
  405. edac_dev->op_state = OP_RUNNING_INTERRUPT;
  406. }
  407. /* Report action taken */
  408. edac_device_printk(edac_dev, KERN_INFO,
  409. "Giving out device to module '%s' controller '%s': DEV '%s' (%s)\n",
  410. edac_dev->mod_name,
  411. edac_dev->ctl_name,
  412. dev_name(edac_dev->dev),
  413. edac_op_state_toString(edac_dev)
  414. );
  415. unlock_device_list();
  416. return 0;
  417. fail1:
  418. /* Some error, so remove the entry from the lsit */
  419. del_edac_device_from_global_list(edac_dev);
  420. fail0:
  421. unlock_device_list();
  422. return 1;
  423. }
  424. EXPORT_SYMBOL_GPL(edac_device_add_device);
  425. /**
  426. * edac_device_del_device:
  427. * Remove sysfs entries for specified edac_device structure and
  428. * then remove edac_device structure from global list
  429. *
  430. * @pdev:
  431. * Pointer to 'struct device' representing edac_device
  432. * structure to remove.
  433. *
  434. * Return:
  435. * Pointer to removed edac_device structure,
  436. * OR NULL if device not found.
  437. */
  438. struct edac_device_ctl_info * edac_device_del_device(struct device *dev)
  439. {
  440. struct edac_device_ctl_info *edac_dev;
  441. debugf0("MC: %s()\n", __func__);
  442. lock_device_list();
  443. if ((edac_dev = find_edac_device_by_dev(dev)) == NULL) {
  444. unlock_device_list();
  445. return NULL;
  446. }
  447. /* mark this instance as OFFLINE */
  448. edac_dev->op_state = OP_OFFLINE;
  449. /* clear workq processing on this instance */
  450. edac_workq_teardown(edac_dev);
  451. /* Tear down the sysfs entries for this instance */
  452. edac_device_remove_sysfs(edac_dev);
  453. /* deregister from global list */
  454. del_edac_device_from_global_list(edac_dev);
  455. unlock_device_list();
  456. edac_printk(KERN_INFO, EDAC_MC,
  457. "Removed device %d for %s %s: DEV %s\n",
  458. edac_dev->dev_idx,
  459. edac_dev->mod_name,
  460. edac_dev->ctl_name,
  461. dev_name(edac_dev->dev));
  462. return edac_dev;
  463. }
  464. EXPORT_SYMBOL_GPL(edac_device_del_device);
  465. static inline int edac_device_get_log_ce(struct edac_device_ctl_info *edac_dev)
  466. {
  467. return edac_dev->log_ce;
  468. }
  469. static inline int edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev)
  470. {
  471. return edac_dev->log_ue;
  472. }
  473. static inline int edac_device_get_panic_on_ue(
  474. struct edac_device_ctl_info *edac_dev)
  475. {
  476. return edac_dev->panic_on_ue;
  477. }
  478. /*
  479. * edac_device_handle_ce
  480. * perform a common output and handling of an 'edac_dev' CE event
  481. */
  482. void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
  483. int inst_nr, int block_nr, const char *msg)
  484. {
  485. struct edac_device_instance *instance;
  486. struct edac_device_block *block = NULL;
  487. if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
  488. edac_device_printk(edac_dev, KERN_ERR,
  489. "INTERNAL ERROR: 'instance' out of range "
  490. "(%d >= %d)\n", inst_nr, edac_dev->nr_instances);
  491. return;
  492. }
  493. instance = edac_dev->instances + inst_nr;
  494. if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) {
  495. edac_device_printk(edac_dev, KERN_ERR,
  496. "INTERNAL ERROR: instance %d 'block' out of range "
  497. "(%d >= %d)\n", inst_nr, block_nr, instance->nr_blocks);
  498. return;
  499. }
  500. if (instance->nr_blocks > 0) {
  501. block = instance->blocks + block_nr;
  502. block->counters.ce_count++;
  503. }
  504. /* Propogate the count up the 'totals' tree */
  505. instance->counters.ce_count++;
  506. edac_dev->counters.ce_count++;
  507. if (edac_device_get_log_ce(edac_dev))
  508. edac_device_printk(edac_dev, KERN_WARNING,
  509. "CE ctl: %s, instance: %s, block: %s: %s\n",
  510. edac_dev->ctl_name, instance->name,
  511. block ? block->name : "N/A", msg);
  512. }
  513. EXPORT_SYMBOL_GPL(edac_device_handle_ce);
  514. /*
  515. * edac_device_handle_ue
  516. * perform a common output and handling of an 'edac_dev' UE event
  517. */
  518. void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
  519. int inst_nr, int block_nr, const char *msg)
  520. {
  521. struct edac_device_instance *instance;
  522. struct edac_device_block *block = NULL;
  523. if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
  524. edac_device_printk(edac_dev, KERN_ERR,
  525. "INTERNAL ERROR: 'instance' out of range "
  526. "(%d >= %d)\n", inst_nr, edac_dev->nr_instances);
  527. return;
  528. }
  529. instance = edac_dev->instances + inst_nr;
  530. if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) {
  531. edac_device_printk(edac_dev, KERN_ERR,
  532. "INTERNAL ERROR: instance %d 'block' out of range "
  533. "(%d >= %d)\n", inst_nr, block_nr, instance->nr_blocks);
  534. return;
  535. }
  536. if (instance->nr_blocks > 0) {
  537. block = instance->blocks + block_nr;
  538. block->counters.ue_count++;
  539. }
  540. /* Propogate the count up the 'totals' tree */
  541. instance->counters.ue_count++;
  542. edac_dev->counters.ue_count++;
  543. if (edac_device_get_log_ue(edac_dev))
  544. edac_device_printk(edac_dev, KERN_EMERG,
  545. "UE ctl: %s, instance: %s, block: %s: %s\n",
  546. edac_dev->ctl_name, instance->name,
  547. block ? block->name : "N/A", msg);
  548. if (edac_device_get_panic_on_ue(edac_dev))
  549. panic("EDAC %s: UE instance: %s, block %s: %s\n",
  550. edac_dev->ctl_name, instance->name,
  551. block ? block->name : "N/A", msg);
  552. }
  553. EXPORT_SYMBOL_GPL(edac_device_handle_ue);