git: a6c2fe6711c8 - stable/15 - linuxkpi: Define a guard for the `mutex` type

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Wed, 29 Apr 2026 21:43:01 UTC
The branch stable/15 has been updated by dumbbell:

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

commit a6c2fe6711c870a50419c0a137b0c218ef9483ef
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2026-04-20 21:38:11 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2026-04-29 21:03:53 +0000

    linuxkpi: Define a guard for the `mutex` type
    
    The amdgpu DRM driver started to use `guard(mutex)` in Linux 6.12.x.
    
    Reviewed by:    bz
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 7f59126493d44f21d9a2b1a0b5b81c30f9a438f0)
---
 sys/compat/linuxkpi/common/include/linux/mutex.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/mutex.h b/sys/compat/linuxkpi/common/include/linux/mutex.h
index 6fb6a7744a89..64d76491a76f 100644
--- a/sys/compat/linuxkpi/common/include/linux/mutex.h
+++ b/sys/compat/linuxkpi/common/include/linux/mutex.h
@@ -174,4 +174,6 @@ linux_mutex_destroy(mutex_t *m)
 
 extern int linux_mutex_lock_interruptible(mutex_t *m);
 
+DEFINE_GUARD(mutex, struct mutex *, mutex_lock(_T), mutex_unlock(_T))
+
 #endif					/* _LINUXKPI_LINUX_MUTEX_H_ */