Lines Matching refs:edac_dev

41 static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)  in edac_device_dump_device()  argument
44 edac_dev, edac_dev->dev_idx); in edac_device_dump_device()
45 edac_dbg(4, "\tedac_dev->edac_check = %p\n", edac_dev->edac_check); in edac_device_dump_device()
46 edac_dbg(3, "\tdev = %p\n", edac_dev->dev); in edac_device_dump_device()
48 edac_dev->mod_name, edac_dev->ctl_name); in edac_device_dump_device()
49 edac_dbg(3, "\tpvt_info = %p\n\n", edac_dev->pvt_info); in edac_device_dump_device()
270 struct edac_device_ctl_info *edac_dev; in find_edac_device_by_dev() local
276 edac_dev = list_entry(item, struct edac_device_ctl_info, link); in find_edac_device_by_dev()
278 if (edac_dev->dev == dev) in find_edac_device_by_dev()
279 return edac_dev; in find_edac_device_by_dev()
296 static int add_edac_dev_to_global_list(struct edac_device_ctl_info *edac_dev) in add_edac_dev_to_global_list() argument
304 rover = find_edac_device_by_dev(edac_dev->dev); in add_edac_dev_to_global_list()
312 if (rover->dev_idx >= edac_dev->dev_idx) { in add_edac_dev_to_global_list()
313 if (unlikely(rover->dev_idx == edac_dev->dev_idx)) in add_edac_dev_to_global_list()
321 list_add_tail_rcu(&edac_dev->link, insert_before); in add_edac_dev_to_global_list()
369 struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work); in edac_device_workq_function() local
374 if (edac_dev->op_state == OP_OFFLINE) { in edac_device_workq_function()
380 if ((edac_dev->op_state == OP_RUNNING_POLL) && in edac_device_workq_function()
381 (edac_dev->edac_check != NULL)) { in edac_device_workq_function()
382 edac_dev->edac_check(edac_dev); in edac_device_workq_function()
392 if (edac_dev->poll_msec == 1000) in edac_device_workq_function()
393 queue_delayed_work(edac_workqueue, &edac_dev->work, in edac_device_workq_function()
394 round_jiffies_relative(edac_dev->delay)); in edac_device_workq_function()
396 queue_delayed_work(edac_workqueue, &edac_dev->work, in edac_device_workq_function()
397 edac_dev->delay); in edac_device_workq_function()
405 void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev, in edac_device_workq_setup() argument
414 edac_dev->poll_msec = msec; in edac_device_workq_setup()
415 edac_dev->delay = msecs_to_jiffies(msec); in edac_device_workq_setup()
417 INIT_DELAYED_WORK(&edac_dev->work, edac_device_workq_function); in edac_device_workq_setup()
424 if (edac_dev->poll_msec == 1000) in edac_device_workq_setup()
425 queue_delayed_work(edac_workqueue, &edac_dev->work, in edac_device_workq_setup()
426 round_jiffies_relative(edac_dev->delay)); in edac_device_workq_setup()
428 queue_delayed_work(edac_workqueue, &edac_dev->work, in edac_device_workq_setup()
429 edac_dev->delay); in edac_device_workq_setup()
436 void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev) in edac_device_workq_teardown() argument
438 if (!edac_dev->edac_check) in edac_device_workq_teardown()
441 edac_dev->op_state = OP_OFFLINE; in edac_device_workq_teardown()
443 cancel_delayed_work_sync(&edac_dev->work); in edac_device_workq_teardown()
454 void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev, in edac_device_reset_delay_period() argument
458 edac_device_workq_teardown(edac_dev); in edac_device_reset_delay_period()
464 edac_device_workq_setup(edac_dev, value); in edac_device_reset_delay_period()
494 int edac_device_add_device(struct edac_device_ctl_info *edac_dev) in edac_device_add_device() argument
500 edac_device_dump_device(edac_dev); in edac_device_add_device()
504 if (add_edac_dev_to_global_list(edac_dev)) in edac_device_add_device()
508 edac_dev->start_time = jiffies; in edac_device_add_device()
511 if (edac_device_create_sysfs(edac_dev)) { in edac_device_add_device()
512 edac_device_printk(edac_dev, KERN_WARNING, in edac_device_add_device()
518 if (edac_dev->edac_check != NULL) { in edac_device_add_device()
520 edac_dev->op_state = OP_RUNNING_POLL; in edac_device_add_device()
526 edac_device_workq_setup(edac_dev, 1000); in edac_device_add_device()
528 edac_dev->op_state = OP_RUNNING_INTERRUPT; in edac_device_add_device()
532 edac_device_printk(edac_dev, KERN_INFO, in edac_device_add_device()
534 edac_dev->mod_name, edac_dev->ctl_name, edac_dev->dev_name, in edac_device_add_device()
535 edac_op_state_to_string(edac_dev->op_state)); in edac_device_add_device()
542 del_edac_device_from_global_list(edac_dev); in edac_device_add_device()
565 struct edac_device_ctl_info *edac_dev; in edac_device_del_device() local
572 edac_dev = find_edac_device_by_dev(dev); in edac_device_del_device()
573 if (edac_dev == NULL) { in edac_device_del_device()
579 edac_dev->op_state = OP_OFFLINE; in edac_device_del_device()
582 del_edac_device_from_global_list(edac_dev); in edac_device_del_device()
587 edac_device_workq_teardown(edac_dev); in edac_device_del_device()
590 edac_device_remove_sysfs(edac_dev); in edac_device_del_device()
594 edac_dev->dev_idx, in edac_device_del_device()
595 edac_dev->mod_name, edac_dev->ctl_name, edac_dev_name(edac_dev)); in edac_device_del_device()
597 return edac_dev; in edac_device_del_device()
601 static inline int edac_device_get_log_ce(struct edac_device_ctl_info *edac_dev) in edac_device_get_log_ce() argument
603 return edac_dev->log_ce; in edac_device_get_log_ce()
606 static inline int edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev) in edac_device_get_log_ue() argument
608 return edac_dev->log_ue; in edac_device_get_log_ue()
612 *edac_dev) in edac_device_get_panic_on_ue()
614 return edac_dev->panic_on_ue; in edac_device_get_panic_on_ue()
621 void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, in edac_device_handle_ce() argument
627 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { in edac_device_handle_ce()
628 edac_device_printk(edac_dev, KERN_ERR, in edac_device_handle_ce()
631 edac_dev->nr_instances); in edac_device_handle_ce()
635 instance = edac_dev->instances + inst_nr; in edac_device_handle_ce()
638 edac_device_printk(edac_dev, KERN_ERR, in edac_device_handle_ce()
653 edac_dev->counters.ce_count++; in edac_device_handle_ce()
655 if (edac_device_get_log_ce(edac_dev)) in edac_device_handle_ce()
656 edac_device_printk(edac_dev, KERN_WARNING, in edac_device_handle_ce()
658 edac_dev->ctl_name, instance->name, in edac_device_handle_ce()
667 void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev, in edac_device_handle_ue() argument
673 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { in edac_device_handle_ue()
674 edac_device_printk(edac_dev, KERN_ERR, in edac_device_handle_ue()
677 edac_dev->nr_instances); in edac_device_handle_ue()
681 instance = edac_dev->instances + inst_nr; in edac_device_handle_ue()
684 edac_device_printk(edac_dev, KERN_ERR, in edac_device_handle_ue()
699 edac_dev->counters.ue_count++; in edac_device_handle_ue()
701 if (edac_device_get_log_ue(edac_dev)) in edac_device_handle_ue()
702 edac_device_printk(edac_dev, KERN_EMERG, in edac_device_handle_ue()
704 edac_dev->ctl_name, instance->name, in edac_device_handle_ue()
707 if (edac_device_get_panic_on_ue(edac_dev)) in edac_device_handle_ue()
709 edac_dev->ctl_name, instance->name, in edac_device_handle_ue()