<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/compat/linuxkpi/common/include/linux/spinlock.h, branch stable/14</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>LinuxKPI: add supporting #includes</title>
<updated>2026-04-01T04:33:47+00:00</updated>
<author>
<name>Bjoern A. Zeeb</name>
<email>bz@FreeBSD.org</email>
</author>
<published>2026-03-19T20:29:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7d069d7846519eb015133758647ee343e7d7f20a'/>
<id>7d069d7846519eb015133758647ee343e7d7f20a</id>
<content type='text'>
Compiling drm-kmod on !X86 does not include asm/smp.h which includes
preempt.h on FreeBSD.  In order to compile drm-kmod on other
architectures add the secondary #includes for preempt.h to
spinlock.h and hardirq.h (which now also gets included from highmem.h)
to connect the #include chain.

Sponsored by:	The FreeBSD Foundation
PR:		279864
Reviewed by:	jhibbits, emaste
Differential Revision: https://reviews.freebsd.org/D55974

(cherry picked from commit 1d18872c2519d7ca726ddc49735180ab1d8916e0)
(cherry picked from commit 29dce45d8c50ea5858dc91a4294e83b8d72a2f80)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Compiling drm-kmod on !X86 does not include asm/smp.h which includes
preempt.h on FreeBSD.  In order to compile drm-kmod on other
architectures add the secondary #includes for preempt.h to
spinlock.h and hardirq.h (which now also gets included from highmem.h)
to connect the #include chain.

Sponsored by:	The FreeBSD Foundation
PR:		279864
Reviewed by:	jhibbits, emaste
Differential Revision: https://reviews.freebsd.org/D55974

(cherry picked from commit 1d18872c2519d7ca726ddc49735180ab1d8916e0)
(cherry picked from commit 29dce45d8c50ea5858dc91a4294e83b8d72a2f80)
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxkpi: spinlock: Simplify code</title>
<updated>2024-06-04T11:22:40+00:00</updated>
<author>
<name>Emmanuel Vadot</name>
<email>manu@FreeBSD.org</email>
</author>
<published>2024-05-15T09:00:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=183b64dfd84ad7fd504d04f40c90edad809083c1'/>
<id>183b64dfd84ad7fd504d04f40c90edad809083c1</id>
<content type='text'>
Just use a typedef for spinlock_t, no need to create a useless
structure.

Reviewed by:		bz, emaste
Sponsored by:		Beckhoff Automation GmbH &amp; Co. KG
Differential Revision:	https://reviews.freebsd.org/D45205

(cherry picked from commit ae38a1a1bfdf320089c254e4dbffdf4769d89110)

linuxkpi: Fix spin_lock_init

Some linux code re-init some spinlock so add MTX_NEW to mtx_init.

Reported by:	David Wolfskill &lt;david@catwhisker.org&gt;
Fixes:		ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code")

(cherry picked from commit cff79fd02636f34010d8b835cc9e55401fa76e74)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Just use a typedef for spinlock_t, no need to create a useless
structure.

Reviewed by:		bz, emaste
Sponsored by:		Beckhoff Automation GmbH &amp; Co. KG
Differential Revision:	https://reviews.freebsd.org/D45205

(cherry picked from commit ae38a1a1bfdf320089c254e4dbffdf4769d89110)

linuxkpi: Fix spin_lock_init

Some linux code re-init some spinlock so add MTX_NEW to mtx_init.

Reported by:	David Wolfskill &lt;david@catwhisker.org&gt;
Fixes:		ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code")

(cherry picked from commit cff79fd02636f34010d8b835cc9e55401fa76e74)
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-16T17:54:11+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=95ee2897e98f5d444f26ed2334cc7c439f9c16c6'/>
<id>95ee2897e98f5d444f26ed2334cc7c439f9c16c6</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: Appease -Wunused-but-set-variable warnings from GCC.</title>
<updated>2023-03-31T17:56:33+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2023-03-31T17:56:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ad83dd2b2b6bb56c002a93fcf800b30f2ec448d5'/>
<id>ad83dd2b2b6bb56c002a93fcf800b30f2ec448d5</id>
<content type='text'>
- Mark assert dummy variables as __unused.

- Use a dummy (void) cast of the flags argument passed to
  spin_unlock_irqrestore so it gets treated as used.

Reviewed by:	manu, hselasky
Differential Revision:	https://reviews.freebsd.org/D39349
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Mark assert dummy variables as __unused.

