git: ffe9a1987bb7 - stable/13 - Continue searching for an irq map from the start
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 25 Sep 2023 11:01:02 UTC
The branch stable/13 has been updated by andrew:
URL: https://cgit.FreeBSD.org/src/commit/?id=ffe9a1987bb7d57b21bb19e20fd9f66dd98e7a78
commit ffe9a1987bb7d57b21bb19e20fd9f66dd98e7a78
Author: Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2023-06-27 08:32:12 +0000
Commit: Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2023-09-25 08:41:32 +0000
Continue searching for an irq map from the start
When searching for a free irq map location continue the search from the
beginning of the list. There may be holes in the map before
irq_map_first_free_idx, e.g. when removing an entries in order will
increase the index past the current free entry.
PR: 271990
Reviewed by: mhorne
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40768
(cherry picked from commit 9beb195fd9fdc4beb7d5bca865cf5b19ccd7449b)
---
sys/kern/subr_intr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c
index 02da0b884535..cb7a8647e433 100644
--- a/sys/kern/subr_intr.c
+++ b/sys/kern/subr_intr.c
@@ -1715,6 +1715,14 @@ intr_map_irq(device_t dev, intptr_t xref, struct intr_map_data *data)
return (i);
}
}
+ for (i = 0; i < irq_map_first_free_idx; i++) {
+ if (irq_map[i] == NULL) {
+ irq_map[i] = entry;
+ irq_map_first_free_idx = i + 1;
+ mtx_unlock(&irq_map_lock);
+ return (i);
+ }
+ }
mtx_unlock(&irq_map_lock);
/* XXX Expand irq_map table */