Add disk_destroy() call to detach processing.
Add short tempered TUR to cdsize() as a workaround.
This commit is contained in:
parent
892a2cd235
commit
74674b8ed8
@ -496,6 +496,7 @@ cdcleanup(struct cam_periph *periph)
|
||||
free(softc->changer, M_DEVBUF);
|
||||
num_changers--;
|
||||
}
|
||||
disk_destroy(&softc->disk);
|
||||
free(softc, M_DEVBUF);
|
||||
splx(s);
|
||||
}
|
||||
@ -2852,6 +2853,20 @@ cdsize(struct cam_periph *periph, u_int32_t *size)
|
||||
|
||||
ccb = cdgetccb(periph, /* priority */ 1);
|
||||
|
||||
scsi_test_unit_ready(&ccb->csio, 0, cddone,
|
||||
MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, 1000);
|
||||
ccb->ccb_h.ccb_bp = NULL;
|
||||
|
||||
error = cam_periph_runccb(ccb, NULL,
|
||||
/*cam_flags*/0,
|
||||
/*sense_flags*/SF_RETRY_UA,
|
||||
softc->disk.d_devstat);
|
||||
|
||||
if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
|
||||
xpt_release_ccb(ccb);
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
rcap_buf = malloc(sizeof(struct scsi_read_capacity_data),
|
||||
M_TEMP, M_WAITOK);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user