xpt_init_tsleep.diff

davshao, 03/07/2014 03:42 PM

Download (1.26 KB)

View differences:

sys/bus/cam/cam_xpt.c
226 226
    sysctl_cam_search_luns, "I",
227 227
    "allow search above LUN 7 for SCSI3 and greater devices");
228 228

  
229
static int cam_init_delay = 0;
230
TUNABLE_INT("kern.cam.init_delay", &cam_init_delay);
231
SYSCTL_INT(_kern_cam, OID_AUTO, init_delay, CTLFLAG_RDTUN,
232
    &cam_init_delay, 0, "Delay in millisecs in xpt_init");
233

  
229 234
#define	CAM_SCSI2_MAXLUN	8
230 235
/*
231 236
 * If we're not quirked to search <= the first 8 luns
......
1445 1450
	struct cam_path *path;
1446 1451
	struct cam_devq *devq;
1447 1452
	cam_status status;
1453
	int sleepch;
1448 1454

  
1449 1455
	TAILQ_INIT(&xsoftc.xpt_busses);
1450 1456
	TAILQ_INIT(&cam_simq);
......
1534 1540
	if (kthread_create(xpt_scanner_thread, NULL, NULL, "xpt_thrd")) {
1535 1541
		kprintf("xpt_init: failed to create rescan thread\n");
1536 1542
	}
1543

  
1544
	/* Resolves part of Bug 2652 */
1545
	if (0 < (hz * cam_init_delay / 1000)) {
1546
		tsleep((void *)&sleepch, PCATCH, "xptdel",
1547
			hz * cam_init_delay / 1000);
1548
	}
1549

  
1537 1550
	/* Install our software interrupt handlers */
1538 1551
	register_swi(SWI_CAMBIO, swi_cambio, NULL, "swi_cambio", NULL, -1);
1539 1552