- Use a dummy (void) cast of the flags argument passed to
  spin_unlock_irqrestore so it gets treated as used.

Reviewed by:	manu, hselasky
Differential Revision:	https://reviews.freebsd.org/D39349
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "LinuxKPI: Allow spin_lock_irqsave to be called within a critical section"</title>
<updated>2022-01-26T22:27:01+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2022-01-26T22:27:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=11ef1d975f61f728a25727fcb89b340b5433713c'/>
<id>11ef1d975f61f728a25727fcb89b340b5433713c</id>
<content type='text'>
This change results in deadlocks on UP systems

This reverts commit 7dea0c9e6eba4dc127cd67667c81fa2c250f1024.

Requested by:	kib, hselasky
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change results in deadlocks on UP systems

This reverts commit 7dea0c9e6eba4dc127cd67667c81fa2c250f1024.

Requested by:	kib, hselasky
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: Allow spin_lock_irqsave to be called within a critical section</title>
<updated>2022-01-18T20:14:12+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2022-01-18T20:14:12+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=02ea6033020e11afec6472bf560b0ddebd0fa97a'/>
<id>02ea6033020e11afec6472bf560b0ddebd0fa97a</id>
<content type='text'>
with spinning on spin_trylock. dma-buf part of drm-kmod depends on this
property and absence of it support results in "mi_switch: switch in a
critical section" assertions [1][2].

[1] https://github.com/freebsd/drm-kmod/issues/116
[2] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261166

MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D33887
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
with spinning on spin_trylock. dma-buf part of drm-kmod depends on this
property and absence of it support results in "mi_switch: switch in a
critical section" assertions [1][2].

[1] https://github.com/freebsd/drm-kmod/issues/116
[2] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261166

MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D33887
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards</title>
<updated>2022-01-10T19:49:38+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2021-12-19T10:42:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=307f78f3ed90a4145eeb2c8cc79bc95b2666f57a'/>
<id>307f78f3ed90a4145eeb2c8cc79bc95b2666f57a</id>
<content type='text'>
MFC after:	1 week
Reviewed by:	bz, emaste, hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33562
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MFC after:	1 week
Reviewed by:	bz, emaste, hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33562
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: Add some typical header pollution</title>
<updated>2022-01-10T19:49:37+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2021-12-04T10:00:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f1a7639a165d2ef945c0fdac5862167da671c7c4'/>
<id>f1a7639a165d2ef945c0fdac5862167da671c7c4</id>
<content type='text'>
To reduce amount of drm-kmod patching

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33297
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To reduce amount of drm-kmod patching

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33297
</pre>
</div>
</content>
</entry>
<entry>
<title>linuxkpi: Add spin_trylock_irqsave() macro</title>
<updated>2021-07-15T14:52:42+00:00</updated>
<author>
<name>Neel Chauhan</name>
<email>nc@FreeBSD.org</email>
</author>
<published>2021-07-15T14:52:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=086cfe4df8ab237f0cf156e95d36657250931981'/>
<id>086cfe4df8ab237f0cf156e95d36657250931981</id>
<content type='text'>
This is needed by the drm-kmod 5.6 update.

Reviewed by:		hselasky
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D30706
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is needed by the drm-kmod 5.6 update.

Reviewed by:		hselasky
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D30706
</pre>
</div>
</content>
</entry>
<entry>
<title>LinuxKPI: Change flags parameter type of atomic_dec_and_lock_irqsave</title>
<updated>2021-07-05T00:19:01+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2021-07-05T00:19:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c77ec79b57aa92b428b940ed550a4a14ed44da48'/>
<id>c77ec79b57aa92b428b940ed550a4a14ed44da48</id>
<content type='text'>
On Linux atomic_dec_and_lock_irqsave is a wrapper macro which provides
a reference to third parameter rather than parameter value itself to
implementation routine called _atomic_dec_and_lock_irqsave [1].

While here, implement a fast path.

[1] https://github.com/torvalds/linux/blob/master/include/linux/spinlock.h#L476

Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D30781
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Linux atomic_dec_and_lock_irqsave is a wrapper macro which provides
a reference to third parameter rather than parameter value itself to
implementation routine called _atomic_dec_and_lock_irqsave [1].

While here, implement a fast path.

[1] https://github.com/torvalds/linux/blob/master/include/linux/spinlock.h#L476

Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D30781
</pre>
</div>
</content>
</entry>
</feed>
