Lines Matching +full:free +full:- +full:running

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()
76 goto free; in edac_device_alloc_ctl_info()
78 dev_ctl->instances = dev_inst; in edac_device_alloc_ctl_info()
82 goto free; in edac_device_alloc_ctl_info()
84 dev_ctl->blocks = dev_blk; in edac_device_alloc_ctl_info()
89 goto free; in edac_device_alloc_ctl_info()
91 dev_ctl->pvt_info = pvt; in edac_device_alloc_ctl_info()
94 dev_ctl->dev_idx = device_index; in edac_device_alloc_ctl_info()
95 dev_ctl->nr_instances = nr_instances; in edac_device_alloc_ctl_info()
98 dev_ctl->log_ce = 1; in edac_device_alloc_ctl_info()
99 dev_ctl->log_ue = 1; in edac_device_alloc_ctl_info()
102 snprintf(dev_ctl->name, sizeof(dev_ctl->name),"%s", dev_name); in edac_device_alloc_ctl_info()
107 inst->ctl = dev_ctl; in edac_device_alloc_ctl_info()
108 inst->nr_blocks = nr_blocks; in edac_device_alloc_ctl_info()
110 inst->blocks = blk_p; in edac_device_alloc_ctl_info()
113 snprintf(inst->name, sizeof(inst->name), "%s%u", dev_name, instance); in edac_device_alloc_ctl_info()
118 blk->instance = inst; in edac_device_alloc_ctl_info()
119 snprintf(blk->name, sizeof(blk->name), in edac_device_alloc_ctl_info()
123 instance, inst, block, blk, blk->name); in edac_device_alloc_ctl_info()
128 dev_ctl->op_state = OP_ALLOC; in edac_device_alloc_ctl_info()
135 goto free; in edac_device_alloc_ctl_info()
138 * 'free' the object, then the function: in edac_device_alloc_ctl_info()
140 * which will perform kobj unregistration and the actual free in edac_device_alloc_ctl_info()
146 free: in edac_device_alloc_ctl_info()
179 if (edac_dev->dev == dev) in find_edac_device_by_dev()
189 * assign a unique value to edac_dev->dev_idx.
205 rover = find_edac_device_by_dev(edac_dev->dev); in add_edac_dev_to_global_list()
213 if (rover->dev_idx >= edac_dev->dev_idx) { in add_edac_dev_to_global_list()
214 if (unlikely(rover->dev_idx == edac_dev->dev_idx)) in add_edac_dev_to_global_list()
222 list_add_tail_rcu(&edac_dev->link, insert_before); in add_edac_dev_to_global_list()
228 dev_name(rover->dev), edac_dev_name(rover), in add_edac_dev_to_global_list()
229 rover->mod_name, rover->ctl_name, rover->dev_idx); in add_edac_dev_to_global_list()
234 "bug in low-level driver: attempt to assign\n" in add_edac_dev_to_global_list()
235 " duplicate dev_idx %d in %s()\n", rover->dev_idx, in add_edac_dev_to_global_list()
246 list_del_rcu(&edac_device->link); in del_edac_device_from_global_list()
252 INIT_LIST_HEAD(&edac_device->link); in del_edac_device_from_global_list()
265 * running polled and there is a poll function defined.
275 if (edac_dev->op_state == OP_OFFLINE) { in edac_device_workq_function()
280 /* Only poll controllers that are running polled and have a check */ in edac_device_workq_function()
281 if ((edac_dev->op_state == OP_RUNNING_POLL) && in edac_device_workq_function()
282 (edac_dev->edac_check != NULL)) { in edac_device_workq_function()
283 edac_dev->edac_check(edac_dev); in edac_device_workq_function()
293 if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) in edac_device_workq_function()
294 edac_queue_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay)); in edac_device_workq_function()
296 edac_queue_work(&edac_dev->work, edac_dev->delay); in edac_device_workq_function()
313 edac_dev->poll_msec = msec; in edac_device_workq_setup()
314 edac_dev->delay = msecs_to_jiffies(msec); in edac_device_workq_setup()
316 INIT_DELAYED_WORK(&edac_dev->work, edac_device_workq_function); in edac_device_workq_setup()
320 * timers firing on sub-second basis, while they are happy in edac_device_workq_setup()
323 if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) in edac_device_workq_setup()
324 edac_queue_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay)); in edac_device_workq_setup()
326 edac_queue_work(&edac_dev->work, edac_dev->delay); in edac_device_workq_setup()
335 if (!edac_dev->edac_check) in edac_device_workq_teardown()
338 edac_dev->op_state = OP_OFFLINE; in edac_device_workq_teardown()
340 edac_stop_work(&edac_dev->work); in edac_device_workq_teardown()
353 edac_dev->poll_msec = msec; in edac_device_reset_delay_period()
354 edac_dev->delay = msecs_to_jiffies(msec); in edac_device_reset_delay_period()
357 if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) in edac_device_reset_delay_period()
358 edac_mod_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay)); in edac_device_reset_delay_period()
360 edac_mod_work(&edac_dev->work, edac_dev->delay); in edac_device_reset_delay_period()
367 return atomic_inc_return(&device_indexes) - 1; in edac_device_alloc_index()
385 edac_dev->start_time = jiffies; in edac_device_add_device()
394 /* If there IS a check routine, then we are running POLLED */ in edac_device_add_device()
395 if (edac_dev->edac_check != NULL) { in edac_device_add_device()
396 /* This instance is NOW RUNNING */ in edac_device_add_device()
397 edac_dev->op_state = OP_RUNNING_POLL; in edac_device_add_device()
399 edac_device_workq_setup(edac_dev, edac_dev->poll_msec ?: DEFAULT_POLL_INTERVAL); in edac_device_add_device()
401 edac_dev->op_state = OP_RUNNING_INTERRUPT; in edac_device_add_device()
407 edac_dev->mod_name, edac_dev->ctl_name, edac_dev->dev_name, in edac_device_add_device()
408 edac_op_state_to_string(edac_dev->op_state)); in edac_device_add_device()
439 edac_dev->op_state = OP_OFFLINE; in edac_device_del_device()
454 edac_dev->dev_idx, in edac_device_del_device()
455 edac_dev->mod_name, edac_dev->ctl_name, edac_dev_name(edac_dev)); in edac_device_del_device()
463 return edac_dev->log_ce; in edac_device_get_log_ce()
468 return edac_dev->log_ue; in edac_device_get_log_ue()
474 return edac_dev->panic_on_ue; in edac_device_get_panic_on_ue()
487 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { in edac_device_handle_ce_count()
491 edac_dev->nr_instances); in edac_device_handle_ce_count()
495 instance = edac_dev->instances + inst_nr; in edac_device_handle_ce_count()
497 if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) { in edac_device_handle_ce_count()
502 instance->nr_blocks); in edac_device_handle_ce_count()
506 if (instance->nr_blocks > 0) { in edac_device_handle_ce_count()
507 block = instance->blocks + block_nr; in edac_device_handle_ce_count()
508 block->counters.ce_count += count; in edac_device_handle_ce_count()
512 instance->counters.ce_count += count; in edac_device_handle_ce_count()
513 edac_dev->counters.ce_count += count; in edac_device_handle_ce_count()
518 edac_dev->ctl_name, instance->name, in edac_device_handle_ce_count()
519 block ? block->name : "N/A", count, msg); in edac_device_handle_ce_count()
533 if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { in edac_device_handle_ue_count()
537 edac_dev->nr_instances); in edac_device_handle_ue_count()
541 instance = edac_dev->instances + inst_nr; in edac_device_handle_ue_count()
543 if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) { in edac_device_handle_ue_count()
548 instance->nr_blocks); in edac_device_handle_ue_count()
552 if (instance->nr_blocks > 0) { in edac_device_handle_ue_count()
553 block = instance->blocks + block_nr; in edac_device_handle_ue_count()
554 block->counters.ue_count += count; in edac_device_handle_ue_count()
558 instance->counters.ue_count += count; in edac_device_handle_ue_count()
559 edac_dev->counters.ue_count += count; in edac_device_handle_ue_count()
564 edac_dev->ctl_name, instance->name, in edac_device_handle_ue_count()
565 block ? block->name : "N/A", count, msg); in edac_device_handle_ue_count()
569 edac_dev->ctl_name, instance->name, in edac_device_handle_ue_count()
570 block ? block->name : "N/A", count, msg); in edac_device_handle_ue_count()