90bcc81bc3
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 |
||
---|---|---|
.. | ||
scsi_all.c | ||
scsi_all.h | ||
scsi_cd.c | ||
scsi_cd.h | ||
scsi_ch.c | ||
scsi_ch.h | ||
scsi_da.c | ||
scsi_da.h | ||
scsi_enc_internal.h | ||
scsi_enc_safte.c | ||
scsi_enc_ses.c | ||
scsi_enc.c | ||
scsi_enc.h | ||
scsi_iu.h | ||
scsi_message.h | ||
scsi_pass.c | ||
scsi_pass.h | ||
scsi_pt.c | ||
scsi_pt.h | ||
scsi_sa.c | ||
scsi_sa.h | ||
scsi_ses.h | ||
scsi_sg.c | ||
scsi_sg.h | ||
scsi_targ_bh.c | ||
scsi_target.c | ||
scsi_targetio.h | ||
scsi_xpt.c | ||
smp_all.c | ||
smp_all.h |