Lines Matching refs:edac_dev

41 static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
44 edac_dev, edac_dev->dev_idx);
45 edac_dbg(4, "\tedac_dev->edac_check = %p\n", edac_dev->edac_check);
46 edac_dbg(3, "\tdev = %p\n", edac_dev->dev);
48 edac_dev->mod_name, edac_dev->ctl_name);
49 edac_dbg(3, "\tpvt_info = %p\n\n", edac_dev->pvt_info);
144 edac_dbg(4, "edac_dev=%p next after end=%p\n",
250 struct edac_device_ctl_info *edac_dev;
256 edac_dev = list_entry(item, struct edac_device_ctl_info, link);
258 if (edac_dev->dev == dev)
259 return edac_dev;
268 * assign a unique value to edac_dev->dev_idx.
276 static int add_edac_dev_to_global_list(struct edac_device_ctl_info *edac_dev)
284 rover = find_edac_device_by_dev(edac_dev->dev);
292 if (rover->dev_idx >= edac_dev->dev_idx) {
293 if (unlikely(rover->dev_idx == edac_dev->dev_idx))
301 list_add_tail_rcu(&edac_dev->link, insert_before);
349 struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work);
354 if (edac_dev->op_state == OP_OFFLINE) {
360 if ((edac_dev->op_state == OP_RUNNING_POLL) &&
361 (edac_dev->edac_check != NULL)) {
362 edac_dev->edac_check(edac_dev);
372 if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL)
373 edac_queue_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay));
375 edac_queue_work(&edac_dev->work, edac_dev->delay);
383 static void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
392 edac_dev->poll_msec = msec;
393 edac_dev->delay = msecs_to_jiffies(msec);
395 INIT_DELAYED_WORK(&edac_dev->work, edac_device_workq_function);
402 if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL)
403 edac_queue_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay));
405 edac_queue_work(&edac_dev->work, edac_dev->delay);
410 * stop the workq processing on this edac_dev
412 static void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev)
414 if (!edac_dev->edac_check)
417 edac_dev->op_state = OP_OFFLINE;
419 edac_stop_work(&edac_dev->work);
429 void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
432 edac_dev->poll_msec = msec;
433 edac_dev->delay = msecs_to_jiffies(msec);
436 if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL)
437 edac_mod_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay));
439 edac_mod_work(&edac_dev->work, edac_dev->delay);
450 int edac_device_add_device(struct edac_device_ctl_info *edac_dev)
456 edac_device_dump_device(edac_dev);
460 if (add_edac_dev_to_global_list(edac_dev))
464 edac_dev->start_time = jiffies;
467 if (edac_device_create_sysfs(edac_dev)) {
468 edac_device_printk(edac_dev, KERN_WARNING,
474 if (edac_dev->edac_check != NULL) {
476 edac_dev->op_state = OP_RUNNING_POLL;
478 edac_device_workq_setup(edac_dev, edac_dev->poll_msec ?: DEFAULT_POLL_INTERVAL);
480 edac_dev->op_state = OP_RUNNING_INTERRUPT;
484 edac_device_printk(edac_dev, KERN_INFO,
486 edac_dev->mod_name, edac_dev->ctl_name, edac_dev->dev_name,
487 edac_op_state_to_string(edac_dev->op_state));
494 del_edac_device_from_global_list(edac_dev);
504 struct edac_device_ctl_info *edac_dev;
511 edac_dev = find_edac_device_by_dev(dev);
512 if (edac_dev == NULL) {
518 edac_dev->op_state = OP_OFFLINE;
521 del_edac_device_from_global_list(edac_dev);
526 edac_device_workq_teardown(edac_dev);
529 edac_device_remove_sysfs(edac_dev);
533 edac_dev->dev_idx,
534 edac_dev->mod_name, edac_dev->ctl_name, edac_dev_name(edac_dev));
536 return edac_dev;
540 static inline int edac_device_get_log_ce(struct edac_device_ctl_info *edac_dev)
542 return edac_dev->log_ce;
545 static inline int edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev)
547 return edac_dev->log_ue;
551 *edac_dev)
553 return edac_dev->panic_on_ue;
556 void edac_device_handle_ce_count(struct edac_device_ctl_info *edac_dev,
566 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
567 edac_device_printk(edac_dev, KERN_ERR,
570 edac_dev->nr_instances);
574 instance = edac_dev->instances + inst_nr;
577 edac_device_printk(edac_dev, KERN_ERR,
592 edac_dev->counters.ce_count += count;
594 if (edac_device_get_log_ce(edac_dev))
595 edac_device_printk(edac_dev, KERN_WARNING,
597 edac_dev->ctl_name, instance->name,
602 void edac_device_handle_ue_count(struct edac_device_ctl_info *edac_dev,
612 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
613 edac_device_printk(edac_dev, KERN_ERR,
616 edac_dev->nr_instances);
620 instance = edac_dev->instances + inst_nr;
623 edac_device_printk(edac_dev, KERN_ERR,
638 edac_dev->counters.ue_count += count;
640 if (edac_device_get_log_ue(edac_dev))
641 edac_device_printk(edac_dev, KERN_EMERG,
643 edac_dev->ctl_name, instance->name,
646 if (edac_device_get_panic_on_ue(edac_dev))
648 edac_dev->ctl_name, instance->name,