History log of /freebsd/sys/cam/cam_periph.c (Results 1 – 25 of 411)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 5e5e4e1c 02-Nov-2024 Warner Losh <imp@FreeBSD.org>

cam: report sct/sc in that order

This should have no effect on scripting, but when reading it, sct/sc is
the natural order of things (and the order we print them in
elsewhere). Report them in that o

cam: report sct/sc in that order

This should have no effect on scripting, but when reading it, sct/sc is
the natural order of things (and the order we print them in
elsewhere). Report them in that order.

Sponsored by: Netflix

show more ...


Revision tags: release/13.4.0
# d37286b9 29-Jul-2024 Mark Johnston <markj@FreeBSD.org>

proc: Remove kernel stack swapping support, part 7

Remove some uses of PHOLD which were there only to prevent the process'
threads from being swapped out.

Tested by: pho
Reviewed by: imp, kib
Diffe

proc: Remove kernel stack swapping support, part 7

Remove some uses of PHOLD which were there only to prevent the process'
threads from being swapped out.

Tested by: pho
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D46118

show more ...


# 4eee292a 25-Jul-2024 Warner Losh <imp@FreeBSD.org>

Revert "cam: better ioctl compatibility for cd"

This reverts commit 028b16e2088a682c1abfb74fa5eb7ff64405ffff.

The wrong version wound up in my branch, revert while I find the right
version.

Sponso

Revert "cam: better ioctl compatibility for cd"

This reverts commit 028b16e2088a682c1abfb74fa5eb7ff64405ffff.

The wrong version wound up in my branch, revert while I find the right
version.

Sponsored by: Netflix

show more ...


# 028b16e2 25-Jul-2024 Warner Losh <imp@FreeBSD.org>

cam: better ioctl compatibility for cd

Unlike xpt and pass driver, there's no test for ENOTTY in cdioctl to try
the compatbility ioctls. Add one.

However, this is a disk ioctl, not a cdev ioctl. To

cam: better ioctl compatibility for cd

Unlike xpt and pass driver, there's no test for ENOTTY in cdioctl to try
the compatbility ioctls. Add one.

However, this is a disk ioctl, not a cdev ioctl. To get around this, we
cast the struct disk * to a struct cdev * to pass through. We cast it
back in a simple wrapper function.

PR: 198336
Sponsored by: Netflix
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D42666
Differential Revision: https://reviews.freebsd.org/D35312

show more ...


Revision tags: release/14.1.0, release/13.3.0
# d068ea16 28-Dec-2023 Mark Johnston <markj@FreeBSD.org>

cam: Let cam_periph_unmapmem() return an error

As of commit b059686a71c8, cam_periph_unmapmem() can legitimately fail
if the copyout() operation fails. However, this failure was never
signaled to u

cam: Let cam_periph_unmapmem() return an error

As of commit b059686a71c8, cam_periph_unmapmem() can legitimately fail
if the copyout() operation fails. However, this failure was never
signaled to upper layers. In practice it is unlikely to occur
since cap_periph_mapmem() would most likely fail in such
circumstances anyway, but an error is nonetheless possible.

However, some code reading revealed a few paths where the return value
of cam_periph_mapmem() is not checked, and this is definitely a bug.
Add error checking there and let cam_periph_unmapmem() return errors
from copyout().

Reviewed by: dab, mav
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43201

show more ...


# 519b24f0 23-Nov-2023 Alexander Motin <mav@FreeBSD.org>

CAM: Replace random sbuf_printf() with cheaper cat/putc.


Revision tags: release/14.0.0
# 2ffd30f7 06-Nov-2023 Warner Losh <imp@FreeBSD.org>

cam: Remove left-over sys/cdefs.h in sys/cam

These weren't removed when $FreeBSD$ was removed. They aren't needed and
now are a style(9) nonconformity.

Sponsored by: Netflix


# 500196c5 06-Nov-2023 Warner Losh <imp@FreeBSD.org>

cam: Add nvme error devctl publishing

Start reporting nvme errors from devices, like we report ata and scsi
errors.

Sponsored by: Netflix
Reviewed by: mav, jhb
Differential Revision: https://revi

cam: Add nvme error devctl publishing

Start reporting nvme errors from devices, like we report ata and scsi
errors.

Sponsored by: Netflix
Reviewed by: mav, jhb
Differential Revision: https://reviews.freebsd.org/D41086

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# cf0a543f 01-Aug-2023 Warner Losh <imp@FreeBSD.org>

cam: Log more error codes

Log CAM_DEV_NOT_THERE status CCBs because they get dropped if a drive
disappears and these requests timeout or are cancelled. It's useful to
know the outstanding commands f

cam: Log more error codes

