diff for duplicates of <20180303001947.20564-2-decui@microsoft.com> diff --git a/a/1.txt b/N1/1.txt index dbfbf6a..23e6920 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 1233300f41c6..57b1fb3ebdb9 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 + /** -@@ -1848,7 +1850,7 @@ static void hv_pci_eject_device(struct hv_pci_dev *hp= -dev) +@@ -1848,7 +1850,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 + /** @@ -2463,11 +2465,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 + @@ -2536,6 +2544,9 @@ static int hv_pci_probe(struct hv_device *hdev, hv_free_config_window(hbus); close: @@ -92,5 +89,9 @@ dev) free_page((unsigned long)hbus); return 0; } ---=20 +-- 2.7.4 +_______________________________________________ +devel mailing list +devel@linuxdriverproject.org +http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel diff --git a/a/content_digest b/N1/content_digest index 3eddace..02cc70a 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -6,22 +6,20 @@ linux-pci@vger.kernel.org <linux-pci@vger.kernel.org> KY Srinivasan <kys@microsoft.com> " Stephen Hemminger <sthemmin@microsoft.com>\0" - "Cc\0linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>" - driverdev-devel@linuxdriverproject.org <driverdev-devel@linuxdriverproject.org> + "Cc\0olaf@aepfle.de <olaf@aepfle.de>" Haiyang Zhang <haiyangz@microsoft.com> - olaf@aepfle.de <olaf@aepfle.de> + driverdev-devel@linuxdriverproject.org <driverdev-devel@linuxdriverproject.org> + linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org> + stable@vger.kernel.org <stable@vger.kernel.org> + Jack Morgenstein <jackm@mellanox.com> + marcelo.cerri@canonical.com <marcelo.cerri@canonical.com> apw@canonical.com <apw@canonical.com> - jasowang@redhat.com <jasowang@redhat.com> vkuznets@redhat.com <vkuznets@redhat.com> - marcelo.cerri@canonical.com <marcelo.cerri@canonical.com> - Dexuan Cui <decui@microsoft.com> - Jack Morgenstein <jackm@mellanox.com> - " stable@vger.kernel.org <stable@vger.kernel.org>\0" + " jasowang@redhat.com <jasowang@redhat.com>\0" "\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" @@ -48,52 +46,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" - "@@ -1848,7 +1850,7 @@ static void hv_pci_eject_device(struct hv_pci_dev *hp=\n" - "dev)\n" + "@@ -1848,7 +1850,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" "@@ -2463,11 +2465,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" "@@ -2536,6 +2544,9 @@ static int hv_pci_probe(struct hv_device *hdev,\n" " \thv_free_config_window(hbus);\n" " close:\n" @@ -113,7 +109,11 @@ " \tfree_page((unsigned long)hbus);\n" " \treturn 0;\n" " }\n" - "--=20\n" - 2.7.4 + "-- \n" + "2.7.4\n" + "_______________________________________________\n" + "devel mailing list\n" + "devel@linuxdriverproject.org\n" + http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel -159fb1ba19fe254948c1ae136b06173bc68a5db49bd4db6c1a2be9b7e1592de0 +c334c25b2ce7d436fe3333a1bb26e99524970cecab1509ac9d0fa27639b58d86
diff --git a/a/1.txt b/N2/1.txt index dbfbf6a..f661479 100644 --- a/a/1.txt +++ b/N2/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 1233300f41c6..57b1fb3ebdb9 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 + /** -@@ -1848,7 +1850,7 @@ static void hv_pci_eject_device(struct hv_pci_dev *hp= -dev) +@@ -1848,7 +1850,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 + /** @@ -2463,11 +2465,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 + @@ -2536,6 +2544,9 @@ static int hv_pci_probe(struct hv_device *hdev, hv_free_config_window(hbus); close: @@ -92,5 +89,5 @@ dev) free_page((unsigned long)hbus); return 0; } ---=20 +-- 2.7.4 diff --git a/a/content_digest b/N2/content_digest index 3eddace..a4c0a70 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -20,8 +20,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" @@ -48,52 +47,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" - "@@ -1848,7 +1850,7 @@ static void hv_pci_eject_device(struct hv_pci_dev *hp=\n" - "dev)\n" + "@@ -1848,7 +1850,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" "@@ -2463,11 +2465,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" "@@ -2536,6 +2544,9 @@ static int hv_pci_probe(struct hv_device *hdev,\n" " \thv_free_config_window(hbus);\n" " close:\n" @@ -113,7 +110,7 @@ " \tfree_page((unsigned long)hbus);\n" " \treturn 0;\n" " }\n" - "--=20\n" + "-- \n" 2.7.4 -159fb1ba19fe254948c1ae136b06173bc68a5db49bd4db6c1a2be9b7e1592de0 +3c6cc92ef33d67c8abbd6db4fe7cf4108b56797a6285f878f9c4fb05f6e293c6
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.