Lines Matching defs:dm_device

583 static struct hv_dynmem_device dm_device;
623 list_for_each_entry(has, &dm_device.ha_region_list, list) {
655 complete(&dm_device.ol_waitevent);
659 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) {
662 if (pfn_count <= dm_device.num_pages_onlined) {
663 dm_device.num_pages_onlined -= pfn_count;
672 dm_device.num_pages_onlined = 0;
703 lockdep_assert_held(&dm_device.ha_lock);
704 dm_device.num_pages_onlined++;
730 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) {
744 reinit_completion(&dm_device.ol_waitevent);
762 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) {
777 wait_for_completion_timeout(&dm_device.ol_waitevent, 5 * HZ);
778 post_status(&dm_device);
787 guard(spinlock_irqsave)(&dm_device.ha_lock);
788 list_for_each_entry(has, &dm_device.ha_region_list, list) {
806 guard(spinlock_irqsave)(&dm_device.ha_lock);
807 list_for_each_entry(has, &dm_device.ha_region_list, list) {
871 spin_lock_irqsave(&dm_device.ha_lock, flags);
872 list_for_each_entry(has, &dm_device.ha_region_list, list) {
924 spin_unlock_irqrestore(&dm_device.ha_lock, flags);
926 spin_lock_irqsave(&dm_device.ha_lock, flags);
935 spin_unlock_irqrestore(&dm_device.ha_lock, flags);
951 if (!dm_device.host_specified_ha_region) {
978 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) {
979 list_add_tail(&ha_region->list, &dm_device.ha_region_list);
1000 struct hv_dynmem_device *dm = &dm_device;
1289 unsigned int num_pages = dm_device.balloon_wrk.num_pages;
1325 num_ballooned = alloc_balloon_pages(&dm_device, num_pages,
1335 num_pages, dm_device.balloon_wrk.num_pages);
1339 dm_device.state = DM_INITIALIZED;
1350 ret = vmbus_sendpacket(dm_device.dev->channel,
1358 post_status(&dm_device);
1368 free_balloon_pages(&dm_device,
1388 complete(&dm_device.config_event);
1402 vmbus_sendpacket(dm_device.dev->channel, &resp,
1418 &dm_device.config_event, 1*HZ);
1423 reinit_completion(&dm_device.config_event);
1556 dm_device.balloon_wrk.num_pages = bal_msg->num_pages;
1557 schedule_work(&dm_device.balloon_wrk.wrk);
1597 schedule_work(&dm_device.ha_wrk.wrk);
1703 dm_device.pr_dev_info.report = hv_free_page_report;
1708 dm_device.pr_dev_info.order = 0;
1709 ret = page_reporting_register(&dm_device.pr_dev_info);
1711 dm_device.pr_dev_info.report = NULL;
1721 if (dm_device.pr_dev_info.report) {
1722 page_reporting_unregister(&dm_device.pr_dev_info);
1723 dm_device.pr_dev_info.report = NULL;
1790 dm_device.version = version_req.version.version;
1798 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ);
1808 if (dm_device.state == DM_INIT_ERROR) {
1814 DYNMEM_MAJOR_VERSION(dm_device.version),
1815 DYNMEM_MINOR_VERSION(dm_device.version));
1853 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ);
1863 if (dm_device.state == DM_INIT_ERROR) {
1991 dm_device.dev = dev;
1992 dm_device.state = DM_INITIALIZING;
1993 dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN8;
1994 init_completion(&dm_device.host_event);
1995 init_completion(&dm_device.config_event);
1996 INIT_LIST_HEAD(&dm_device.ha_region_list);
1997 spin_lock_init(&dm_device.ha_lock);
1998 INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up);
1999 INIT_WORK(&dm_device.ha_wrk.wrk, hot_add_req);
2000 dm_device.host_specified_ha_region = false;
2004 init_completion(&dm_device.ol_waitevent);
2008 hv_set_drvdata(dev, &dm_device);
2015 dm_device.state = DM_INITIALIZED;
2017 dm_device.thread =
2018 kthread_run(dm_thread_func, &dm_device, "hv_balloon");
2019 if (IS_ERR(dm_device.thread)) {
2020 ret = PTR_ERR(dm_device.thread);
2024 hv_balloon_debugfs_init(&dm_device);
2029 dm_device.state = DM_INIT_ERROR;
2030 dm_device.thread = NULL;
2062 if (dm_device.state != DM_INIT_ERROR) {
2071 guard(spinlock_irqsave)(&dm_device.ha_lock);
2107 dm_device.state = DM_INITIALIZING;
2114 dm_device.thread =
2115 kthread_run(dm_thread_func, &dm_device, "hv_balloon");
2116 if (IS_ERR(dm_device.thread)) {
2117 ret = PTR_ERR(dm_device.thread);
2118 dm_device.thread = NULL;
2122 dm_device.state = DM_INITIALIZED;
2127 dm_device.state = DM_INIT_ERROR;