<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/sym/sym_hipd.c, branch stable/14</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>sym(4): Map HCB memory as uncacheable also on x86</title>
<updated>2026-02-05T21:54:07+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2026-02-02T21:30:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=79da80d56a427c4c6fe7e35f2d866b84db979a25'/>
<id>79da80d56a427c4c6fe7e35f2d866b84db979a25</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

(cherry picked from commit b941d1c64e58708c93621cc07ed1c8e5e709cd48)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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

(cherry picked from commit b941d1c64e58708c93621cc07ed1c8e5e709cd48)
</pre>
</div>
</content>
</entry>
<entry>
<title>sym(4): Provide a DEVICE_DETACH(9) method</title>
<updated>2026-02-05T21:54:07+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2026-01-22T09:05:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5d546e86517d8052ffb33fccf55f9c5f7438153f'/>
<id>5d546e86517d8052ffb33fccf55f9c5f7438153f</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.

(cherry picked from commit 518c01b31e96bbe8353a551885a61e7da6aed5f6)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.

(cherry picked from commit 518c01b31e96bbe8353a551885a61e7da6aed5f6)
</pre>
</div>
</content>
</entry>
<entry>
<title>sym(4): Use memcpy(9) instead of bcopy(9)</title>
<updated>2026-02-05T21:54:06+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2026-01-21T16:47:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b5a7c25c4e19ad57a0b0b23c16ba8523ec60f923'/>
<id>b5a7c25c4e19ad57a0b0b23c16ba8523ec60f923</id>
<content type='text'>
The overlap handling of bcopy(9) is not required in these cases.

Obtained from:	BSD-licensed Linux sym53c8xx driver

(cherry picked from commit c8e9479c74a2af0f6c665e930091c163bf760fd5)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The overlap handling of bcopy(9) is not required in these cases.

Obtained from:	BSD-licensed Linux sym53c8xx driver

(cherry picked from commit c8e9479c74a2af0f6c665e930091c163bf760fd5)
</pre>
</div>
</content>
</entry>
<entry>
<title>sym(4): Consistently use device_printf(9) where applicable</title>
<updated>2026-02-05T21:54:06+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2026-01-21T17:29:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b56ce48c0f7ff675f9a09ef98e13dc2bcdea1ce3'/>
<id>b56ce48c0f7ff675f9a09ef98e13dc2bcdea1ce3</id>
<content type='text'>
(cherry picked from commit 48eee744b540ef0413fa1cb543dde6e49e7f2ac4)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit 48eee744b540ef0413fa1cb543dde6e49e7f2ac4)
</pre>
</div>
</content>
</entry>
<entry>
<title>style(9): white space after ; and around binary operators</title>
<updated>2026-02-05T21:54:06+00:00</updated>
<author>
<name>David E. O'Brien</name>
<email>obrien@FreeBSD.org</email>
</author>
<published>2025-10-15T05:22:00+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b149250d344eed15178ad9a151425426823d5bd1'/>
<id>b149250d344eed15178ad9a151425426823d5bd1</id>
<content type='text'>
in for() loops.  Also, use 'while', where only the
conditional test of 'for' was used.

Reviewed by: sjg

(cherry picked from commit 0050289464fa56ec79e060b8d8378b9ff7145a0e)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
in for() loops.  Also, use 'while', where only the
conditional test of 'for' was used.

Reviewed by: sjg

(cherry picked from commit 0050289464fa56ec79e060b8d8378b9ff7145a0e)
</pre>
</div>
</content>
</entry>
<entry>
<title>sym(4): Add __diagused to nseg of getbaddrcb()</title>
<updated>2023-08-18T14:33:27+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2023-08-18T14:29:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ae6d4963589418f2116ddc8cabcf93dd2f4bbf3b'/>
<id>ae6d4963589418f2116ddc8cabcf93dd2f4bbf3b</id>
<content type='text'>
The parameter is only used when compiling with INVARIANTS.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The parameter is only used when compiling with INVARIANTS.
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:36+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=685dc743dc3b5645e34836464128e1c0558b404b'/>
<id>685dc743dc3b5645e34836464128e1c0558b404b</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>sym: Remove unused devclass argument to DRIVER_MODULE.</title>
<updated>2022-05-06T22:46:56+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2022-05-06T22:46:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c4cacb20f97ca5c1bb4a2b7d31f09b2161800ceb'/>
<id>c4cacb20f97ca5c1bb4a2b7d31f09b2161800ceb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix "set but not used" for the sym driver.</title>
<updated>2021-12-03T22:18:39+00:00</updated>
<author>
<name>Scott Long</name>
<email>scottl@FreeBSD.org</email>
</author>
<published>2021-12-03T22:18:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5045cb8f18f9f79354f93174ba7f9fd2f7ea6994'/>
<id>5045cb8f18f9f79354f93174ba7f9fd2f7ea6994</id>
<content type='text'>
Sponsored by: Rubicon Communications, LLC ("Netgate")
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sponsored by: Rubicon Communications, LLC ("Netgate")
</pre>
</div>
</content>
</entry>
<entry>
<title>sym(4): handle mixed tagged/untagged commands gracefully</title>
<updated>2021-01-21T23:18:39+00:00</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2021-01-21T22:48:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2dcbf0462e17db1b0a8cc99d1f95a7b0ba6437b2'/>
<id>2dcbf0462e17db1b0a8cc99d1f95a7b0ba6437b2</id>
<content type='text'>
Handle the case of a tagged command arriving when there's an untagged
one still outstanding gracefully instead of panicing.

While at it:
- Replace fancy arithmetics with a simple assignment as busy_itl can
  only ever be either 0 or 1.
- Fix a comment typo in sym_free_ccb().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Handle the case of a tagged command arriving when there's an untagged
one still outstanding gracefully instead of panicing.

While at it:
- Replace fancy arithmetics with a simple assignment as busy_itl can
  only ever be either 0 or 1.
- Fix a comment typo in sym_free_ccb().
</pre>
</div>
</content>
</entry>
</feed>
