<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/cam, branch releng/15.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>nda: fix setting of unmappedio flag</title>
<updated>2025-11-25T23:41:38+00:00</updated>
<author>
<name>Chuck Silvers</name>
<email>chs@FreeBSD.org</email>
</author>
<published>2025-11-25T22:30:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4f2d5bcdbf9bb9ecdee48d47c1c33a461f3f54e4'/>
<id>4f2d5bcdbf9bb9ecdee48d47c1c33a461f3f54e4</id>
<content type='text'>
The upstream refactoring of ndaregister() to split out ndasetgeom()
accidentally used an uninitialed variable to decide whether or not
to set DISKFLAG_UNMAPPED_BIO.  Fix this by moving that portion of
ndasetgeom() back up to ndaregister().  The check for PIM_UNMAPPED
is not really needed because nvme devices always have that set,
so it cannot change in the other path that ndasetgeom() is now called.

Approved by:	re (cperciva)
Reviewed by:	cperciva, gallatin, imp
Fixes:		dffd882d12d2a71aca464f48209ec9ae6f393b15
Sponsored by:	Netflix
MFC After:	1 minute
(cherry picked from commit 2b4dbad2db5766294ee97bb96228ec6826a9e7c3)
(cherry picked from commit e271f9327f46250c9043c29c86e943d53080bf2a)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The upstream refactoring of ndaregister() to split out ndasetgeom()
accidentally used an uninitialed variable to decide whether or not
to set DISKFLAG_UNMAPPED_BIO.  Fix this by moving that portion of
ndasetgeom() back up to ndaregister().  The check for PIM_UNMAPPED
is not really needed because nvme devices always have that set,
so it cannot change in the other path that ndasetgeom() is now called.

Approved by:	re (cperciva)
Reviewed by:	cperciva, gallatin, imp
Fixes:		dffd882d12d2a71aca464f48209ec9ae6f393b15
Sponsored by:	Netflix
MFC After:	1 minute
(cherry picked from commit 2b4dbad2db5766294ee97bb96228ec6826a9e7c3)
(cherry picked from commit e271f9327f46250c9043c29c86e943d53080bf2a)
</pre>
</div>
</content>
</entry>
<entry>
<title>nda: React to namespace change events</title>
<updated>2025-11-19T21:37:15+00:00</updated>
<author>
<name>Wanpeng Qian</name>
<email>wanpengqian@gmail.com</email>
</author>
<published>2025-11-18T15:24:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ecfb0e51b21259a679519d666dbdb52e9b18c539'/>
<id>ecfb0e51b21259a679519d666dbdb52e9b18c539</id>
<content type='text'>
Register for AC_GETDEV_CHANGED. When we receive a namespace
notification, we only create a new device if it was unconfigured. If it
was configured, generate this async event. Rely on the fact that we
reconstruct namespace to just get the data from the identify data and
call disk_resised.

Approved by:	re (cperciva)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032

(cherry picked from commit 86d3ec359a56d1b5d015718bd19ef4bda681a032)
(cherry picked from commit 9a465b37ea17642d45597d4ee7d3283b02dfa6f0)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Register for AC_GETDEV_CHANGED. When we receive a namespace
notification, we only create a new device if it was unconfigured. If it
was configured, generate this async event. Rely on the fact that we
reconstruct namespace to just get the data from the identify data and
call disk_resised.

Approved by:	re (cperciva)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032

(cherry picked from commit 86d3ec359a56d1b5d015718bd19ef4bda681a032)
(cherry picked from commit 9a465b37ea17642d45597d4ee7d3283b02dfa6f0)
</pre>
</div>
</content>
</entry>
<entry>
<title>nvme: Refactor geom setting to function.</title>
<updated>2025-11-19T21:37:12+00:00</updated>
<author>
<name>Wanpeng Qian</name>
<email>wanpengqian@gmail.com</email>
</author>
<published>2025-11-18T15:24:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=0ccc71de62848366446a86487d36983146609605'/>
<id>0ccc71de62848366446a86487d36983146609605</id>
<content type='text'>
Refactor setting of geometry for the disk to its own function. No
functional changes.

Approved by:	re (cperciva)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032

(cherry picked from commit dffd882d12d2a71aca464f48209ec9ae6f393b15)
(cherry picked from commit 31412fda9fa71d85a19604151d662ac65c301c2a)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refactor setting of geometry for the disk to its own function. No
functional changes.

Approved by:	re (cperciva)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032

(cherry picked from commit dffd882d12d2a71aca464f48209ec9ae6f393b15)
(cherry picked from commit 31412fda9fa71d85a19604151d662ac65c301c2a)
</pre>
</div>
</content>
</entry>
<entry>
<title>cam: Bump deprecated sysctl removal to 16</title>
<updated>2025-10-30T04:22:50+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2025-10-24T19:36:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=901603ae6b1b6dcebd5183d22a77b5495fda1936'/>
<id>901603ae6b1b6dcebd5183d22a77b5495fda1936</id>
<content type='text'>
The descriptions for these unmapped_io and rotating sysctls indicated
that they're deprecated and being removed for FreeBSD 15.0.  That did
not happen, so update to FreeBSD 16 instead.

