]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
net: ena: fix rare uncompleted admin command false alarm
authorNetanel Belgazal <netanel@amazon.com>
Sun, 11 Jun 2017 12:42:43 +0000 (15:42 +0300)
committerKamal Mostafa <kamal@canonical.com>
Mon, 10 Jul 2017 17:31:40 +0000 (10:31 -0700)
commit6729b8bd8798ede7c89c8f1aa9fe9e1045df26a4
tree8f38dbb9dcadd0184e386ac514fc94bb86cfca6c
parente328a03169f994f702779b8d5ec5c4160b7caf9c
net: ena: fix rare uncompleted admin command false alarm

BugLink: http://bugs.launchpad.net/bugs/1701575
The current flow to detect admin completion is:
while (command_not_completed) {
if (timeout)
error

check_for_completion()
sleep()
   }
So in case the sleep took more than the timeout
(in case the thread/workqueue was not scheduled due to higher priority
task or prolonged VMexit), the driver can detect a stall even if
the completion is present.

The fix changes the order of this function to first check for
completion and only after that check if the timeout expired.

Fixes: 1738cd3ed342 ("Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Netanel Belgazal <netanel@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a77c1aafcc906f657d1a0890c1d898be9ee1d5c9)
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
drivers/net/ethernet/amazon/ena/ena_com.c