Lines Matching refs:cmb_area
451 struct cmb_area { struct
458 static struct cmb_area cmb_area = { argument
459 .lock = __SPIN_LOCK_UNLOCKED(cmb_area.lock),
460 .list = LIST_HEAD_INIT(cmb_area.list),
476 module_param_named(maxchannels, cmb_area.num_channels, uint, 0444);
529 cmb = cmb_area.mem; in alloc_cmb_single()
530 list_for_each_entry(node, &cmb_area.list, cmb_list) { in alloc_cmb_single()
537 if (cmb - cmb_area.mem >= cmb_area.num_channels) { in alloc_cmb_single()
570 spin_lock(&cmb_area.lock); in alloc_cmb()
572 if (!cmb_area.mem) { in alloc_cmb()
574 size = sizeof(struct cmb) * cmb_area.num_channels; in alloc_cmb()
575 WARN_ON(!list_empty(&cmb_area.list)); in alloc_cmb()
577 spin_unlock(&cmb_area.lock); in alloc_cmb()
580 spin_lock(&cmb_area.lock); in alloc_cmb()
582 if (cmb_area.mem) { in alloc_cmb()
592 cmb_area.mem = mem; in alloc_cmb()
593 cmf_activate(cmb_area.mem, CMF_ON); in alloc_cmb()
600 spin_unlock(&cmb_area.lock); in alloc_cmb()
613 spin_lock(&cmb_area.lock); in free_cmb()
624 if (list_empty(&cmb_area.list)) { in free_cmb()
626 size = sizeof(struct cmb) * cmb_area.num_channels; in free_cmb()
628 free_pages((unsigned long)cmb_area.mem, get_order(size)); in free_cmb()
629 cmb_area.mem = NULL; in free_cmb()
632 spin_unlock(&cmb_area.lock); in free_cmb()
647 offset = mme ? (struct cmb *)cmb_data->hw_block - cmb_area.mem : 0; in set_cmb()
838 spin_lock(&cmb_area.lock); in alloc_cmbe()
846 if (list_empty(&cmb_area.list)) in alloc_cmbe()
848 list_add_tail(&cdev->private->cmb_list, &cmb_area.list); in alloc_cmbe()
851 spin_unlock(&cmb_area.lock); in alloc_cmbe()
856 spin_unlock(&cmb_area.lock); in alloc_cmbe()
871 spin_lock(&cmb_area.lock); in free_cmbe()
883 if (list_empty(&cmb_area.list)) in free_cmbe()
886 spin_unlock(&cmb_area.lock); in free_cmbe()
1336 spin_lock(&cmb_area.lock); in cmf_reactivate()
1337 if (!list_empty(&cmb_area.list)) in cmf_reactivate()
1338 cmf_activate(cmb_area.mem, CMF_ON); in cmf_reactivate()
1339 spin_unlock(&cmb_area.lock); in cmf_reactivate()