diff for duplicates of <20180306182128.23281-4-decui@microsoft.com> diff --git a/a/1.txt b/N1/1.txt index acc8a0e..21c5f0d 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,6 +1,5 @@ When we hot-remove the device, we first receive a PCI_EJECT message and -then receive a PCI_BUS_RELATIONS message with bus_rel->device_count =3D=3D = -0. +then receive a PCI_BUS_RELATIONS message with bus_rel->device_count == 0. The first message is offloaded to hv_eject_device_work(), and the second is offloaded to pci_devices_present_work(). Both the paths can be running @@ -27,52 +26,50 @@ index 04edb24c92ee..aaee41faf55f 100644 +++ b/drivers/pci/host/pci-hyperv.c @@ -461,6 +461,8 @@ struct hv_pcibus_device { struct retarget_msi_interrupt retarget_msi_interrupt_params; -=20 + spinlock_t retarget_msi_interrupt_lock; + + struct workqueue_struct *wq; }; -=20 + /* -@@ -1770,7 +1772,7 @@ static void hv_pci_devices_present(struct hv_pcibus_d= -evice *hbus, +@@ -1770,7 +1772,7 @@ static void hv_pci_devices_present(struct hv_pcibus_device *hbus, spin_unlock_irqrestore(&hbus->device_list_lock, flags); -=20 + get_hvpcibus(hbus); - schedule_work(&dr_wrk->wrk); + queue_work(hbus->wq, &dr_wrk->wrk); } -=20 + /** -@@ -1845,7 +1847,7 @@ static void hv_pci_eject_device(struct hv_pci_dev *hp= -dev) +@@ -1845,7 +1847,7 @@ static void hv_pci_eject_device(struct hv_pci_dev *hpdev) get_pcichild(hpdev, hv_pcidev_ref_pnp); INIT_WORK(&hpdev->wrk, hv_eject_device_work); get_hvpcibus(hpdev->hbus); - schedule_work(&hpdev->wrk); + queue_work(hpdev->hbus->wq, &hpdev->wrk); } -=20 + /** @@ -2460,11 +2462,17 @@ static int hv_pci_probe(struct hv_device *hdev, spin_lock_init(&hbus->retarget_msi_interrupt_lock); sema_init(&hbus->enum_sem, 1); init_completion(&hbus->remove_event); -+ hbus->wq =3D alloc_ordered_workqueue("hv_pci_%x", 0, ++ hbus->wq = alloc_ordered_workqueue("hv_pci_%x", 0, + hbus->sysdata.domain); + if (!hbus->wq) { -+ ret =3D -ENOMEM; ++ ret = -ENOMEM; + goto free_bus; + } -=20 - ret =3D vmbus_open(hdev->channel, pci_ring_size, pci_ring_size, NULL, 0, + + ret = vmbus_open(hdev->channel, pci_ring_size, pci_ring_size, NULL, 0, hv_pci_onchannelcallback, hbus); if (ret) - goto free_bus; + goto destroy_wq; -=20 + hv_set_drvdata(hdev, hbus); -=20 + @@ -2533,6 +2541,8 @@ static int hv_pci_probe(struct hv_device *hdev, hv_free_config_window(hbus); close: @@ -90,5 +87,5 @@ dev) free_page((unsigned long)hbus); return 0; } ---=20 +-- 2.7.4 diff --git a/a/content_digest b/N1/content_digest index d70a516..74184d2 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -21,8 +21,7 @@ "\00:1\0" "b\0" "When we hot-remove the device, we first receive a PCI_EJECT message and\n" - "then receive a PCI_BUS_RELATIONS message with bus_rel->device_count =3D=3D =\n" - "0.\n" + "then receive a PCI_BUS_RELATIONS message with bus_rel->device_count == 0.\n" "\n" "The first message is offloaded to hv_eject_device_work(), and the second\n" "is offloaded to pci_devices_present_work(). Both the paths can be running\n" @@ -49,52 +48,50 @@ "+++ b/drivers/pci/host/pci-hyperv.c\n" "@@ -461,6 +461,8 @@ struct hv_pcibus_device {\n" " \tstruct retarget_msi_interrupt retarget_msi_interrupt_params;\n" - "=20\n" + " \n" " \tspinlock_t retarget_msi_interrupt_lock;\n" "+\n" "+\tstruct workqueue_struct *wq;\n" " };\n" - "=20\n" + " \n" " /*\n" - "@@ -1770,7 +1772,7 @@ static void hv_pci_devices_present(struct hv_pcibus_d=\n" - "evice *hbus,\n" + "@@ -1770,7 +1772,7 @@ static void hv_pci_devices_present(struct hv_pcibus_device *hbus,\n" " \tspin_unlock_irqrestore(&hbus->device_list_lock, flags);\n" - "=20\n" + " \n" " \tget_hvpcibus(hbus);\n" "-\tschedule_work(&dr_wrk->wrk);\n" "+\tqueue_work(hbus->wq, &dr_wrk->wrk);\n" " }\n" - "=20\n" + " \n" " /**\n" - "@@ -1845,7 +1847,7 @@ static void hv_pci_eject_device(struct hv_pci_dev *hp=\n" - "dev)\n" + "@@ -1845,7 +1847,7 @@ static void hv_pci_eject_device(struct hv_pci_dev *hpdev)\n" " \tget_pcichild(hpdev, hv_pcidev_ref_pnp);\n" " \tINIT_WORK(&hpdev->wrk, hv_eject_device_work);\n" " \tget_hvpcibus(hpdev->hbus);\n" "-\tschedule_work(&hpdev->wrk);\n" "+\tqueue_work(hpdev->hbus->wq, &hpdev->wrk);\n" " }\n" - "=20\n" + " \n" " /**\n" "@@ -2460,11 +2462,17 @@ static int hv_pci_probe(struct hv_device *hdev,\n" " \tspin_lock_init(&hbus->retarget_msi_interrupt_lock);\n" " \tsema_init(&hbus->enum_sem, 1);\n" " \tinit_completion(&hbus->remove_event);\n" - "+\thbus->wq =3D alloc_ordered_workqueue(\"hv_pci_%x\", 0,\n" + "+\thbus->wq = alloc_ordered_workqueue(\"hv_pci_%x\", 0,\n" "+\t\t\t\t\t hbus->sysdata.domain);\n" "+\tif (!hbus->wq) {\n" - "+\t\tret =3D -ENOMEM;\n" + "+\t\tret = -ENOMEM;\n" "+\t\tgoto free_bus;\n" "+\t}\n" - "=20\n" - " \tret =3D vmbus_open(hdev->channel, pci_ring_size, pci_ring_size, NULL, 0,\n" + " \n" + " \tret = vmbus_open(hdev->channel, pci_ring_size, pci_ring_size, NULL, 0,\n" " \t\t\t hv_pci_onchannelcallback, hbus);\n" " \tif (ret)\n" "-\t\tgoto free_bus;\n" "+\t\tgoto destroy_wq;\n" - "=20\n" + " \n" " \thv_set_drvdata(hdev, hbus);\n" - "=20\n" + " \n" "@@ -2533,6 +2541,8 @@ static int hv_pci_probe(struct hv_device *hdev,\n" " \thv_free_config_window(hbus);\n" " close:\n" @@ -112,7 +109,7 @@ " \tfree_page((unsigned long)hbus);\n" " \treturn 0;\n" " }\n" - "--=20\n" + "-- \n" 2.7.4 -b7176b82b0cd96a573d9e44c0ff9c41f8c132fe5ee304424680e8c6ea8b60742 +8de9916ecd91d1bac35b2f51a88d7d9c4e1cc400b67fe72d7a1b29c67d4e1f44
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.