Log CAM_DEV_NOT_THERE status CCBs because they get dropped if a drive
disappears and these requests timeout or are cancelled. It's useful to
know the outstanding commands for failure analysis. Log
CAM_NVME_STATUS_ERROR status CCBs to bring in NVMe errors (this will be
more important in future commits that expand the information logged).

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D41168

show more ...


# 7af2f2c8 25-Jul-2023 Warner Losh <imp@FreeBSD.org>

cam: Migrate to modern uintXX_t from u_intXX_t

As per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.html
move to the modern uintXX_t.

MFC After: 3 days
Sponsored by: Netflix


# ff4633d9 21-Jul-2023 Warner Losh <imp@FreeBSD.org>

cam_periph: Comment about why we need to reset cbfcnp

Just spent a few minutes puzzling out why we do this. Add a comment to
remind my future self (and other intersted folk) why we do the reset
here

cam_periph: Comment about why we need to reset cbfcnp

Just spent a few minutes puzzling out why we do this. Add a comment to
remind my future self (and other intersted folk) why we do the reset
here when we'd set it a few lines above.

Sponsored by: Netflix

show more ...


# b4993704 21-Jul-2023 Warner Losh <imp@FreeBSD.org>

cam_periph: Fix a comment

Add a couple of words so that this sentence makes sense.

Sponsored by: Netflix


# 774ab87c 21-Jul-2023 Warner Losh <imp@FreeBSD.org>

cam: Add CAM_NVME_STATUS_ERROR error code

Add CAM_NVME_STATUS_ERROR error code. Flag all NVME commands that
completed with an error status as CAM_NVME_STATUS_ERROR (a new value)
instaead of CAM_REQ_

cam: Add CAM_NVME_STATUS_ERROR error code

Add CAM_NVME_STATUS_ERROR error code. Flag all NVME commands that
completed with an error status as CAM_NVME_STATUS_ERROR (a new value)
instaead of CAM_REQ_CMP_ERR. This indicates to the upper layers of CAM
that the 'cpl' field for nvmeio CCBs is valid and can be examined for
error recovery, if desired.

No functional change. nda will still see these as errors, call
ndaerror() to get the error recovery action, etc. cam_periph_error will
select the same case as before (even w/o the change, though the change
makes it explicit).

Sponsored by: Netflix
Reviewed by: chuck, mav, jhb
Differential Revision: https://reviews.freebsd.org/D41085

show more ...


# 33734ddf 21-Jul-2023 Warner Losh <imp@FreeBSD.org>

cam: Be explict about CAM_SMP_STATUS_ERROR

This is normally caught by default:, but no harm in making it explicit
that we'll retry valid periphs.

Sponsored by: Netflix
Reviewed by: mav
Differenti

cam: Be explict about CAM_SMP_STATUS_ERROR

This is normally caught by default:, but no harm in making it explicit
that we'll retry valid periphs.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D41083

show more ...


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


Revision tags: release/13.2.0, release/12.4.0
# 0cd631ee 29-Sep-2022 Mark Johnston <markj@FreeBSD.org>

cam: Provide compatibility for CAMGETPASSTHRU for periph drivers

The CAM version bump 0x19 -> 0x1a changed the CAMGETPASSTHRU definition,
so applications using the old ioctl are broken. However, th

cam: Provide compatibility for CAMGETPASSTHRU for periph drivers

The CAM version bump 0x19 -> 0x1a changed the CAMGETPASSTHRU definition,
so applications using the old ioctl are broken. However, that version
change did not affect anything relating to the ioctl implementation for
periphs.

Fixes: 8f9be1eed11c ("cam(4): Improve XPT_DEV_MATCH")
PR: 264709
Tested by: andreas.mahling@googlemail.com
Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36389

show more ...


# 90bcc81b 14-Jul-2022 Alexander Motin <mav@FreeBSD.org>

Delay GEOM disk_create() until CAM periph probe completes.

Before this patch CAM periph drivers called both disk_alloc() and
disk_create() same time on periph creation. But then prevented disks
fro

Delay GEOM disk_create() until CAM periph probe completes.

Before this patch CAM periph drivers called both disk_alloc() and
disk_create() same time on periph creation. But then prevented disks
from opening until the periph probe completion with cam_periph_hold().
As result, especially if disk misbehaves during the probe, GEOM event
thread, triggered to taste the disk, got blocked on open attempt,
potentially for a long time, unable to process other events.

This patch moves disk_create() call from periph creation to the end of
the probe. To allow disk_create() calls from non-sleepable CAM contexts
some of its duties requiring memory allocations are moved either back
to disk_alloc() or forward to g_disk_create(), so now disk_alloc() and
disk_add_alias() are the only disk methods that require sleeping. If
disk fails during the probe disk_create() may just be skipped, going
directly to disk_destroy(). Other method calls during that time are
just ignored. Since GEOM may now see the disks after CAM bus scan is
already completed, introduce per-periph boot hold functions. Enclosure
driver already had such mechanism, so just generalize it.

