Lines Matching defs:dm_device
568 static struct hv_dynmem_device dm_device;
604 list_for_each_entry(has, &dm_device.ha_region_list, list) {
636 complete(&dm_device.ol_waitevent);
640 spin_lock_irqsave(&dm_device.ha_lock, flags);
643 if (pfn_count <= dm_device.num_pages_onlined) {
644 dm_device.num_pages_onlined -= pfn_count;
652 dm_device.num_pages_onlined = 0;
654 spin_unlock_irqrestore(&dm_device.ha_lock, flags);
683 lockdep_assert_held(&dm_device.ha_lock);
684 dm_device.num_pages_onlined++;
711 spin_lock_irqsave(&dm_device.ha_lock, flags);
723 spin_unlock_irqrestore(&dm_device.ha_lock, flags);
725 reinit_completion(&dm_device.ol_waitevent);
743 spin_lock_irqsave(&dm_device.ha_lock, flags);
746 spin_unlock_irqrestore(&dm_device.ha_lock, flags);
758 wait_for_completion_timeout(&dm_device.ol_waitevent, 5 * HZ);
759 post_status(&dm_device);
769 spin_lock_irqsave(&dm_device.ha_lock, flags);
770 list_for_each_entry(has, &dm_device.ha_region_list, list) {
779 spin_unlock_irqrestore(&dm_device.ha_lock, flags);
790 spin_lock_irqsave(&dm_device.ha_lock, flags);
791 list_for_each_entry(has, &dm_device.ha_region_list, list) {
837 spin_unlock_irqrestore(&dm_device.ha_lock, flags);
856 spin_lock_irqsave(&dm_device.ha_lock, flags);
857 list_for_each_entry(has, &dm_device.ha_region_list, list) {
909 spin_unlock_irqrestore(&dm_device.ha_lock, flags);
911 spin_lock_irqsave(&dm_device.ha_lock, flags);
920 spin_unlock_irqrestore(&dm_device.ha_lock, flags);
937 if (!dm_device.host_specified_ha_region) {
964 spin_lock_irqsave(&dm_device.ha_lock, flags);
965 list_add_tail(&ha_region->list, &dm_device.ha_region_list);
966 spin_unlock_irqrestore(&dm_device.ha_lock, flags);
986 struct hv_dynmem_device *dm = &dm_device;
1257 unsigned int num_pages = dm_device.balloon_wrk.num_pages;
1293 num_ballooned = alloc_balloon_pages(&dm_device, num_pages,
1303 num_pages, dm_device.balloon_wrk.num_pages);
1307 dm_device.state = DM_INITIALIZED;
1318 ret = vmbus_sendpacket(dm_device.dev->channel,
1326 post_status(&dm_device);
1336 free_balloon_pages(&dm_device,
1356 complete(&dm_device.config_event);
1370 vmbus_sendpacket(dm_device.dev->channel, &resp,
1386 &dm_device.config_event, 1*HZ);
1391 reinit_completion(&dm_device.config_event);
1512 dm_device.balloon_wrk.num_pages = bal_msg->num_pages;
1513 schedule_work(&dm_device.balloon_wrk.wrk);
1553 schedule_work(&dm_device.ha_wrk.wrk);
1592 dm_device.version = version_req.version.version;
1600 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ);
1610 if (dm_device.state == DM_INIT_ERROR) {
1616 DYNMEM_MAJOR_VERSION(dm_device.version),
1617 DYNMEM_MINOR_VERSION(dm_device.version));
1655 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ);
1665 if (dm_device.state == DM_INIT_ERROR) {
1690 dm_device.dev = dev;
1691 dm_device.state = DM_INITIALIZING;
1692 dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN8;
1693 init_completion(&dm_device.host_event);
1694 init_completion(&dm_device.config_event);
1695 INIT_LIST_HEAD(&dm_device.ha_region_list);
1696 spin_lock_init(&dm_device.ha_lock);
1697 INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up);
1698 INIT_WORK(&dm_device.ha_wrk.wrk, hot_add_req);
1699 dm_device.host_specified_ha_region = false;
1703 init_completion(&dm_device.ol_waitevent);
1707 hv_set_drvdata(dev, &dm_device);
1713 dm_device.state = DM_INITIALIZED;
1715 dm_device.thread =
1716 kthread_run(dm_thread_func, &dm_device, "hv_balloon");
1717 if (IS_ERR(dm_device.thread)) {
1718 ret = PTR_ERR(dm_device.thread);
1725 dm_device.state = DM_INIT_ERROR;
1726 dm_device.thread = NULL;
1754 spin_lock_irqsave(&dm_device.ha_lock, flags);
1763 spin_unlock_irqrestore(&dm_device.ha_lock, flags);
1793 dm_device.state = DM_INITIALIZING;
1800 dm_device.thread =
1801 kthread_run(dm_thread_func, &dm_device, "hv_balloon");
1802 if (IS_ERR(dm_device.thread)) {
1803 ret = PTR_ERR(dm_device.thread);
1804 dm_device.thread = NULL;
1808 dm_device.state = DM_INITIALIZED;
1813 dm_device.state = DM_INIT_ERROR;