git: 9a5acf365db3 - main - nvme: Clear the notify flag if the consumer rejects the controller.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 20 Dec 2022 01:54:16 UTC
The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9a5acf365db3b94338220bd354041727dffcb77c commit 9a5acf365db3b94338220bd354041727dffcb77c Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2022-12-20 01:50:30 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2022-12-20 01:53:38 +0000 nvme: Clear the notify flag if the consumer rejects the controller. While here, fix some type mismatch warnings. Reviewed by: imp Sponsored by: Netapp, Inc. Sponsored by: Klara, Inc. MFC after: 1 week --- sys/dev/nvme/nvme.c | 4 +++- sys/dev/nvme/nvme.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvme/nvme.c b/sys/dev/nvme/nvme.c index fc491eb72f1c..b75d558a36d5 100644 --- a/sys/dev/nvme/nvme.c +++ b/sys/dev/nvme/nvme.c @@ -177,8 +177,10 @@ nvme_notify(struct nvme_consumer *cons, ctrlr->cons_cookie[cons->id] = ctrlr_cookie; /* ctrlr_fn has failed. Nothing to notify here any more. */ - if (ctrlr_cookie == NULL) + if (ctrlr_cookie == NULL) { + (void)atomic_cmpset_32(&ctrlr->notification_sent, 1, 0); return; + } if (ctrlr->is_failed) { ctrlr->cons_cookie[cons->id] = NULL; diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index ccc980a7c6ec..196d6f0b35c2 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -2052,7 +2052,7 @@ void nvme_resv_status_swapbytes(struct nvme_resv_status *s __unused, size_t size __unused) { #if _BYTE_ORDER != _LITTLE_ENDIAN - u_int i, n; + size_t i, n; s->gen = le32toh(s->gen); n = (s->regctl[1] << 8) | s->regctl[0]; @@ -2070,7 +2070,7 @@ void nvme_resv_status_ext_swapbytes(struct nvme_resv_status_ext *s __unused, size_t size __unused) { #if _BYTE_ORDER != _LITTLE_ENDIAN - u_int i, n; + size_t i, n; s->gen = le32toh(s->gen); n = (s->regctl[1] << 8) | s->regctl[0];