]> git.baikalelectronics.ru Git - kernel.git/commit
net: ena: fix device destruction to gracefully free resources
authorNetanel Belgazal <netanel@amazon.com>
Sun, 9 Sep 2018 08:15:22 +0000 (08:15 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 9 Sep 2018 14:59:55 +0000 (07:59 -0700)
commit0ae8cab3649cc6ac528c4ba0a7ec4031376fcb7b
treee641227b14798641b55385b957dc528c1179229a
parent2b31d9cdaa9496ee7dadf590b3c583c16f184157
net: ena: fix device destruction to gracefully free resources

When ena_destroy_device() is called from ena_suspend(), the device is
still reachable from the driver. Therefore, the driver can send a command
to the device to free all resources.
However, in all other cases of calling ena_destroy_device(), the device is
potentially in an error state and unreachable from the driver. In these
cases the driver must not send commands to the device.

The current implementation does not request resource freeing from the
device even when possible. We add the graceful parameter to
ena_destroy_device() to enable resource freeing when possible, and
use it in ena_suspend().

Signed-off-by: Netanel Belgazal <netanel@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amazon/ena/ena_netdev.c