]> 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)
commitb5f4395f5e346b55a3b8d3a7fee788d2be383a24
treee641227b14798641b55385b957dc528c1179229a
parentef923142730efec20d17f75fd2698fe05e4b87e7
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