git: d46fa8be05a7 - stable/12 - Use symbolic names for asych events

Warner Losh imp at FreeBSD.org
Sat Jul 31 00:21:23 UTC 2021


The branch stable/12 has been updated by imp:

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

commit d46fa8be05a75e1d580e3311f87e0c0d63db7de9
Author:     Warner Losh <imp at FreeBSD.org>
AuthorDate: 2020-08-31 19:38:03 +0000
Commit:     Warner Losh <imp at FreeBSD.org>
CommitDate: 2021-07-31 00:02:52 +0000

    Use symbolic names for asych events
    
    Rather than |= 0x300, define and use asyn event names for the name
    space changes and the firmware activations that we're asking for.
    
    (cherry picked from commit 881534f09cccbf4bc749be22eb34ad57b5c13563)
---
 sys/dev/nvme/nvme.h       | 2 ++
 sys/dev/nvme/nvme_ctrlr.c | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h
index 41d5362f6982..982c994d6433 100644
--- a/sys/dev/nvme/nvme.h
+++ b/sys/dev/nvme/nvme.h
@@ -497,6 +497,8 @@ enum nvme_critical_warning_state {
 	NVME_CRIT_WARN_ST_VOLATILE_MEMORY_BACKUP	= 0x10,
 };
 #define NVME_CRIT_WARN_ST_RESERVED_MASK			(0xE0)
+#define	NVME_ASYNC_EVENT_NS_ATTRIBUTE			(0x100)
+#define	NVME_ASYNC_EVENT_FW_ACTIVATE			(0x200)
 
 /* slot for current FW */
 #define NVME_FIRMWARE_PAGE_AFI_SLOT_SHIFT		(0)
diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
index a6e2429dbd19..efc8fbcdf567 100644
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -834,7 +834,8 @@ nvme_ctrlr_configure_aer(struct nvme_controller *ctrlr)
 	    NVME_CRIT_WARN_ST_READ_ONLY |
 	    NVME_CRIT_WARN_ST_VOLATILE_MEMORY_BACKUP;
 	if (ctrlr->cdata.ver >= NVME_REV(1, 2))
-		ctrlr->async_event_config |= 0x300;
+		ctrlr->async_event_config |= NVME_ASYNC_EVENT_NS_ATTRIBUTE |
+		    NVME_ASYNC_EVENT_FW_ACTIVATE;
 
 	status.done = 0;
 	nvme_ctrlr_cmd_get_feature(ctrlr, NVME_FEAT_TEMPERATURE_THRESHOLD,


More information about the dev-commits-src-all mailing list