Project

General

Profile

Bug #2652 » xpt_init_tsleep.diff

davshao, 03/07/2014 03:42 PM

View differences:

sys/bus/cam/cam_xpt.c
sysctl_cam_search_luns, "I",
"allow search above LUN 7 for SCSI3 and greater devices");
static int cam_init_delay = 0;
TUNABLE_INT("kern.cam.init_delay", &cam_init_delay);
SYSCTL_INT(_kern_cam, OID_AUTO, init_delay, CTLFLAG_RDTUN,
&cam_init_delay, 0, "Delay in millisecs in xpt_init");
#define CAM_SCSI2_MAXLUN 8
/*
* If we're not quirked to search <= the first 8 luns
......
struct cam_path *path;
struct cam_devq *devq;
cam_status status;
int sleepch;
TAILQ_INIT(&xsoftc.xpt_busses);
TAILQ_INIT(&cam_simq);
......
if (kthread_create(xpt_scanner_thread, NULL, NULL, "xpt_thrd")) {
kprintf("xpt_init: failed to create rescan thread\n");
}
/* Resolves part of Bug 2652 */
if (0 < (hz * cam_init_delay / 1000)) {
tsleep((void *)&sleepch, PCATCH, "xptdel",
hz * cam_init_delay / 1000);
}
/* Install our software interrupt handlers */
register_swi(SWI_CAMBIO, swi_cambio, NULL, "swi_cambio", NULL, -1);
(2-2/2)