git: b1f4275bfe86 - stable/12 - ena: Remove timer service re-arm on ena_restore_device failure

From: Marcin Wojtas <mw_at_FreeBSD.org>
Date: Tue, 31 Jan 2023 13:18:08 UTC
The branch stable/12 has been updated by mw:

URL: https://cgit.FreeBSD.org/src/commit/?id=b1f4275bfe866345091d8e62a744d01295141370

commit b1f4275bfe866345091d8e62a744d01295141370
Author:     David Arinzon <darinzon@amazon.com>
AuthorDate: 2022-12-04 10:37:32 +0000
Commit:     Marcin Wojtas <mw@FreeBSD.org>
CommitDate: 2023-01-31 12:46:50 +0000

    ena: Remove timer service re-arm on ena_restore_device failure
    
    In case the reset sequence fails (ena_destroy_device() followed by
    ena_restore_device() calls) during ena_restore_device(), the driver
    resources are being freed. After the clean-up, the timer service is
    re-armed in order to try and re-initialize the driver state.
    But, such an attempt would fail given that the resources are freed.
    Moreover, this would actually cause either the system to fail or a
    panic.
    When the driver fails in ena_restore_device() procedure, the only
    recovery is either unloading and loading the driver or instance
    reboot.
    
    This change removes the timer service re-arm in case of failure
    in ena_restore_device().
    
    MFC after: 2 weeks
    Sponsored by: Amazon, Inc.
    Fixes: 78554d0c707c ("ena: start timer service on attach")
    
    (cherry picked from commit c4a85b8d684d3db9dc4d3d01d966130e21390529)
---
 sys/dev/ena/ena.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c
index fe9c411f125a..15c8d39d8fb5 100644
--- a/sys/dev/ena/ena.c
+++ b/sys/dev/ena/ena.c
@@ -3454,8 +3454,6 @@ err:
 	ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_ONGOING_RESET, adapter);
 	ena_log(dev, ERR, "Reset attempt failed. Can not reset the device\n");
 
-	ENA_TIMER_RESET(adapter);
-
 	return (rc);
 }