Approved by:	re (cperciva)
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e93db9abc9a62d662c40d783663d64cdb829a0cc)
(cherry picked from commit 469ab88d107c05ab533a15d4014d1a97b5a13c86)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The descriptions for these unmapped_io and rotating sysctls indicated
that they're deprecated and being removed for FreeBSD 15.0.  That did
not happen, so update to FreeBSD 16 instead.

Approved by:	re (cperciva)
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e93db9abc9a62d662c40d783663d64cdb829a0cc)
(cherry picked from commit 469ab88d107c05ab533a15d4014d1a97b5a13c86)
</pre>
</div>
</content>
</entry>
<entry>
<title>cam(3): Fix a common typo in source code comments</title>
<updated>2025-08-25T08:35:01+00:00</updated>
<author>
<name>Gordon Bergling</name>
<email>gbe@FreeBSD.org</email>
</author>
<published>2025-08-25T08:35:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=90d7186379b08e5fb0f3d146a2e82a4fa8d9c9b8'/>
<id>90d7186379b08e5fb0f3d146a2e82a4fa8d9c9b8</id>
<content type='text'>
- s/tranferred/transferred/

MFC after:	3 days
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- s/tranferred/transferred/

MFC after:	3 days
</pre>
</div>
</content>
</entry>
<entry>
<title>cam: Enforce real priorities in xpt_action for queued ccbs.</title>
<updated>2025-07-22T04:00:53+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2025-07-22T03:52:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b4b166b8c46b86df855f1621d2aa4b6ab26b3a5e'/>
<id>b4b166b8c46b86df855f1621d2aa4b6ab26b3a5e</id>
<content type='text'>
All queued CCBs should be created with a real priority (one that's not
CAM_PRIORITY_NONE). Recently, I introduced a bug that revealed a latent
MMC bug where it would stop enumerating due to a bad priority. Add an
assert to catch that (the other bug in mmc_da that it found has been
fixed).

Sponsored by:		Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All queued CCBs should be created with a real priority (one that's not
CAM_PRIORITY_NONE). Recently, I introduced a bug that revealed a latent
MMC bug where it would stop enumerating due to a bad priority. Add an
assert to catch that (the other bug in mmc_da that it found has been
fixed).

Sponsored by:		Netflix
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc_da: Queued CCBs need a priority other than CAM_PRIORITY_NONE</title>
<updated>2025-07-22T04:00:53+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2025-07-22T03:38:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7cbf41ef60227f2a4eaf01f600fc894ef0d50323'/>
<id>7cbf41ef60227f2a4eaf01f600fc894ef0d50323</id>
<content type='text'>
Queued CCBs usually are queued at CAM_PRIORITY_NORMAL, unless they are
doing error recovery, or device enumeration of some kind. They should
never be queued at CAM_PRIORITY_NONE, which should only be used for CCBs
that are immediate. For sdda_start_init_task(), we allocate a ccb,
initialize it then use it to talk to the SD/MMC card to query it,
negotiate the speed and lane sizes, etc. Most of these commands are
queued, so use the normal priority.

Sponsored by:		Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Queued CCBs usually are queued at CAM_PRIORITY_NORMAL, unless they are
doing error recovery, or device enumeration of some kind. They should
never be queued at CAM_PRIORITY_NONE, which should only be used for CCBs
that are immediate. For sdda_start_init_task(), we allocate a ccb,
initialize it then use it to talk to the SD/MMC card to query it,
negotiate the speed and lane sizes, etc. Most of these commands are
queued, so use the normal priority.

Sponsored by:		Netflix
</pre>
</div>
</content>
</entry>
<entry>
<title>cam/mmc: Remove stray xpt_path_inq</title>
<updated>2025-07-22T04:00:53+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2025-07-22T02:50:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=73e1bd71427794ee5496fdeb2bdaa04b05b0c35b'/>
<id>73e1bd71427794ee5496fdeb2bdaa04b05b0c35b</id>
<content type='text'>
Turns out, we don't use the results of xpt_path_inq here at all. And it
also causes problems. Since it calls xpt_cam_inq to do this useless
XPT_PATH_INQ, it loses the original priority we had for the CCB. This
priority should be CAM_PRIORITY_XPT, but was oringially set to
CAM_PRIORITY_NORMAL. This worked to enumerate the device because no
normal priority CCBs were queued by anything doing the
enumeration. However, when I changed xpt_path_inq to use the more proper
PRIORITY_NONE, it exposed this bug because queued CCBs with
PRIORITY_NONE sometimes won't run. This caused the probe device to stop
after its first operation. Removing the xpt_path_inq means we no longer
step on the important fields we get from xpt_schedule, allowing probing
to work correctly.

