Skip to content

Commit c1c0e40

Browse files
Sameeh Jubrandavem330
authored andcommitted
net: ena: use SHUTDOWN as reset reason when closing interface
The 'ENA_REGS_RESET_SHUTDOWN' enum indicates a normal driver shutdown / removal procedure. Also, a comment is added to one of the reset reason assignments for code clarity. Signed-off-by: Shay Agroskin <[email protected]> Signed-off-by: Arthur Kiyanovski <[email protected]> Signed-off-by: Sameeh Jubran <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f5db045 commit c1c0e40

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/amazon/ena/ena_netdev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3439,6 +3439,7 @@ static void ena_destroy_device(struct ena_adapter *adapter, bool graceful)
34393439

34403440
ena_com_mmio_reg_read_request_destroy(ena_dev);
34413441

3442+
/* return reset reason to default value */
34423443
adapter->reset_reason = ENA_REGS_RESET_NORMAL;
34433444

34443445
clear_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags);
@@ -4362,6 +4363,7 @@ static void __ena_shutoff(struct pci_dev *pdev, bool shutdown)
43624363
cancel_work_sync(&adapter->reset_task);
43634364

43644365
rtnl_lock(); /* lock released inside the below if-else block */
4366+
adapter->reset_reason = ENA_REGS_RESET_SHUTDOWN;
43654367
ena_destroy_device(adapter, true);
43664368
if (shutdown) {
43674369
netif_device_detach(netdev);

0 commit comments

Comments
 (0)