Reviewed by: imp
MFC after: 1 month
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D35784

show more ...


Revision tags: release/13.1.0
# 9fb40baf 29-Apr-2022 Warner Losh <imp@FreeBSD.org>

cam_periph: Return ENXIO when peripheral is invalidated

When the peripheral is invalidated, no further I/O is possible. Signal
this up the stack with ENXIO now that upper layers of the stack
differe

cam_periph: Return ENXIO when peripheral is invalidated

When the peripheral is invalidated, no further I/O is possible. Signal
this up the stack with ENXIO now that upper layers of the stack
differentiate sometimes. In order for there to be further I/O, and new
open is required for any block device that a future periph might
instantiate for devices at this location that might return or otherwise
become available. The I/O scheduler flushes its I/O with the ENXIO error
for pending I/O that didn't make it to the device, so this makes the two
paths match.

MFC After: 3 days
Sponsored by: Netflix
Reviewed by: chs, mav
Differential Revision: https://reviews.freebsd.org/D35093

show more ...


# 404f0011 28-Apr-2022 Alexander Motin <mav@FreeBSD.org>

CAM: Keep periph_links when restoring CCB in camperiphdone().

While recovery command executed, some other commands from the periph
may complete, that may affect periph_links of this CCB. So restori

CAM: Keep periph_links when restoring CCB in camperiphdone().

While recovery command executed, some other commands from the periph
may complete, that may affect periph_links of this CCB. So restoring
original CCB we must keep current periph_links as more up to date.

I've found this triggering assertions with debug kernel and suspect
some memory corruptions otherwise when spun down disk receives two
or sometimes more concurrent requests.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

show more ...


# 272e4f53 13-Jan-2022 Warner Losh <imp@FreeBSD.org>

cam: Fix wiring fence post error

If the last matching device entry partially matched in camperiphunit,
but then hit a continue case, we'd mistakenly think we had a match on
that entry. This lead to

cam: Fix wiring fence post error

If the last matching device entry partially matched in camperiphunit,
but then hit a continue case, we'd mistakenly think we had a match on
that entry. This lead to a number of problems downstream (usually a
belief that we had a duplicate wiring hint because unit = 0 is the
default). Fix this by using a for loop that does the assignment before
the loop termination test.

Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D33873

show more ...


Revision tags: release/12.3.0
# 3846662d 30-Nov-2021 Warner Losh <imp@FreeBSD.org>

cam: Initialize wired to false

As part of converting the code to a while loop, the unconditional
initialization of wired to false was lost.

Sponsored by: Netflix
Differential Revision: https://rev

cam: Initialize wired to false

As part of converting the code to a while loop, the unconditional
initialization of wired to false was lost.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D33163

show more ...


# d836c48e 05-Nov-2021 Warner Losh <imp@FreeBSD.org>

cam_periph: wired is really a bool, update it to a bool.

Sponsored by: Netflix
Reviewed by: scottl
Differential Revision: https://reviews.freebsd.org/D32823


# 577f9aa2 05-Nov-2021 Warner Losh <imp@FreeBSD.org>

cam_periph: Add ability to wire units to a serial number

For scsi, ata and nvme, at least, we read a serial number from the
device (if the device supports it, some scsi drives do not) and record
it

cam_periph: Add ability to wire units to a serial number

For scsi, ata and nvme, at least, we read a serial number from the
device (if the device supports it, some scsi drives do not) and record
it during the *_xpt probe device state machine before it posts the
AC_FOUND_DEVICE async event. For mmc, no serial number is ever
retrieved, so it's always NULL. Add the ability to match this serial
number during device wiring.

This mechanism is competely optional, and often times using a label
and/or some other attribute of the device is easier. However, other
times wiring a unit to a serial number simplifies management as most
monitoring tools require the *daX device and having it stable from boot
to boot helps with data continuity. It can be especially helpful for
nvme where no other means exists to reliably tie a ndaX device to an
underlying nvme drive and namespace.

A similar mechanism exists in Linux to mange device unit numbers with
udev.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D32683

show more ...


# 710a519e 05-Nov-2021 Warner Losh <imp@FreeBSD.org>

cam_periph: fix bug in camperiphunitnext logic

If we assigned just a lun as a wired unit (something that camperiphunit
will accept), we failed to properly skip over that unit when computing a
next u

cam_periph: fix bug in camperiphunitnext logic

If we assigned just a lun as a wired unit (something that camperiphunit
will accept), we failed to properly skip over that unit when computing a
next unit number. Add lun so the code matches the comments that we have
to skip all the same criteria that camperiphunit uses to select wired
units for a driver.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D32682

show more ...


12345678910>>...17