Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 May 2024 21:41:39 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        Emmanuel Vadot <manu@FreeBSD.org>
Cc:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,  dev-commits-src-main@FreeBSD.org
Subject:   Re: git: cff79fd02636 - main - linuxkpi: Fix spin_lock_init
Message-ID:  <720nrnro-51n7-5669-o85o-p0rsr44o5951@SerrOFQ.bet>
In-Reply-To: <202405170559.44H5xD7d019861@gitrepo.freebsd.org>
References:  <202405170559.44H5xD7d019861@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 17 May 2024, Emmanuel Vadot wrote:

> The branch main has been updated by manu:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=cff79fd02636f34010d8b835cc9e55401fa76e74
>
> commit cff79fd02636f34010d8b835cc9e55401fa76e74
> Author:     Emmanuel Vadot <manu@FreeBSD.org>
> AuthorDate: 2024-05-17 04:52:53 +0000
> Commit:     Emmanuel Vadot <manu@FreeBSD.org>
> CommitDate: 2024-05-17 05:58:59 +0000
>
>    linuxkpi: Fix spin_lock_init
>
>    Some linux code re-init some spinlock so add MTX_NEW to mtx_init.

Sorry, I should have realized during the review; we no longer run the
memset(0) on them when (re-)initializing.


>    Reported by:    David Wolfskill <david@catwhisker.org>
>    Fixes:          ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code")
> ---
> sys/compat/linuxkpi/common/include/linux/spinlock.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h
> index 3f6eb4bb70f6..2992e41c9c02 100644
> --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h
> +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h
> @@ -140,7 +140,7 @@ typedef struct mtx spinlock_t;
> #define	spin_lock_name(name)		_spin_lock_name(name, __FILE__, __LINE__)
>
> #define	spin_lock_init(lock)	mtx_init(lock, spin_lock_name("lnxspin"), \
> -				  NULL, MTX_DEF | MTX_NOWITNESS)
> +				  NULL, MTX_DEF | MTX_NOWITNESS | MTX_NEW)
>
> #define	spin_lock_destroy(_l)	mtx_destroy(_l)
As mentioned elsewhere; it is funny this exists^^^

-- 
Bjoern A. Zeeb                                                     r15:7



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?720nrnro-51n7-5669-o85o-p0rsr44o5951>