git: d209ffee155d - main - ena: Move reset completion logging to the reset function

From: Marcin Wojtas <mw_at_FreeBSD.org>
Date: Thu, 30 Jun 2022 16:15:31 UTC
The branch main has been updated by mw:

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

commit d209ffee155dd5e505f174a356c8f50c96ebf57e
Author:     Dawid Gorecki <dgr@semihalf.com>
AuthorDate: 2022-06-10 09:17:53 +0000
Commit:     Marcin Wojtas <mw@FreeBSD.org>
CommitDate: 2022-06-30 15:31:23 +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.
---
 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 61a5ff95262c..4527d2e2f298 100644
--- a/sys/dev/ena/ena.c
+++ b/sys/dev/ena/ena.c
@@ -3455,9 +3455,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:
@@ -3488,6 +3485,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();
 }