diff --git a/UPDATING b/UPDATING --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,17 @@ world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20251212: + Timeouts for SCSI bus probing have been drastically reduced. They are + now tuneables that can be set in the boot loader should you have a + device that requires a longer-than-standards imply timeout but + none-the-less works. + + kern.cam.tur_timeout (default was 60s, now 1s) + kern.cam.inquiry_timeout (default was 60s, now 1s) + kern.cam.reportluns_timeout (default is 60s) + kern.cam.modesense_timeout (default was 60s, now 1s) + 20251115: The FreeBSD-base repository is now defined in /etc/pkg/FreeBSD.conf, disabled by default. In -CURRENT and -STABLE this points at nightly diff --git a/share/man/man4/scsi.4 b/share/man/man4/scsi.4 --- a/share/man/man4/scsi.4 +++ b/share/man/man4/scsi.4 @@ -22,7 +22,7 @@ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. -.Dd December 11, 2023 +.Dd December 11, 2025 .Dt CAM 4 .Os .Sh NAME @@ -69,6 +69,38 @@ The .Xr pass 4 driver, if it is configured in the kernel, will attach to all devices. +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width 12 +.It Va kern.cam.cam_srch_hi +Search above LUN 7 for SCSI3 and greater devices. +.It Va kern.cam.tur_timeout +Timeout, in ms, for the initial TESTUNITREADY command we send to the devices +during their initial probing. +Defaults to 1s. +.Fx 15 +and earlier set this to 60s. +.It Va kern.cam.inquiry_timeout +Timeout, in ms, for the initial INQUIRY command we send to the devices +during their initial probing. +Defaults to 1s. +.Fx 15 +and earlier set this to 60s. +.It Va kern.cam.reportluns_timeout +Timeout, in ms, for the initial REPORTLUNS command we send to the devices +during their initial probing. +Defaults to 50s. +.It Va kern.cam.modesense_timeout +Timeout, in ms, for the initial MODESENSE command we send to the devices +during their initial probing. +Defaults to 1s. +.Fx 15 +and earlier set this to 60s. +.El .Sh KERNEL CONFIGURATION There are a number of generic kernel configuration options for the .Nm diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -78,6 +78,22 @@ SYSCTL_INT(_kern_cam, OID_AUTO, cam_srch_hi, CTLFLAG_RWTUN, &cam_srch_hi, 0, "Search above LUN 7 for SCSI3 and greater devices"); +static int tur_timeout = 1000; /* 1s now, 60s before */ +SYSCTL_INT(_kern_cam, OID_AUTO, tur_timeout, CTLFLAG_RWTUN, + &tur_timeout, 0, "TESTUNITREADY timeout on probing"); + +static int inquiry_timeout = 1000; /* 1s now, 60s before */ +SYSCTL_INT(_kern_cam, OID_AUTO, inquiry_timeout, CTLFLAG_RWTUN, + &inquiry_timeout, 0, "INQUIRY timeout on probing"); + +static int reportluns_timeout = 60000; /* 60s */ +SYSCTL_INT(_kern_cam, OID_AUTO, reportluns_timeout, CTLFLAG_RWTUN, + &reportluns_timeout, 0, "REPORTLUNS timeout on probing"); + +static int modesense_timeout = 1000; /* 1s now, 60s */ +SYSCTL_INT(_kern_cam, OID_AUTO, modesense_timeout, CTLFLAG_RWTUN, + &modesense_timeout, 0, "MODESENSE timeout on probing"); + #define CAM_SCSI2_MAXLUN 8 #define CAM_CAN_GET_SIMPLE_LUN(x, i) \ ((((x)->luns[i].lundata[0] & RPL_LUNDATA_ATYP_MASK) == \ @@ -760,7 +776,7 @@ probedone, MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, - /*timeout*/60000); + /*timeout*/tur_timeout); break; } case PROBE_INQUIRY: @@ -816,7 +832,7 @@ /*evpd*/FALSE, /*page_code*/0, SSD_MIN_SIZE, - /*timeout*/60 * 1000); + /*timeout*/inquiry_timeout); break; } case PROBE_REPORT_WLUNS: @@ -856,7 +872,7 @@ } scsi_report_luns(csio, 5, probedone, MSG_SIMPLE_Q_TAG, RPL_REPORT_DEFAULT, rp, periph->path->target->rpl_size, - SSD_FULL_SIZE, 60000); + SSD_FULL_SIZE, reportluns_timeout); break; } case PROBE_MODE_SENSE: @@ -879,7 +895,7 @@ mode_buf, mode_buf_len, SSD_FULL_SIZE, - /*timeout*/60000); + /*timeout*/modesense_timeout); break; } xpt_print(periph->path, @@ -1026,7 +1042,7 @@ probedone, MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, - /*timeout*/60000); + /*timeout*/tur_timeout); break; } @@ -1039,7 +1055,7 @@ /*evpd*/FALSE, /*page_code*/0, SSD_MIN_SIZE, - /*timeout*/60 * 1000); + /*timeout*/inquiry_timeout); break; } default: