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
43 debugf3("\tedac_dev = %p dev_idx=%d \n", edac_dev, edac_dev->dev_idx); in edac_device_dump_device()
44 debugf4("\tedac_dev->edac_check = %p\n", edac_dev->edac_check); in edac_device_dump_device()
45 debugf3("\tdev = %p\n", edac_dev->dev); in edac_device_dump_device()
47 edac_dev->mod_name, edac_dev->ctl_name); in edac_device_dump_device()
48 debugf3("\tpvt_info = %p\n\n", edac_dev->pvt_info); in edac_device_dump_device()
278 struct edac_device_ctl_info *edac_dev; in find_edac_device_by_dev() local
284 edac_dev = list_entry(item, struct edac_device_ctl_info, link); in find_edac_device_by_dev()
286 if (edac_dev->dev == dev) in find_edac_device_by_dev()
287 return edac_dev; in find_edac_device_by_dev()
304 static int add_edac_dev_to_global_list(struct edac_device_ctl_info *edac_dev) in add_edac_dev_to_global_list() argument
312 rover = find_edac_device_by_dev(edac_dev->dev); in add_edac_dev_to_global_list()
320 if (rover->dev_idx >= edac_dev->dev_idx) { in add_edac_dev_to_global_list()
321 if (unlikely(rover->dev_idx == edac_dev->dev_idx)) in add_edac_dev_to_global_list()
329 list_add_tail_rcu(&edac_dev->link, insert_before); in add_edac_dev_to_global_list()
377 struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work); in edac_device_workq_function() local
382 if (edac_dev->op_state == OP_OFFLINE) { in edac_device_workq_function()
388 if ((edac_dev->op_state == OP_RUNNING_POLL) && in edac_device_workq_function()
389 (edac_dev->edac_check != NULL)) { in edac_device_workq_function()
390 edac_dev->edac_check(edac_dev); in edac_device_workq_function()
400 if (edac_dev->poll_msec == 1000) in edac_device_workq_function()
401 queue_delayed_work(edac_workqueue, &edac_dev->work, in edac_device_workq_function()
402 round_jiffies_relative(edac_dev->delay)); in edac_device_workq_function()
404 queue_delayed_work(edac_workqueue, &edac_dev->work, in edac_device_workq_function()
405 edac_dev->delay); in edac_device_workq_function()
413 void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev, in edac_device_workq_setup() argument
422 edac_dev->poll_msec = msec; in edac_device_workq_setup()
423 edac_dev->delay = msecs_to_jiffies(msec); in edac_device_workq_setup()
425 INIT_DELAYED_WORK(&edac_dev->work, edac_device_workq_function); in edac_device_workq_setup()
432 if (edac_dev->poll_msec == 1000) in edac_device_workq_setup()
433 queue_delayed_work(edac_workqueue, &edac_dev->work, in edac_device_workq_setup()
434 round_jiffies_relative(edac_dev->delay)); in edac_device_workq_setup()
436 queue_delayed_work(edac_workqueue, &edac_dev->work, in edac_device_workq_setup()
437 edac_dev->delay); in edac_device_workq_setup()
444 void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev) in edac_device_workq_teardown() argument
448 status = cancel_delayed_work(&edac_dev->work); in edac_device_workq_teardown()
462 void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev, in edac_device_reset_delay_period() argument
466 edac_device_workq_teardown(edac_dev); in edac_device_reset_delay_period()
472 edac_device_workq_setup(edac_dev, value); in edac_device_reset_delay_period()
502 int edac_device_add_device(struct edac_device_ctl_info *edac_dev) in edac_device_add_device() argument
508 edac_device_dump_device(edac_dev); in edac_device_add_device()
512 if (add_edac_dev_to_global_list(edac_dev)) in edac_device_add_device()
516 edac_dev->start_time = jiffies; in edac_device_add_device()
519 if (edac_device_create_sysfs(edac_dev)) { in edac_device_add_device()
520 edac_device_printk(edac_dev, KERN_WARNING, in edac_device_add_device()
526 if (edac_dev->edac_check != NULL) { in edac_device_add_device()
528 edac_dev->op_state = OP_RUNNING_POLL; in edac_device_add_device()
534 edac_device_workq_setup(edac_dev, 1000); in edac_device_add_device()
536 edac_dev->op_state = OP_RUNNING_INTERRUPT; in edac_device_add_device()
540 edac_device_printk(edac_dev, KERN_INFO, in edac_device_add_device()
543 edac_dev->mod_name, in edac_device_add_device()
544 edac_dev->ctl_name, in edac_device_add_device()
545 edac_dev_name(edac_dev), in edac_device_add_device()
546 edac_op_state_to_string(edac_dev->op_state)); in edac_device_add_device()
553 del_edac_device_from_global_list(edac_dev); in edac_device_add_device()
576 struct edac_device_ctl_info *edac_dev; in edac_device_del_device() local
583 edac_dev = find_edac_device_by_dev(dev); in edac_device_del_device()
584 if (edac_dev == NULL) { in edac_device_del_device()
590 edac_dev->op_state = OP_OFFLINE; in edac_device_del_device()
593 del_edac_device_from_global_list(edac_dev); in edac_device_del_device()
598 edac_device_workq_teardown(edac_dev); in edac_device_del_device()
601 edac_device_remove_sysfs(edac_dev); in edac_device_del_device()
605 edac_dev->dev_idx, in edac_device_del_device()
606 edac_dev->mod_name, edac_dev->ctl_name, edac_dev_name(edac_dev)); in edac_device_del_device()
608 return edac_dev; in edac_device_del_device()
612 static inline int edac_device_get_log_ce(struct edac_device_ctl_info *edac_dev) in edac_device_get_log_ce() argument
614 return edac_dev->log_ce; in edac_device_get_log_ce()
617 static inline int edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev) in edac_device_get_log_ue() argument
619 return edac_dev->log_ue; in edac_device_get_log_ue()
623 *edac_dev) in edac_device_get_panic_on_ue()
625 return edac_dev->panic_on_ue; in edac_device_get_panic_on_ue()
632 void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, in edac_device_handle_ce() argument
638 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { in edac_device_handle_ce()
639 edac_device_printk(edac_dev, KERN_ERR, in edac_device_handle_ce()
642 edac_dev->nr_instances); in edac_device_handle_ce()
646 instance = edac_dev->instances + inst_nr; in edac_device_handle_ce()
649 edac_device_printk(edac_dev, KERN_ERR, in edac_device_handle_ce()
664 edac_dev->counters.ce_count++; in edac_device_handle_ce()
666 if (edac_device_get_log_ce(edac_dev)) in edac_device_handle_ce()
667 edac_device_printk(edac_dev, KERN_WARNING, in edac_device_handle_ce()
669 edac_dev->ctl_name, instance->name, in edac_device_handle_ce()
678 void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev, in edac_device_handle_ue() argument
684 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { in edac_device_handle_ue()
685 edac_device_printk(edac_dev, KERN_ERR, in edac_device_handle_ue()
688 edac_dev->nr_instances); in edac_device_handle_ue()
692 instance = edac_dev->instances + inst_nr; in edac_device_handle_ue()
695 edac_device_printk(edac_dev, KERN_ERR, in edac_device_handle_ue()
710 edac_dev->counters.ue_count++; in edac_device_handle_ue()
712 if (edac_device_get_log_ue(edac_dev)) in edac_device_handle_ue()
713 edac_device_printk(edac_dev, KERN_EMERG, in edac_device_handle_ue()
715 edac_dev->ctl_name, instance->name, in edac_device_handle_ue()
718 if (edac_device_get_panic_on_ue(edac_dev)) in edac_device_handle_ue()
720 edac_dev->ctl_name, instance->name, in edac_device_handle_ue()