]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
PCI: hv: Handle all pending messages in hv_pci_onchannelcallback()
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 17 Jun 2016 17:45:30 +0000 (12:45 -0500)
committerTim Gardner <tim.gardner@canonical.com>
Fri, 16 Sep 2016 17:08:45 +0000 (11:08 -0600)
commitf47e0c02809ad8b09be146cc24840285525a0844
treeeb45edf01287c3051512efa887977ff791da0cb4
parentcaee5e30b3d04a06b788d9008ee7820a308f8769
PCI: hv: Handle all pending messages in hv_pci_onchannelcallback()

BugLink: http://bugs.launchpad.net/bugs/1616677
When we have an interrupt from the host we have a bit set in event page
indicating there are messages for the particular channel.  We need to read
them all as we won't get signaled for what was on the queue before we
cleared the bit in vmbus_on_event().  This applies to all Hyper-V drivers
and the pass-through driver should do the same.

I did not meet any bugs; the issue was found by code inspection.  We don't
have many events going through hv_pci_onchannelcallback(), which explains
why nobody reported the issue before.

While on it, fix handling non-zero vmbus_recvpacket_raw() return values by
dropping out.  If the return value is not zero, it is wrong to inspect
buffer or bytes_recvd as these may contain invalid data.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jake Oshins <jakeo@microsoft.com>
(cherry picked from commit 837d741ea2e6bb23da9cad1667776fc6f0cb67dd)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
drivers/pci/host/pci-hyperv.c