<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/sym, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-02-02T21:57:56Z</updated>
<entry>
<title>sym(4): Map HCB memory as uncacheable also on x86</title>
<updated>2026-02-02T21:57:56Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2026-02-02T21:30:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b941d1c64e58708c93621cc07ed1c8e5e709cd48'/>
<id>urn:sha1:b941d1c64e58708c93621cc07ed1c8e5e709cd48</id>
<content type='text'>
As part of making the chip-specific mix and match of different accesses
(DMA/bus space) work as desired, the intent is to map the HCB memory as
uncacheable. Prior to VM_MEMATTR_*, the !x86 way of indicating this to
bus_dmamem_alloc(9) was BUS_DMA_COHERENT. Then later on in 2db99100a4,
BUS_DMA_NOCACHE was hooked up to VM_MEMATTR_UNCACHEABLE for x86. As it
turns out, still as of today bus_dmamem_alloc(9) differs in this regard
across architectures. On arm, it still supports BUS_DMA_COHERENT only
for requesting uncacheable DMA and x86 still uses BUS_DMA_NOCACHE only.
On arm64 and riscv, BUS_DMA_COHERENT seems to effectively be an alias
for BUS_DMA_NOCACHE.

Thus, allocate the HCB memory with BUS_DMA_COHERENT | BUS_DMA_NOCACHE,
so we get uncacheable memory on all architectures including x86 and so
loads and stores from/to HCB won't get reordered. However, even on x86
we still need to use at least compiler barriers to achieve the desired
program order.

This change should also fix panics due to out-of-sync data seen with
FreeBSD VMs on top of OpenStack and HBAs of type lsiLogic as a result
of loads and stores getting reordered. [1]

While at it:
- Nuke the unused SYM_DRIVER_NAME macro.
- Remove unused/redundant HCB members and correct a comment typo.

PR:		270816 [1]
MFC after:	3 days
</content>
</entry>
<entry>
<title>Revert "sym(4): Employ memory barriers also on x86"</title>
<updated>2026-02-02T21:53:13Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2026-01-28T21:20:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=bfbcd310bd4997c4ddb21bb81d61f2f29c68937c'/>
<id>urn:sha1:bfbcd310bd4997c4ddb21bb81d61f2f29c68937c</id>
<content type='text'>
The problem will be avoided in a different way.

This reverts commit e769bc77184312b6137a9b180c97b87c0760b849.
</content>
</entry>
<entry>
<title>sym(4): Employ memory barriers also on x86</title>
<updated>2026-01-26T15:54:48Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2026-01-26T13:58:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e769bc77184312b6137a9b180c97b87c0760b849'/>
<id>urn:sha1:e769bc77184312b6137a9b180c97b87c0760b849</id>
<content type='text'>
In an MP world, it doesn't hold that x86 requires no memory barriers.

This change should also fix panics due to out-of-sync data seen with
FreeBSD VMs on top of OpenStack and HBAs of type lsiLogic. [1]

While at it:
- Improve the granularity somewhat by distinguishing between read and
  write memory barriers as well as refer to existing *mb(9) functions
  instead of duplicating these [2], unless IO barriers are also used.
- Nuke the unused SYM_DRIVER_NAME macro.

PR:		270816 [1]
Obtained from:	BSD-licensed Linux sym53c8xx driver [2]
MFC after:	1 week
</content>
</entry>
<entry>
<title>sym(4): Provide a DEVICE_DETACH(9) method</title>
<updated>2026-01-26T15:54:48Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2026-01-22T09:05:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=518c01b31e96bbe8353a551885a61e7da6aed5f6'/>
<id>urn:sha1:518c01b31e96bbe8353a551885a61e7da6aed5f6</id>
<content type='text'>
This also fixes sym_cam_free() to tear things down correctly, i. e. in
opposite order of setup, as well as sym_cam_attach() to not free devq
and SIM twice in the failure case.
</content>
</entry>
<entry>
<title>sym(4): Use memcpy(9) instead of bcopy(9)</title>
<updated>2026-01-26T15:54:47Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2026-01-21T16:47:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c8e9479c74a2af0f6c665e930091c163bf760fd5'/>
<id>urn:sha1:c8e9479c74a2af0f6c665e930091c163bf760fd5</id>
<content type='text'>
The overlap handling of bcopy(9) is not required in these cases.

Obtained from:	BSD-licensed Linux sym53c8xx driver
</content>
</entry>
<entry>
<title>sym(4): Consistently use device_printf(9) where applicable</title>
<updated>2026-01-26T15:54:47Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2026-01-21T17:29:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=48eee744b540ef0413fa1cb543dde6e49e7f2ac4'/>
<id>urn:sha1:48eee744b540ef0413fa1cb543dde6e49e7f2ac4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>style(9): white space after ; and around binary operators</title>
<updated>2025-10-16T22:02:50Z</updated>
<author>
<name>David E. O'Brien</name>
<email>obrien@FreeBSD.org</email>
</author>
<published>2025-10-15T05:22:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0050289464fa56ec79e060b8d8378b9ff7145a0e'/>
<id>urn:sha1:0050289464fa56ec79e060b8d8378b9ff7145a0e</id>
<content type='text'>
in for() loops.  Also, use 'while', where only the
conditional test of 'for' was used.

Reviewed by: sjg
</content>
</entry>
<entry>
<title>sym(4): Add __diagused to nseg of getbaddrcb()</title>
<updated>2023-08-18T14:33:27Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2023-08-18T14:29:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ae6d4963589418f2116ddc8cabcf93dd2f4bbf3b'/>
<id>urn:sha1:ae6d4963589418f2116ddc8cabcf93dd2f4bbf3b</id>
<content type='text'>
The parameter is only used when compiling with INVARIANTS.
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:36Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:36Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=685dc743dc3b5645e34836464128e1c0558b404b'/>
<id>urn:sha1:685dc743dc3b5645e34836464128e1c0558b404b</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c comment pattern</title>
<updated>2023-08-16T17:54:24Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=71625ec9ad2a9bc8c09784fbd23b759830e0ee5f'/>
<id>urn:sha1:71625ec9ad2a9bc8c09784fbd23b759830e0ee5f</id>
<content type='text'>
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
</content>
</entry>
</feed>
