Date: Sat, 15 Aug 2015 11:05:45 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286800 - stable/10/sys/cam/ata Message-ID: <201508151105.t7FB5jUl016470@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sat Aug 15 11:05:44 2015 New Revision: 286800 URL: https://svnweb.freebsd.org/changeset/base/286800 Log: MFC r286447: Don't panic if disk lost TRIM support due to switching to PIO mode. Modified: stable/10/sys/cam/ata/ata_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ata/ata_da.c ============================================================================== --- stable/10/sys/cam/ata/ata_da.c Sat Aug 15 09:00:36 2015 (r286799) +++ stable/10/sys/cam/ata/ata_da.c Sat Aug 15 11:05:44 2015 (r286800) @@ -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, unio !(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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508151105.t7FB5jUl016470>