Noticed by: bz@
Sponsored by: Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Turns out, we don't use the results of xpt_path_inq here at all. And it
also causes problems. Since it calls xpt_cam_inq to do this useless
XPT_PATH_INQ, it loses the original priority we had for the CCB. This
priority should be CAM_PRIORITY_XPT, but was oringially set to
CAM_PRIORITY_NORMAL. This worked to enumerate the device because no
normal priority CCBs were queued by anything doing the
enumeration. However, when I changed xpt_path_inq to use the more proper
PRIORITY_NONE, it exposed this bug because queued CCBs with
PRIORITY_NONE sometimes won't run. This caused the probe device to stop
after its first operation. Removing the xpt_path_inq means we no longer
step on the important fields we get from xpt_schedule, allowing probing
to work correctly.

Noticed by: bz@
Sponsored by: Netflix
</pre>
</div>
</content>
</entry>
<entry>
<title>cam/xpt: style(9) no longer recommends blank lines</title>
<updated>2025-07-10T23:03:41+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2025-07-10T23:03:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=74b5dc9f3fcd9eff142c0212dd738c676effdd4b'/>
<id>74b5dc9f3fcd9eff142c0212dd738c676effdd4b</id>
<content type='text'>
The new xpt_gdev_type() function shouldn't have had a blank line. It was
copied from xpt_path_inq(). Remove it from both.

Noticed by: jhb
Sponsored by: Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new xpt_gdev_type() function shouldn't have had a blank line. It was
copied from xpt_path_inq(). Remove it from both.

Noticed by: jhb
Sponsored by: Netflix
</pre>
</div>
</content>
</entry>
<entry>
<title>cam: Fail the disk if READ CAPACITY returns 4/2 asc/ascq</title>
<updated>2025-07-10T16:17:01+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2025-07-10T15:56:26+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d78d04b17cb2498186e8fd2681f224a760e75b28'/>
<id>d78d04b17cb2498186e8fd2681f224a760e75b28</id>
<content type='text'>
HGST disks that are sick are returning 44/0 for START UNIT (which we
ignore) and then 4/2 on READ CAPACITY. START UNIT should be enough for
READ CAPACITY to succeed or UNIT ATTENTION. However, we get NOT_READ +
4/2 back. I've seen this on several models of HGST drives. Invalidate
the peripheral when we detect this condition. This is likely the least
bad thing we can do: It removes access to daX, but leaves passY so logs
may be extracted (if awkwardly). Removing daX access removes the disk
device that causes problems to geom outlined below.

Although the timeout is 5s for READ_CAPACITY, we wait the full 30s for
READ_CAPACITY_16. This causes us to stall booting as we start to taste
as soon as we release the final hold... but the tasting means
g_wait_idle() takes now takes over 5 minutes to clear since we do this
for all the opens. Even using a timeout of 3s instead of 30s leads to
boot times of almost 5 minutes in these cases, so there are other,
downstream operations that are taking a while, so it's not just a matter
of adjusting the timeout. Failing the periph early solves the bulk of
this problem (the tasting related delays). What the HBA does is HBA
specific and some have firmwares that are also confused by this when
they enumerate or discover the drive, leading to long (but still shorter
than 5 minute) delays. This patch won't solve that aspect of startup
delays with sick disks.

Perhaps we should fail the periph when START UNIT fails with the same
codes we check in the read capacity path. I'm reluctant to do such a
global change since it's in cam_periph, and there seems no good way to
flag that we want this behavior. It's also a bit magical when it runs
(some drive report 44/0 always, and some just report it on START UNIT,
and these HGST drive fall into the latter category).

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D51218
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
HGST disks that are sick are returning 44/0 for START UNIT (which we
ignore) and then 4/2 on READ CAPACITY. START UNIT should be enough for
READ CAPACITY to succeed or UNIT ATTENTION. However, we get NOT_READ +
4/2 back. I've seen this on several models of HGST drives. Invalidate
the peripheral when we detect this condition. This is likely the least
bad thing we can do: It removes access to daX, but leaves passY so logs
may be extracted (if awkwardly). Removing daX access removes the disk
device that causes problems to geom outlined below.

Although the timeout is 5s for READ_CAPACITY, we wait the full 30s for
READ_CAPACITY_16. This causes us to stall booting as we start to taste
as soon as we release the final hold... but the tasting means
g_wait_idle() takes now takes over 5 minutes to clear since we do this
for all the opens. Even using a timeout of 3s instead of 30s leads to
boot times of almost 5 minutes in these cases, so there are other,
downstream operations that are taking a while, so it's not just a matter
of adjusting the timeout. Failing the periph early solves the bulk of
this problem (the tasting related delays). What the HBA does is HBA
specific and some have firmwares that are also confused by this when
they enumerate or discover the drive, leading to long (but still shorter
than 5 minute) delays. This patch won't solve that aspect of startup
delays with sick disks.

Perhaps we should fail the periph when START UNIT fails with the same
codes we check in the read capacity path. I'm reluctant to do such a
global change since it's in cam_periph, and there seems no good way to
flag that we want this behavior. It's also a bit magical when it runs
(some drive report 44/0 always, and some just report it on START UNIT,
and these HGST drive fall into the latter category).

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D51218
</pre>
</div>
</content>
</entry>
</feed>
