diff options
author | mav <mav@FreeBSD.org> | 2015-08-15 11:05:44 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-08-15 11:05:44 +0000 |
commit | 6807bfb720c16e3f61bbbfc05b290b7c0477e93e (patch) | |
tree | ead7f03e56d642a78606988bf4094d0a5a9dc594 /sys/cam/ata | |
parent | 5264296ce4d030299be506070bbd16d92a398ba0 (diff) | |
download | FreeBSD-src-6807bfb720c16e3f61bbbfc05b290b7c0477e93e.zip FreeBSD-src-6807bfb720c16e3f61bbbfc05b290b7c0477e93e.tar.gz |
MFC r286447:
Don't panic if disk lost TRIM support due to switching to PIO mode.
Diffstat (limited to 'sys/cam/ata')
-rw-r--r-- | sys/cam/ata/ata_da.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index 71b1153..925dba9 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -760,10 +760,6 @@ adastrategy(struct bio *bp) * Place it in the queue of disk activities for this disk */ if (bp->bio_cmd == BIO_DELETE) { - KASSERT((softc->flags & ADA_FLAG_CAN_TRIM) || - ((softc->flags & ADA_FLAG_CAN_CFA) && - !(softc->flags & ADA_FLAG_CAN_48BIT)), - ("BIO_DELETE but no supported TRIM method.")); bioq_disksort(&softc->trim_queue, bp); } else { if (ADA_SIO) @@ -1537,7 +1533,14 @@ adastart(struct cam_periph *periph, union ccb *start_ccb) !(softc->flags & ADA_FLAG_CAN_48BIT)) { ada_cfaerase(softc, bp, ataio); } else { - panic("adastart: BIO_DELETE without method, not possible."); + /* This can happen if DMA was disabled. */ + bioq_remove(&softc->trim_queue, bp); + bp->bio_error = EOPNOTSUPP; + bp->bio_flags |= BIO_ERROR; + biodone(bp); + xpt_release_ccb(start_ccb); + adaschedule(periph); + return; } softc->trim_running = 1; start_ccb->ccb_h.ccb_state = ADA_CCB_TRIM; |