git: 0ee8440d1334 - stable/12 - ena: Move reset completion logging to the reset function

From: Marcin Wojtas <mw_at_FreeBSD.org>
Date: Tue, 26 Jul 2022 19:33:20 UTC
The branch stable/12 has been updated by mw:

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

commit 0ee8440d13340b7b6c2fddb9fbaabccd5fc5adc7
Author:     Dawid Gorecki <dgr@semihalf.com>
AuthorDate: 2022-06-10 09:17:53 +0000
Commit:     Marcin Wojtas <mw@FreeBSD.org>
CommitDate: 2022-07-26 19:33:02 +0000

    ena: Move reset completion logging to the reset function
    
    While ena_restore_device is called from the reset task, it can also be
    called from other locations in the driver, for example in netmap
    specific code. Move the reset completion logging to reset task, so it
    better represents when the reset actually happened.
    
    Obtained from: Semihalf
    MFC after: 2 weeks
    Sponsored by: Amazon, Inc.
    
    (cherry picked from commit d209ffee155dd5e505f174a356c8f50c96ebf57e)
---
 sys/dev/ena/ena.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c
index 9a54d0b41b36..e21f7bbcc2b0 100644
--- a/sys/dev/ena/ena.c
+++ b/sys/dev/ena/ena.c
@@ -3459,9 +3459,6 @@ ena_restore_device(struct ena_adapter *adapter)
 
 	ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_DEV_UP_BEFORE_RESET, adapter);
 
-	ena_log(dev, INFO,
-	    "Device reset completed successfully, Driver info: %s\n", ena_version);
-
 	return (rc);
 
 err_disable_msix:
@@ -3492,6 +3489,10 @@ ena_reset_task(void *arg, int pending)
 	if (likely(ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) {
 		ena_destroy_device(adapter, false);
 		ena_restore_device(adapter);
+
+		ena_log(adapter->pdev, INFO,
+		    "Device reset completed successfully, Driver info: %s\n",
+		    ena_version);
 	}
 	ENA_LOCK_UNLOCK();
 }