]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Jun 2017 20:36:45 +0000 (16:36 -0400)
commit038f8c40cb91c93349baf09b2d204fa26e8bc7b7
treea63a4ac44158e16d8a523ac42dc0fefbc98f5fbd
parenta71cf3fae69a5f15f47f665a3da72d26b9697fc4
net: ena: fix rare uncompleted admin command false alarm

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: e59074db59c6 ("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>
drivers/net/ethernet/amazon/ena/ena_com.c