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);
220 struct edac_device_ctl_info *edac_dev;
226 edac_dev = list_entry(item, struct edac_device_ctl_info, link);
228 if (edac_dev->dev == dev)
229 return edac_dev;
238 * assign a unique value to edac_dev->dev_idx.
246 static int add_edac_dev_to_global_list(struct edac_device_ctl_info *edac_dev)
254 rover = find_edac_device_by_dev(edac_dev->dev);
262 if (rover->dev_idx >= edac_dev->dev_idx) {
263 if (unlikely(rover->dev_idx == edac_dev->dev_idx))
271 list_add_tail_rcu(&edac_dev->link, insert_before);
319 struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work);
324 if (edac_dev->op_state == OP_OFFLINE) {
330 if ((edac_dev->op_state == OP_RUNNING_POLL) &&
331 (edac_dev->edac_check != NULL)) {
332 edac_dev->edac_check(edac_dev);
342 if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL)
343 edac_queue_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay));
345 edac_queue_work(&edac_dev->work, edac_dev->delay);
353 static void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
362 edac_dev->poll_msec = msec;
363 edac_dev->delay = msecs_to_jiffies(msec);
365 INIT_DELAYED_WORK(&edac_dev->work, edac_device_workq_function);
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);
380 * stop the workq processing on this edac_dev
382 static void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev)
384 if (!edac_dev->edac_check)
387 edac_dev->op_state = OP_OFFLINE;
389 edac_stop_work(&edac_dev->work);
399 void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
402 edac_dev->poll_msec = msec;
403 edac_dev->delay = msecs_to_jiffies(msec);
406 if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL)
407 edac_mod_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay));
409 edac_mod_work(&edac_dev->work, edac_dev->delay);
420 int edac_device_add_device(struct edac_device_ctl_info *edac_dev)
426 edac_device_dump_device(edac_dev);
430 if (add_edac_dev_to_global_list(edac_dev))
434 edac_dev->start_time = jiffies;
437 if (edac_device_create_sysfs(edac_dev)) {
438 edac_device_printk(edac_dev, KERN_WARNING,
444 if (edac_dev->edac_check != NULL) {
446 edac_dev->op_state = OP_RUNNING_POLL;
448 edac_device_workq_setup(edac_dev, edac_dev->poll_msec ?: DEFAULT_POLL_INTERVAL);
450 edac_dev->op_state = OP_RUNNING_INTERRUPT;
454 edac_device_printk(edac_dev, KERN_INFO,
456 edac_dev->mod_name, edac_dev->ctl_name, edac_dev->dev_name,
457 edac_op_state_to_string(edac_dev->op_state));
464 del_edac_device_from_global_list(edac_dev);
474 struct edac_device_ctl_info *edac_dev;
481 edac_dev = find_edac_device_by_dev(dev);
482 if (edac_dev == NULL) {
488 edac_dev->op_state = OP_OFFLINE;
491 del_edac_device_from_global_list(edac_dev);
496 edac_device_workq_teardown(edac_dev);
499 edac_device_remove_sysfs(edac_dev);
503 edac_dev->dev_idx,
504 edac_dev->mod_name, edac_dev->ctl_name, edac_dev_name(edac_dev));
506 return edac_dev;
510 static inline int edac_device_get_log_ce(struct edac_device_ctl_info *edac_dev)
512 return edac_dev->log_ce;
515 static inline int edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev)
517 return edac_dev->log_ue;
521 *edac_dev)
523 return edac_dev->panic_on_ue;
526 void edac_device_handle_ce_count(struct edac_device_ctl_info *edac_dev,
536 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
537 edac_device_printk(edac_dev, KERN_ERR,
540 edac_dev->nr_instances);
544 instance = edac_dev->instances + inst_nr;
547 edac_device_printk(edac_dev, KERN_ERR,
562 edac_dev->counters.ce_count += count;
564 if (edac_device_get_log_ce(edac_dev))
565 edac_device_printk(edac_dev, KERN_WARNING,
567 edac_dev->ctl_name, instance->name,
572 void edac_device_handle_ue_count(struct edac_device_ctl_info *edac_dev,
582 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) {
583 edac_device_printk(edac_dev, KERN_ERR,
586 edac_dev->nr_instances);
590 instance = edac_dev->instances + inst_nr;
593 edac_device_printk(edac_dev, KERN_ERR,
608 edac_dev->counters.ue_count += count;
610 if (edac_device_get_log_ue(edac_dev))
611 edac_device_printk(edac_dev, KERN_EMERG,
613 edac_dev->ctl_name, instance->name,
616 if (edac_device_get_panic_on_ue(edac_dev))
618 edac_dev->ctl_name, instance->name,