• Netanel Belgazal's avatar
    net: ena: fix device destruction to gracefully free resources · cfa324a5
    Netanel Belgazal authored
    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: default avatarNetanel Belgazal <netanel@amazon.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    cfa324a5
ena_netdev.c 93.7 KB