diff for duplicates of <20180303001947.20564-3-decui@microsoft.com> diff --git a/a/1.txt b/N1/1.txt index c2f7357..c28978f 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -18,7 +18,7 @@ Fix this by polling the channel for the PCI_EJECT message and hpdev->state, and by checking the PCI vendor ID. Note: actually the above issues also happen to a SMP VM, if -"hbus->hdev->channel->target_cpu =3D=3D smp_processor_id()" is true. +"hbus->hdev->channel->target_cpu == smp_processor_id()" is true. Signed-off-by: Dexuan Cui <decui@microsoft.com> Tested-by: Adrian Suhov <v-adsuho@microsoft.com> @@ -29,8 +29,7 @@ Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Vitaly Kuznetsov <vkuznets@redhat.com> Cc: Jack Morgenstein <jackm@mellanox.com> --- - drivers/pci/host/pci-hyperv.c | 58 +++++++++++++++++++++++++++++++++++++++= -+++- + drivers/pci/host/pci-hyperv.c | 58 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c @@ -40,22 +39,21 @@ index 57b1fb3ebdb9..32d6b03cdd40 100644 @@ -522,6 +522,8 @@ struct hv_pci_compl { s32 completion_status; }; -=20 + +static void hv_pci_onchannelcallback(void *context); + /** * hv_pci_generic_compl() - Invoked for a completion packet * @context: Set up by the sender of the packet. -@@ -666,6 +668,31 @@ static void _hv_pcifront_read_config(struct hv_pci_dev= - *hpdev, int where, +@@ -666,6 +668,31 @@ static void _hv_pcifront_read_config(struct hv_pci_dev *hpdev, int where, } } -=20 + +static u16 hv_pcifront_get_vendor_id(struct hv_pci_dev *hpdev) +{ + u16 ret; + unsigned long flags; -+ void __iomem *addr =3D hpdev->hbus->cfg_addr + CFG_PAGE_OFFSET + ++ void __iomem *addr = hpdev->hbus->cfg_addr + CFG_PAGE_OFFSET + + PCI_VENDOR_ID; + + spin_lock_irqsave(&hpdev->hbus->config_lock, flags); @@ -65,7 +63,7 @@ index 57b1fb3ebdb9..32d6b03cdd40 100644 + /* Make sure the function was chosen before we start reading. */ + mb(); + /* Read from that function's config space. */ -+ ret =3D readw(addr); ++ ret = readw(addr); + /* + * mb() is not required here, because the spin_unlock_irqrestore() + * is a barrier. @@ -79,15 +77,14 @@ index 57b1fb3ebdb9..32d6b03cdd40 100644 /** * _hv_pcifront_write_config() - Internal PCI config write * @hpdev: The PCI driver's representation of the device -@@ -1108,8 +1135,37 @@ static void hv_compose_msi_msg(struct irq_data *data= -, struct msi_msg *msg) +@@ -1108,8 +1135,37 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) * Since this function is called with IRQ locks held, can't * do normal wait for completion; instead poll. */ - while (!try_wait_for_completion(&comp.comp_pkt.host_event)) + while (!try_wait_for_completion(&comp.comp_pkt.host_event)) { + /* 0xFFFF means an invalid PCI VENDOR ID. */ -+ if (hv_pcifront_get_vendor_id(hpdev) =3D=3D 0xFFFF) { ++ if (hv_pcifront_get_vendor_id(hpdev) == 0xFFFF) { + dev_err_once(&hbus->hdev->device, + "the device has gone\n"); + goto free_int_desc; @@ -103,12 +100,12 @@ index 57b1fb3ebdb9..32d6b03cdd40 100644 + */ + local_bh_disable(); + -+ if (hbus->hdev->channel->target_cpu =3D=3D smp_processor_id()) ++ if (hbus->hdev->channel->target_cpu == smp_processor_id()) + hv_pci_onchannelcallback(hbus); + + local_bh_enable(); + -+ if (hpdev->state =3D=3D hv_pcichild_ejecting) { ++ if (hpdev->state == hv_pcichild_ejecting) { + dev_err_once(&hbus->hdev->device, + "the device is being ejected\n"); + goto free_int_desc; @@ -116,8 +113,12 @@ index 57b1fb3ebdb9..32d6b03cdd40 100644 + udelay(100); + } -=20 + if (comp.comp_pkt.completion_status < 0) { dev_err(&hbus->hdev->device, ---=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 9ec05c9..494d532 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -6,17 +6,16 @@ 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> - stable@vger.kernel.org <stable@vger.kernel.org> - " Jack Morgenstein <jackm@mellanox.com>\0" + " jasowang@redhat.com <jasowang@redhat.com>\0" "\00:1\0" "b\0" "1. With the patch \"x86/vector/msi: Switch to global reservation mode\"\n" @@ -39,7 +38,7 @@ "hpdev->state, and by checking the PCI vendor ID.\n" "\n" "Note: actually the above issues also happen to a SMP VM, if\n" - "\"hbus->hdev->channel->target_cpu =3D=3D smp_processor_id()\" is true.\n" + "\"hbus->hdev->channel->target_cpu == smp_processor_id()\" is true.\n" "\n" "Signed-off-by: Dexuan Cui <decui@microsoft.com>\n" "Tested-by: Adrian Suhov <v-adsuho@microsoft.com>\n" @@ -50,8 +49,7 @@ "Cc: Vitaly Kuznetsov <vkuznets@redhat.com>\n" "Cc: Jack Morgenstein <jackm@mellanox.com>\n" "---\n" - " drivers/pci/host/pci-hyperv.c | 58 +++++++++++++++++++++++++++++++++++++++=\n" - "+++-\n" + " drivers/pci/host/pci-hyperv.c | 58 ++++++++++++++++++++++++++++++++++++++++++-\n" " 1 file changed, 57 insertions(+), 1 deletion(-)\n" "\n" "diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c\n" @@ -61,22 +59,21 @@ "@@ -522,6 +522,8 @@ struct hv_pci_compl {\n" " \ts32 completion_status;\n" " };\n" - "=20\n" + " \n" "+static void hv_pci_onchannelcallback(void *context);\n" "+\n" " /**\n" " * hv_pci_generic_compl() - Invoked for a completion packet\n" " * @context:\t\tSet up by the sender of the packet.\n" - "@@ -666,6 +668,31 @@ static void _hv_pcifront_read_config(struct hv_pci_dev=\n" - " *hpdev, int where,\n" + "@@ -666,6 +668,31 @@ static void _hv_pcifront_read_config(struct hv_pci_dev *hpdev, int where,\n" " \t}\n" " }\n" - "=20\n" + " \n" "+static u16 hv_pcifront_get_vendor_id(struct hv_pci_dev *hpdev)\n" "+{\n" "+\tu16 ret;\n" "+\tunsigned long flags;\n" - "+\tvoid __iomem *addr =3D hpdev->hbus->cfg_addr + CFG_PAGE_OFFSET +\n" + "+\tvoid __iomem *addr = hpdev->hbus->cfg_addr + CFG_PAGE_OFFSET +\n" "+\t\t\t PCI_VENDOR_ID;\n" "+\n" "+\tspin_lock_irqsave(&hpdev->hbus->config_lock, flags);\n" @@ -86,7 +83,7 @@ "+\t/* Make sure the function was chosen before we start reading. */\n" "+\tmb();\n" "+\t/* Read from that function's config space. */\n" - "+\tret =3D readw(addr);\n" + "+\tret = readw(addr);\n" "+\t/*\n" "+\t * mb() is not required here, because the spin_unlock_irqrestore()\n" "+\t * is a barrier.\n" @@ -100,15 +97,14 @@ " /**\n" " * _hv_pcifront_write_config() - Internal PCI config write\n" " * @hpdev:\tThe PCI driver's representation of the device\n" - "@@ -1108,8 +1135,37 @@ static void hv_compose_msi_msg(struct irq_data *data=\n" - ", struct msi_msg *msg)\n" + "@@ -1108,8 +1135,37 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)\n" " \t * Since this function is called with IRQ locks held, can't\n" " \t * do normal wait for completion; instead poll.\n" " \t */\n" "-\twhile (!try_wait_for_completion(&comp.comp_pkt.host_event))\n" "+\twhile (!try_wait_for_completion(&comp.comp_pkt.host_event)) {\n" "+\t\t/* 0xFFFF means an invalid PCI VENDOR ID. */\n" - "+\t\tif (hv_pcifront_get_vendor_id(hpdev) =3D=3D 0xFFFF) {\n" + "+\t\tif (hv_pcifront_get_vendor_id(hpdev) == 0xFFFF) {\n" "+\t\t\tdev_err_once(&hbus->hdev->device,\n" "+\t\t\t\t \"the device has gone\\n\");\n" "+\t\t\tgoto free_int_desc;\n" @@ -124,12 +120,12 @@ "+\t\t */\n" "+\t\tlocal_bh_disable();\n" "+\n" - "+\t\tif (hbus->hdev->channel->target_cpu =3D=3D smp_processor_id())\n" + "+\t\tif (hbus->hdev->channel->target_cpu == smp_processor_id())\n" "+\t\t\thv_pci_onchannelcallback(hbus);\n" "+\n" "+\t\tlocal_bh_enable();\n" "+\n" - "+\t\tif (hpdev->state =3D=3D hv_pcichild_ejecting) {\n" + "+\t\tif (hpdev->state == hv_pcichild_ejecting) {\n" "+\t\t\tdev_err_once(&hbus->hdev->device,\n" "+\t\t\t\t \"the device is being ejected\\n\");\n" "+\t\t\tgoto free_int_desc;\n" @@ -137,10 +133,14 @@ "+\n" " \t\tudelay(100);\n" "+\t}\n" - "=20\n" + " \n" " \tif (comp.comp_pkt.completion_status < 0) {\n" " \t\tdev_err(&hbus->hdev->device,\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 -d035fdf57cd8100185f8928f6c9d7b4d1b51cac53f8b20f20d2588e0f2d89a07 +d3b5bf576b74abc36386db1c9d302121391ff8f0804f1f11431e91b594ed7459
diff --git a/a/1.txt b/N2/1.txt index c2f7357..95ef4d6 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -18,7 +18,7 @@ Fix this by polling the channel for the PCI_EJECT message and hpdev->state, and by checking the PCI vendor ID. Note: actually the above issues also happen to a SMP VM, if -"hbus->hdev->channel->target_cpu =3D=3D smp_processor_id()" is true. +"hbus->hdev->channel->target_cpu == smp_processor_id()" is true. Signed-off-by: Dexuan Cui <decui@microsoft.com> Tested-by: Adrian Suhov <v-adsuho@microsoft.com> @@ -29,8 +29,7 @@ Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Vitaly Kuznetsov <vkuznets@redhat.com> Cc: Jack Morgenstein <jackm@mellanox.com> --- - drivers/pci/host/pci-hyperv.c | 58 +++++++++++++++++++++++++++++++++++++++= -+++- + drivers/pci/host/pci-hyperv.c | 58 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c @@ -40,22 +39,21 @@ index 57b1fb3ebdb9..32d6b03cdd40 100644 @@ -522,6 +522,8 @@ struct hv_pci_compl { s32 completion_status; }; -=20 + +static void hv_pci_onchannelcallback(void *context); + /** * hv_pci_generic_compl() - Invoked for a completion packet * @context: Set up by the sender of the packet. -@@ -666,6 +668,31 @@ static void _hv_pcifront_read_config(struct hv_pci_dev= - *hpdev, int where, +@@ -666,6 +668,31 @@ static void _hv_pcifront_read_config(struct hv_pci_dev *hpdev, int where, } } -=20 + +static u16 hv_pcifront_get_vendor_id(struct hv_pci_dev *hpdev) +{ + u16 ret; + unsigned long flags; -+ void __iomem *addr =3D hpdev->hbus->cfg_addr + CFG_PAGE_OFFSET + ++ void __iomem *addr = hpdev->hbus->cfg_addr + CFG_PAGE_OFFSET + + PCI_VENDOR_ID; + + spin_lock_irqsave(&hpdev->hbus->config_lock, flags); @@ -65,7 +63,7 @@ index 57b1fb3ebdb9..32d6b03cdd40 100644 + /* Make sure the function was chosen before we start reading. */ + mb(); + /* Read from that function's config space. */ -+ ret =3D readw(addr); ++ ret = readw(addr); + /* + * mb() is not required here, because the spin_unlock_irqrestore() + * is a barrier. @@ -79,15 +77,14 @@ index 57b1fb3ebdb9..32d6b03cdd40 100644 /** * _hv_pcifront_write_config() - Internal PCI config write * @hpdev: The PCI driver's representation of the device -@@ -1108,8 +1135,37 @@ static void hv_compose_msi_msg(struct irq_data *data= -, struct msi_msg *msg) +@@ -1108,8 +1135,37 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) * Since this function is called with IRQ locks held, can't * do normal wait for completion; instead poll. */ - while (!try_wait_for_completion(&comp.comp_pkt.host_event)) + while (!try_wait_for_completion(&comp.comp_pkt.host_event)) { + /* 0xFFFF means an invalid PCI VENDOR ID. */ -+ if (hv_pcifront_get_vendor_id(hpdev) =3D=3D 0xFFFF) { ++ if (hv_pcifront_get_vendor_id(hpdev) == 0xFFFF) { + dev_err_once(&hbus->hdev->device, + "the device has gone\n"); + goto free_int_desc; @@ -103,12 +100,12 @@ index 57b1fb3ebdb9..32d6b03cdd40 100644 + */ + local_bh_disable(); + -+ if (hbus->hdev->channel->target_cpu =3D=3D smp_processor_id()) ++ if (hbus->hdev->channel->target_cpu == smp_processor_id()) + hv_pci_onchannelcallback(hbus); + + local_bh_enable(); + -+ if (hpdev->state =3D=3D hv_pcichild_ejecting) { ++ if (hpdev->state == hv_pcichild_ejecting) { + dev_err_once(&hbus->hdev->device, + "the device is being ejected\n"); + goto free_int_desc; @@ -116,8 +113,8 @@ index 57b1fb3ebdb9..32d6b03cdd40 100644 + udelay(100); + } -=20 + if (comp.comp_pkt.completion_status < 0) { dev_err(&hbus->hdev->device, ---=20 +-- 2.7.4 diff --git a/a/content_digest b/N2/content_digest index 9ec05c9..bb3dce6 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -39,7 +39,7 @@ "hpdev->state, and by checking the PCI vendor ID.\n" "\n" "Note: actually the above issues also happen to a SMP VM, if\n" - "\"hbus->hdev->channel->target_cpu =3D=3D smp_processor_id()\" is true.\n" + "\"hbus->hdev->channel->target_cpu == smp_processor_id()\" is true.\n" "\n" "Signed-off-by: Dexuan Cui <decui@microsoft.com>\n" "Tested-by: Adrian Suhov <v-adsuho@microsoft.com>\n" @@ -50,8 +50,7 @@ "Cc: Vitaly Kuznetsov <vkuznets@redhat.com>\n" "Cc: Jack Morgenstein <jackm@mellanox.com>\n" "---\n" - " drivers/pci/host/pci-hyperv.c | 58 +++++++++++++++++++++++++++++++++++++++=\n" - "+++-\n" + " drivers/pci/host/pci-hyperv.c | 58 ++++++++++++++++++++++++++++++++++++++++++-\n" " 1 file changed, 57 insertions(+), 1 deletion(-)\n" "\n" "diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c\n" @@ -61,22 +60,21 @@ "@@ -522,6 +522,8 @@ struct hv_pci_compl {\n" " \ts32 completion_status;\n" " };\n" - "=20\n" + " \n" "+static void hv_pci_onchannelcallback(void *context);\n" "+\n" " /**\n" " * hv_pci_generic_compl() - Invoked for a completion packet\n" " * @context:\t\tSet up by the sender of the packet.\n" - "@@ -666,6 +668,31 @@ static void _hv_pcifront_read_config(struct hv_pci_dev=\n" - " *hpdev, int where,\n" + "@@ -666,6 +668,31 @@ static void _hv_pcifront_read_config(struct hv_pci_dev *hpdev, int where,\n" " \t}\n" " }\n" - "=20\n" + " \n" "+static u16 hv_pcifront_get_vendor_id(struct hv_pci_dev *hpdev)\n" "+{\n" "+\tu16 ret;\n" "+\tunsigned long flags;\n" - "+\tvoid __iomem *addr =3D hpdev->hbus->cfg_addr + CFG_PAGE_OFFSET +\n" + "+\tvoid __iomem *addr = hpdev->hbus->cfg_addr + CFG_PAGE_OFFSET +\n" "+\t\t\t PCI_VENDOR_ID;\n" "+\n" "+\tspin_lock_irqsave(&hpdev->hbus->config_lock, flags);\n" @@ -86,7 +84,7 @@ "+\t/* Make sure the function was chosen before we start reading. */\n" "+\tmb();\n" "+\t/* Read from that function's config space. */\n" - "+\tret =3D readw(addr);\n" + "+\tret = readw(addr);\n" "+\t/*\n" "+\t * mb() is not required here, because the spin_unlock_irqrestore()\n" "+\t * is a barrier.\n" @@ -100,15 +98,14 @@ " /**\n" " * _hv_pcifront_write_config() - Internal PCI config write\n" " * @hpdev:\tThe PCI driver's representation of the device\n" - "@@ -1108,8 +1135,37 @@ static void hv_compose_msi_msg(struct irq_data *data=\n" - ", struct msi_msg *msg)\n" + "@@ -1108,8 +1135,37 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)\n" " \t * Since this function is called with IRQ locks held, can't\n" " \t * do normal wait for completion; instead poll.\n" " \t */\n" "-\twhile (!try_wait_for_completion(&comp.comp_pkt.host_event))\n" "+\twhile (!try_wait_for_completion(&comp.comp_pkt.host_event)) {\n" "+\t\t/* 0xFFFF means an invalid PCI VENDOR ID. */\n" - "+\t\tif (hv_pcifront_get_vendor_id(hpdev) =3D=3D 0xFFFF) {\n" + "+\t\tif (hv_pcifront_get_vendor_id(hpdev) == 0xFFFF) {\n" "+\t\t\tdev_err_once(&hbus->hdev->device,\n" "+\t\t\t\t \"the device has gone\\n\");\n" "+\t\t\tgoto free_int_desc;\n" @@ -124,12 +121,12 @@ "+\t\t */\n" "+\t\tlocal_bh_disable();\n" "+\n" - "+\t\tif (hbus->hdev->channel->target_cpu =3D=3D smp_processor_id())\n" + "+\t\tif (hbus->hdev->channel->target_cpu == smp_processor_id())\n" "+\t\t\thv_pci_onchannelcallback(hbus);\n" "+\n" "+\t\tlocal_bh_enable();\n" "+\n" - "+\t\tif (hpdev->state =3D=3D hv_pcichild_ejecting) {\n" + "+\t\tif (hpdev->state == hv_pcichild_ejecting) {\n" "+\t\t\tdev_err_once(&hbus->hdev->device,\n" "+\t\t\t\t \"the device is being ejected\\n\");\n" "+\t\t\tgoto free_int_desc;\n" @@ -137,10 +134,10 @@ "+\n" " \t\tudelay(100);\n" "+\t}\n" - "=20\n" + " \n" " \tif (comp.comp_pkt.completion_status < 0) {\n" " \t\tdev_err(&hbus->hdev->device,\n" - "--=20\n" + "-- \n" 2.7.4 -d035fdf57cd8100185f8928f6c9d7b4d1b51cac53f8b20f20d2588e0f2d89a07 +91a0c6a78c4cfff6b86e34fdf7e78de2fcbbe6e9a23ba0c9bc7b506799c57b93
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.