git: 3b03e1bb8615 - main - intrng: Store the IPI priority

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Thu, 24 Oct 2024 10:36:36 UTC
The branch main has been updated by andrew:

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

commit 3b03e1bb86157cc235563fc6e86c33b6bd9baea8
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-10-23 16:57:53 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-10-24 10:20:48 +0000

    intrng: Store the IPI priority
    
    When registering an interrupt controller we take a priority to compare.
    We never store the priority so any later calls may act incorrectly.
    
    Store the priority so later calls act as expected.
    
    Reviewed by:    jrtc27
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D47235
---
 sys/kern/subr_intr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c
index b8c085367dd6..e88018e58729 100644
--- a/sys/kern/subr_intr.c
+++ b/sys/kern/subr_intr.c
@@ -1854,8 +1854,10 @@ intr_ipi_pic_register(device_t dev, u_int priority)
 		return (EBUSY);
 	}
 
-	if (intr_ipi_dev == NULL || priority > intr_ipi_dev_priority)
+	if (intr_ipi_dev == NULL || priority > intr_ipi_dev_priority) {
+		intr_ipi_dev_priority = priority;
 		intr_ipi_dev = dev;
+	}
 
 	return (0);
 }