Lines Matching refs:hbus

532 	struct hv_pcibus_device *hbus;  member
575 static struct hv_pci_dev *get_pcichild_wslot(struct hv_pcibus_device *hbus,
666 void __iomem *addr = hpdev->hbus->cfg_addr + CFG_PAGE_OFFSET + where; in _hv_pcifront_read_config()
694 spin_lock_irqsave(&hpdev->hbus->config_lock, flags); in _hv_pcifront_read_config()
696 writel(hpdev->desc.win_slot.slot, hpdev->hbus->cfg_addr); in _hv_pcifront_read_config()
716 spin_unlock_irqrestore(&hpdev->hbus->config_lock, flags); in _hv_pcifront_read_config()
718 dev_err(&hpdev->hbus->hdev->device, in _hv_pcifront_read_config()
727 void __iomem *addr = hpdev->hbus->cfg_addr + CFG_PAGE_OFFSET + in hv_pcifront_get_vendor_id()
730 spin_lock_irqsave(&hpdev->hbus->config_lock, flags); in hv_pcifront_get_vendor_id()
733 writel(hpdev->desc.win_slot.slot, hpdev->hbus->cfg_addr); in hv_pcifront_get_vendor_id()
743 spin_unlock_irqrestore(&hpdev->hbus->config_lock, flags); in hv_pcifront_get_vendor_id()
759 void __iomem *addr = hpdev->hbus->cfg_addr + CFG_PAGE_OFFSET + where; in _hv_pcifront_write_config()
765 spin_lock_irqsave(&hpdev->hbus->config_lock, flags); in _hv_pcifront_write_config()
767 writel(hpdev->desc.win_slot.slot, hpdev->hbus->cfg_addr); in _hv_pcifront_write_config()
787 spin_unlock_irqrestore(&hpdev->hbus->config_lock, flags); in _hv_pcifront_write_config()
789 dev_err(&hpdev->hbus->hdev->device, in _hv_pcifront_write_config()
808 struct hv_pcibus_device *hbus = in hv_pcifront_read_config() local
812 hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(devfn)); in hv_pcifront_read_config()
836 struct hv_pcibus_device *hbus = in hv_pcifront_write_config() local
840 hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(devfn)); in hv_pcifront_write_config()
936 struct hv_pcibus_device *hbus = in hv_read_config_block() local
963 ret = vmbus_sendpacket(hbus->hdev->channel, read_blk, in hv_read_config_block()
970 ret = wait_for_response(hbus->hdev, &comp_pkt.comp_pkt.host_event); in hv_read_config_block()
976 dev_err(&hbus->hdev->device, in hv_read_config_block()
1016 struct hv_pcibus_device *hbus = in hv_write_config_block() local
1053 ret = vmbus_sendpacket(hbus->hdev->channel, write_blk, pkt_size, in hv_write_config_block()
1059 ret = wait_for_response(hbus->hdev, &comp_pkt.host_event); in hv_write_config_block()
1064 dev_err(&hbus->hdev->device, in hv_write_config_block()
1086 struct hv_pcibus_device *hbus = in hv_register_block_invalidate() local
1091 hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(pdev->devfn)); in hv_register_block_invalidate()
1119 vmbus_sendpacket(hpdev->hbus->hdev->channel, int_pkt, sizeof(*int_pkt), in hv_int_desc_free()
1138 struct hv_pcibus_device *hbus; in hv_msi_free() local
1146 hbus = info->data; in hv_msi_free()
1152 hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(pdev->devfn)); in hv_msi_free()
1190 struct hv_pcibus_device *hbus; in hv_irq_unmask() local
1203 hbus = container_of(pbus->sysdata, struct hv_pcibus_device, sysdata); in hv_irq_unmask()
1205 spin_lock_irqsave(&hbus->retarget_msi_interrupt_lock, flags); in hv_irq_unmask()
1207 params = &hbus->retarget_msi_interrupt_params; in hv_irq_unmask()
1213 params->device_id = (hbus->hdev->dev_instance.b[5] << 24) | in hv_irq_unmask()
1214 (hbus->hdev->dev_instance.b[4] << 16) | in hv_irq_unmask()
1215 (hbus->hdev->dev_instance.b[7] << 8) | in hv_irq_unmask()
1216 (hbus->hdev->dev_instance.b[6] & 0xf8) | in hv_irq_unmask()
1269 spin_unlock_irqrestore(&hbus->retarget_msi_interrupt_lock, flags); in hv_irq_unmask()
1272 dev_err(&hbus->hdev->device, in hv_irq_unmask()
1354 struct hv_pcibus_device *hbus; in hv_compose_msi_msg() local
1376 hbus = container_of(pbus->sysdata, struct hv_pcibus_device, sysdata); in hv_compose_msi_msg()
1377 hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(pdev->devfn)); in hv_compose_msi_msg()
1417 dev_err(&hbus->hdev->device, in hv_compose_msi_msg()
1422 ret = vmbus_sendpacket(hpdev->hbus->hdev->channel, &ctxt.int_pkts, in hv_compose_msi_msg()
1427 dev_err(&hbus->hdev->device, in hv_compose_msi_msg()
1440 dev_err_once(&hbus->hdev->device, in hv_compose_msi_msg()
1456 if (hbus->hdev->channel->target_cpu == smp_processor_id()) in hv_compose_msi_msg()
1457 hv_pci_onchannelcallback(hbus); in hv_compose_msi_msg()
1462 dev_err_once(&hbus->hdev->device, in hv_compose_msi_msg()
1471 dev_err(&hbus->hdev->device, in hv_compose_msi_msg()
1539 static int hv_pcie_init_irq_domain(struct hv_pcibus_device *hbus) in hv_pcie_init_irq_domain() argument
1541 hbus->msi_info.chip = &hv_msi_irq_chip; in hv_pcie_init_irq_domain()
1542 hbus->msi_info.ops = &hv_msi_ops; in hv_pcie_init_irq_domain()
1543 hbus->msi_info.flags = (MSI_FLAG_USE_DEF_DOM_OPS | in hv_pcie_init_irq_domain()
1546 hbus->msi_info.handler = handle_edge_irq; in hv_pcie_init_irq_domain()
1547 hbus->msi_info.handler_name = "edge"; in hv_pcie_init_irq_domain()
1548 hbus->msi_info.data = hbus; in hv_pcie_init_irq_domain()
1549 hbus->irq_domain = pci_msi_create_irq_domain(hbus->sysdata.fwnode, in hv_pcie_init_irq_domain()
1550 &hbus->msi_info, in hv_pcie_init_irq_domain()
1552 if (!hbus->irq_domain) { in hv_pcie_init_irq_domain()
1553 dev_err(&hbus->hdev->device, in hv_pcie_init_irq_domain()
1585 static void survey_child_resources(struct hv_pcibus_device *hbus) in survey_child_resources() argument
1595 event = xchg(&hbus->survey_event, NULL); in survey_child_resources()
1600 if (hbus->low_mmio_space || hbus->high_mmio_space) { in survey_child_resources()
1605 spin_lock_irqsave(&hbus->device_list_lock, flags); in survey_child_resources()
1612 list_for_each_entry(hpdev, &hbus->children, list_entry) { in survey_child_resources()
1615 dev_err(&hbus->hdev->device, in survey_child_resources()
1634 hbus->high_mmio_space += bar_size; in survey_child_resources()
1636 hbus->low_mmio_space += bar_size; in survey_child_resources()
1641 spin_unlock_irqrestore(&hbus->device_list_lock, flags); in survey_child_resources()
1657 static void prepopulate_bars(struct hv_pcibus_device *hbus) in prepopulate_bars() argument
1671 if (hbus->low_mmio_space) { in prepopulate_bars()
1672 low_size = 1ULL << (63 - __builtin_clzll(hbus->low_mmio_space)); in prepopulate_bars()
1673 low_base = hbus->low_mmio_res->start; in prepopulate_bars()
1676 if (hbus->high_mmio_space) { in prepopulate_bars()
1678 (63 - __builtin_clzll(hbus->high_mmio_space)); in prepopulate_bars()
1679 high_base = hbus->high_mmio_res->start; in prepopulate_bars()
1682 spin_lock_irqsave(&hbus->device_list_lock, flags); in prepopulate_bars()
1686 list_for_each_entry(hpdev, &hbus->children, list_entry) { in prepopulate_bars()
1739 spin_unlock_irqrestore(&hbus->device_list_lock, flags); in prepopulate_bars()
1751 static void hv_pci_assign_slots(struct hv_pcibus_device *hbus) in hv_pci_assign_slots() argument
1757 list_for_each_entry(hpdev, &hbus->children, list_entry) { in hv_pci_assign_slots()
1763 hpdev->pci_slot = pci_create_slot(hbus->pci_bus, slot_nr, in hv_pci_assign_slots()
1775 static void hv_pci_remove_slots(struct hv_pcibus_device *hbus) in hv_pci_remove_slots() argument
1779 list_for_each_entry(hpdev, &hbus->children, list_entry) { in hv_pci_remove_slots()
1793 static int create_root_hv_pci_bus(struct hv_pcibus_device *hbus) in create_root_hv_pci_bus() argument
1796 hbus->pci_bus = pci_create_root_bus(&hbus->hdev->device, in create_root_hv_pci_bus()
1799 &hbus->sysdata, in create_root_hv_pci_bus()
1800 &hbus->resources_for_children); in create_root_hv_pci_bus()
1801 if (!hbus->pci_bus) in create_root_hv_pci_bus()
1804 hbus->pci_bus->msi = &hbus->msi_chip; in create_root_hv_pci_bus()
1805 hbus->pci_bus->msi->dev = &hbus->hdev->device; in create_root_hv_pci_bus()
1808 pci_scan_child_bus(hbus->pci_bus); in create_root_hv_pci_bus()
1809 pci_bus_assign_resources(hbus->pci_bus); in create_root_hv_pci_bus()
1810 hv_pci_assign_slots(hbus); in create_root_hv_pci_bus()
1811 pci_bus_add_devices(hbus->pci_bus); in create_root_hv_pci_bus()
1813 hbus->state = hv_pcibus_installed; in create_root_hv_pci_bus()
1840 dev_err(&completion->hpdev->hbus->hdev->device, in q_resource_requirements()
1864 static struct hv_pci_dev *new_pcichild_device(struct hv_pcibus_device *hbus, in new_pcichild_device() argument
1881 hpdev->hbus = hbus; in new_pcichild_device()
1892 ret = vmbus_sendpacket(hbus->hdev->channel, res_req, in new_pcichild_device()
1900 if (wait_for_response(hbus->hdev, &comp_pkt.host_event)) in new_pcichild_device()
1906 spin_lock_irqsave(&hbus->device_list_lock, flags); in new_pcichild_device()
1908 list_add_tail(&hpdev->list_entry, &hbus->children); in new_pcichild_device()
1909 spin_unlock_irqrestore(&hbus->device_list_lock, flags); in new_pcichild_device()
1930 static struct hv_pci_dev *get_pcichild_wslot(struct hv_pcibus_device *hbus, in get_pcichild_wslot() argument
1936 spin_lock_irqsave(&hbus->device_list_lock, flags); in get_pcichild_wslot()
1937 list_for_each_entry(iter, &hbus->children, list_entry) { in get_pcichild_wslot()
1944 spin_unlock_irqrestore(&hbus->device_list_lock, flags); in get_pcichild_wslot()
1978 struct hv_pcibus_device *hbus; in pci_devices_present_work() local
1985 hbus = dr_wrk->bus; in pci_devices_present_work()
1991 spin_lock_irqsave(&hbus->device_list_lock, flags); in pci_devices_present_work()
1992 while (!list_empty(&hbus->dr_list)) { in pci_devices_present_work()
1993 dr = list_first_entry(&hbus->dr_list, struct hv_dr_state, in pci_devices_present_work()
1998 if (!list_empty(&hbus->dr_list)) { in pci_devices_present_work()
2003 spin_unlock_irqrestore(&hbus->device_list_lock, flags); in pci_devices_present_work()
2006 put_hvpcibus(hbus); in pci_devices_present_work()
2011 spin_lock_irqsave(&hbus->device_list_lock, flags); in pci_devices_present_work()
2012 list_for_each_entry(hpdev, &hbus->children, list_entry) { in pci_devices_present_work()
2015 spin_unlock_irqrestore(&hbus->device_list_lock, flags); in pci_devices_present_work()
2022 spin_lock_irqsave(&hbus->device_list_lock, flags); in pci_devices_present_work()
2023 list_for_each_entry(hpdev, &hbus->children, list_entry) { in pci_devices_present_work()
2032 spin_unlock_irqrestore(&hbus->device_list_lock, flags); in pci_devices_present_work()
2035 hpdev = new_pcichild_device(hbus, new_desc); in pci_devices_present_work()
2037 dev_err(&hbus->hdev->device, in pci_devices_present_work()
2043 spin_lock_irqsave(&hbus->device_list_lock, flags); in pci_devices_present_work()
2046 list_for_each_entry(hpdev, &hbus->children, list_entry) { in pci_devices_present_work()
2055 spin_unlock_irqrestore(&hbus->device_list_lock, flags); in pci_devices_present_work()
2069 switch (hbus->state) { in pci_devices_present_work()
2076 pci_scan_child_bus(hbus->pci_bus); in pci_devices_present_work()
2077 hv_pci_assign_slots(hbus); in pci_devices_present_work()
2083 survey_child_resources(hbus); in pci_devices_present_work()
2090 put_hvpcibus(hbus); in pci_devices_present_work()
2102 static void hv_pci_devices_present(struct hv_pcibus_device *hbus, in hv_pci_devices_present() argument
2123 dr_wrk->bus = hbus; in hv_pci_devices_present()
2131 spin_lock_irqsave(&hbus->device_list_lock, flags); in hv_pci_devices_present()
2137 pending_dr = !list_empty(&hbus->dr_list); in hv_pci_devices_present()
2138 list_add_tail(&dr->list_entry, &hbus->dr_list); in hv_pci_devices_present()
2139 spin_unlock_irqrestore(&hbus->device_list_lock, flags); in hv_pci_devices_present()
2144 get_hvpcibus(hbus); in hv_pci_devices_present()
2145 queue_work(hbus->wq, &dr_wrk->wrk); in hv_pci_devices_present()
2161 struct hv_pcibus_device *hbus; in hv_eject_device_work() local
2172 hbus = hpdev->hbus; in hv_eject_device_work()
2183 pdev = pci_get_domain_bus_and_slot(hbus->sysdata.domain, 0, wslot); in hv_eject_device_work()
2191 spin_lock_irqsave(&hbus->device_list_lock, flags); in hv_eject_device_work()
2193 spin_unlock_irqrestore(&hbus->device_list_lock, flags); in hv_eject_device_work()
2202 vmbus_sendpacket(hbus->hdev->channel, ejct_pkt, in hv_eject_device_work()
2213 put_hvpcibus(hbus); in hv_eject_device_work()
2229 get_hvpcibus(hpdev->hbus); in hv_pci_eject_device()
2230 queue_work(hpdev->hbus->wq, &hpdev->wrk); in hv_pci_eject_device()
2244 struct hv_pcibus_device *hbus = context; in hv_pci_onchannelcallback() local
2263 ret = vmbus_recvpacket_raw(hbus->hdev->channel, buffer, in hv_pci_onchannelcallback()
2313 dev_err(&hbus->hdev->device, in hv_pci_onchannelcallback()
2318 hv_pci_devices_present(hbus, bus_rel); in hv_pci_onchannelcallback()
2324 hpdev = get_pcichild_wslot(hbus, in hv_pci_onchannelcallback()
2335 hpdev = get_pcichild_wslot(hbus, in hv_pci_onchannelcallback()
2348 dev_warn(&hbus->hdev->device, in hv_pci_onchannelcallback()
2356 dev_err(&hbus->hdev->device, in hv_pci_onchannelcallback()
2455 static void hv_pci_free_bridge_windows(struct hv_pcibus_device *hbus) in hv_pci_free_bridge_windows() argument
2462 if (hbus->low_mmio_space && hbus->low_mmio_res) { in hv_pci_free_bridge_windows()
2463 hbus->low_mmio_res->flags |= IORESOURCE_BUSY; in hv_pci_free_bridge_windows()
2464 vmbus_free_mmio(hbus->low_mmio_res->start, in hv_pci_free_bridge_windows()
2465 resource_size(hbus->low_mmio_res)); in hv_pci_free_bridge_windows()
2468 if (hbus->high_mmio_space && hbus->high_mmio_res) { in hv_pci_free_bridge_windows()
2469 hbus->high_mmio_res->flags |= IORESOURCE_BUSY; in hv_pci_free_bridge_windows()
2470 vmbus_free_mmio(hbus->high_mmio_res->start, in hv_pci_free_bridge_windows()
2471 resource_size(hbus->high_mmio_res)); in hv_pci_free_bridge_windows()
2500 static int hv_pci_allocate_bridge_windows(struct hv_pcibus_device *hbus) in hv_pci_allocate_bridge_windows() argument
2505 if (hbus->low_mmio_space) { in hv_pci_allocate_bridge_windows()
2506 align = 1ULL << (63 - __builtin_clzll(hbus->low_mmio_space)); in hv_pci_allocate_bridge_windows()
2507 ret = vmbus_allocate_mmio(&hbus->low_mmio_res, hbus->hdev, 0, in hv_pci_allocate_bridge_windows()
2509 hbus->low_mmio_space, in hv_pci_allocate_bridge_windows()
2512 dev_err(&hbus->hdev->device, in hv_pci_allocate_bridge_windows()
2514 hbus->low_mmio_space); in hv_pci_allocate_bridge_windows()
2519 hbus->low_mmio_res->flags |= IORESOURCE_WINDOW; in hv_pci_allocate_bridge_windows()
2520 hbus->low_mmio_res->flags &= ~IORESOURCE_BUSY; in hv_pci_allocate_bridge_windows()
2521 pci_add_resource(&hbus->resources_for_children, in hv_pci_allocate_bridge_windows()
2522 hbus->low_mmio_res); in hv_pci_allocate_bridge_windows()
2525 if (hbus->high_mmio_space) { in hv_pci_allocate_bridge_windows()
2526 align = 1ULL << (63 - __builtin_clzll(hbus->high_mmio_space)); in hv_pci_allocate_bridge_windows()
2527 ret = vmbus_allocate_mmio(&hbus->high_mmio_res, hbus->hdev, in hv_pci_allocate_bridge_windows()
2529 hbus->high_mmio_space, align, in hv_pci_allocate_bridge_windows()
2532 dev_err(&hbus->hdev->device, in hv_pci_allocate_bridge_windows()
2534 hbus->high_mmio_space); in hv_pci_allocate_bridge_windows()
2539 hbus->high_mmio_res->flags |= IORESOURCE_WINDOW; in hv_pci_allocate_bridge_windows()
2540 hbus->high_mmio_res->flags &= ~IORESOURCE_BUSY; in hv_pci_allocate_bridge_windows()
2541 pci_add_resource(&hbus->resources_for_children, in hv_pci_allocate_bridge_windows()
2542 hbus->high_mmio_res); in hv_pci_allocate_bridge_windows()
2548 if (hbus->low_mmio_res) { in hv_pci_allocate_bridge_windows()
2549 vmbus_free_mmio(hbus->low_mmio_res->start, in hv_pci_allocate_bridge_windows()
2550 resource_size(hbus->low_mmio_res)); in hv_pci_allocate_bridge_windows()
2565 static int hv_allocate_config_window(struct hv_pcibus_device *hbus) in hv_allocate_config_window() argument
2573 ret = vmbus_allocate_mmio(&hbus->mem_config, hbus->hdev, 0, -1, in hv_allocate_config_window()
2586 hbus->mem_config->flags |= IORESOURCE_BUSY; in hv_allocate_config_window()
2591 static void hv_free_config_window(struct hv_pcibus_device *hbus) in hv_free_config_window() argument
2593 vmbus_free_mmio(hbus->mem_config->start, PCI_CONFIG_MMIO_LENGTH); in hv_free_config_window()
2604 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev); in hv_pci_enter_d0() local
2625 d0_entry->mmio_base = hbus->mem_config->start; in hv_pci_enter_d0()
2660 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev); in hv_pci_query_relations() local
2667 if (cmpxchg(&hbus->survey_event, NULL, &comp)) in hv_pci_query_relations()
2700 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev); in hv_send_resources_allocated() local
2720 hpdev = get_pcichild_wslot(hbus, wslot); in hv_send_resources_allocated()
2775 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev); in hv_send_resources_released() local
2782 hpdev = get_pcichild_wslot(hbus, wslot); in hv_send_resources_released()
2801 static void get_hvpcibus(struct hv_pcibus_device *hbus) in get_hvpcibus() argument
2803 refcount_inc(&hbus->remove_lock); in get_hvpcibus()
2806 static void put_hvpcibus(struct hv_pcibus_device *hbus) in put_hvpcibus() argument
2808 if (refcount_dec_and_test(&hbus->remove_lock)) in put_hvpcibus()
2809 complete(&hbus->remove_event); in put_hvpcibus()
2864 struct hv_pcibus_device *hbus; in hv_pci_probe() local
2873 BUILD_BUG_ON(sizeof(*hbus) > PAGE_SIZE); in hv_pci_probe()
2875 hbus = (struct hv_pcibus_device *)get_zeroed_page(GFP_KERNEL); in hv_pci_probe()
2876 if (!hbus) in hv_pci_probe()
2878 hbus->state = hv_pcibus_init; in hv_pci_probe()
2908 hbus->sysdata.domain = dom; in hv_pci_probe()
2910 hbus->hdev = hdev; in hv_pci_probe()
2911 refcount_set(&hbus->remove_lock, 1); in hv_pci_probe()
2912 INIT_LIST_HEAD(&hbus->children); in hv_pci_probe()
2913 INIT_LIST_HEAD(&hbus->dr_list); in hv_pci_probe()
2914 INIT_LIST_HEAD(&hbus->resources_for_children); in hv_pci_probe()
2915 spin_lock_init(&hbus->config_lock); in hv_pci_probe()
2916 spin_lock_init(&hbus->device_list_lock); in hv_pci_probe()
2917 spin_lock_init(&hbus->retarget_msi_interrupt_lock); in hv_pci_probe()
2918 init_completion(&hbus->remove_event); in hv_pci_probe()
2919 hbus->wq = alloc_ordered_workqueue("hv_pci_%x", 0, in hv_pci_probe()
2920 hbus->sysdata.domain); in hv_pci_probe()
2921 if (!hbus->wq) { in hv_pci_probe()
2927 hv_pci_onchannelcallback, hbus); in hv_pci_probe()
2931 hv_set_drvdata(hdev, hbus); in hv_pci_probe()
2937 ret = hv_allocate_config_window(hbus); in hv_pci_probe()
2941 hbus->cfg_addr = ioremap(hbus->mem_config->start, in hv_pci_probe()
2943 if (!hbus->cfg_addr) { in hv_pci_probe()
2956 hbus->sysdata.fwnode = irq_domain_alloc_named_fwnode(name); in hv_pci_probe()
2958 if (!hbus->sysdata.fwnode) { in hv_pci_probe()
2963 ret = hv_pcie_init_irq_domain(hbus); in hv_pci_probe()
2975 ret = hv_pci_allocate_bridge_windows(hbus); in hv_pci_probe()
2983 prepopulate_bars(hbus); in hv_pci_probe()
2985 hbus->state = hv_pcibus_probed; in hv_pci_probe()
2987 ret = create_root_hv_pci_bus(hbus); in hv_pci_probe()
2994 hv_pci_free_bridge_windows(hbus); in hv_pci_probe()
2996 irq_domain_remove(hbus->irq_domain); in hv_pci_probe()
2998 irq_domain_free_fwnode(hbus->sysdata.fwnode); in hv_pci_probe()
3000 iounmap(hbus->cfg_addr); in hv_pci_probe()
3002 hv_free_config_window(hbus); in hv_pci_probe()
3006 destroy_workqueue(hbus->wq); in hv_pci_probe()
3008 hv_put_dom_num(hbus->sysdata.domain); in hv_pci_probe()
3010 free_page((unsigned long)hbus); in hv_pci_probe()
3016 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev); in hv_pci_bus_exit() local
3034 hv_pci_devices_present(hbus, &relations); in hv_pci_bus_exit()
3064 struct hv_pcibus_device *hbus; in hv_pci_remove() local
3066 hbus = hv_get_drvdata(hdev); in hv_pci_remove()
3067 if (hbus->state == hv_pcibus_installed) { in hv_pci_remove()
3070 pci_stop_root_bus(hbus->pci_bus); in hv_pci_remove()
3071 hv_pci_remove_slots(hbus); in hv_pci_remove()
3072 pci_remove_root_bus(hbus->pci_bus); in hv_pci_remove()
3074 hbus->state = hv_pcibus_removed; in hv_pci_remove()
3081 iounmap(hbus->cfg_addr); in hv_pci_remove()
3082 hv_free_config_window(hbus); in hv_pci_remove()
3083 pci_free_resource_list(&hbus->resources_for_children); in hv_pci_remove()
3084 hv_pci_free_bridge_windows(hbus); in hv_pci_remove()
3085 irq_domain_remove(hbus->irq_domain); in hv_pci_remove()
3086 irq_domain_free_fwnode(hbus->sysdata.fwnode); in hv_pci_remove()
3087 put_hvpcibus(hbus); in hv_pci_remove()
3088 wait_for_completion(&hbus->remove_event); in hv_pci_remove()
3089 destroy_workqueue(hbus->wq); in hv_pci_remove()
3091 hv_put_dom_num(hbus->sysdata.domain); in hv_pci_remove()
3093 free_page((unsigned long)hbus); in hv_pci_remove()