Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jan 2012 17:02:45 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r229288 - in head/sys/cam: ata scsi
Message-ID:  <201201021702.q02H2jct075917@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Jan  2 17:02:45 2012
New Revision: 229288
URL: http://svn.freebsd.org/changeset/base/229288

Log:
  Remove unneeded checks for CAM_DEV_QFRZN after cam_periph_runccb() call.
  cam_periph_runccb() since the beginning checks it and releases device queue.
  After r203108 it even clears CAM_DEV_QFRZN flag after that to avoid double
  release, so removed code is unreachable now.
  
  MFC after:	1 month

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/cam/scsi/scsi_sa.c
  head/sys/cam/scsi/scsi_ses.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Mon Jan  2 16:54:21 2012	(r229287)
+++ head/sys/cam/ata/ata_da.c	Mon Jan  2 17:02:45 2012	(r229288)
@@ -493,13 +493,6 @@ adaclose(struct disk *dp)
 
 		if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
 			xpt_print(periph->path, "Synchronize cache failed\n");
-
-		if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-			cam_release_devq(ccb->ccb_h.path,
-					 /*relsim_flags*/0,
-					 /*reduction*/0,
-					 /*timeout*/0,
-					 /*getcount_only*/0);
 		xpt_release_ccb(ccb);
 	}
 

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Mon Jan  2 16:54:21 2012	(r229287)
+++ head/sys/cam/scsi/scsi_da.c	Mon Jan  2 17:02:45 2012	(r229288)
@@ -990,13 +990,6 @@ daclose(struct disk *dp)
 			}
 		}
 
-		if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-			cam_release_devq(ccb->ccb_h.path,
-					 /*relsim_flags*/0,
-					 /*reduction*/0,
-					 /*timeout*/0,
-					 /*getcount_only*/0);
-
 		xpt_release_ccb(ccb);
 
 	}
@@ -2281,14 +2274,6 @@ dagetcapacity(struct cam_periph *periph)
 				  /*cam_flags*/CAM_RETRY_SELTO,
 				  sense_flags,
 				  softc->disk->d_devstat);
-
-		if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-			cam_release_devq(ccb->ccb_h.path,
-				 /*relsim_flags*/0,
-				 /*reduction*/0,
-				 /*timeout*/0,
-				 /*getcount_only*/0);
-
 		if (error == 0)
 			goto rc16ok;
 
@@ -2326,14 +2311,6 @@ dagetcapacity(struct cam_periph *periph)
 				  /*cam_flags*/CAM_RETRY_SELTO,
 				  sense_flags,
 				  softc->disk->d_devstat);
-
-	if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-		cam_release_devq(ccb->ccb_h.path,
-				 /*relsim_flags*/0,
-				 /*reduction*/0,
-				 /*timeout*/0,
-				 /*getcount_only*/0);
-
 	if (error == 0) {
 		block_len = scsi_4btoul(rcap->length);
 		maxsector = scsi_4btoul(rcap->addr);
@@ -2360,14 +2337,6 @@ dagetcapacity(struct cam_periph *periph)
 				  /*cam_flags*/CAM_RETRY_SELTO,
 				  sense_flags,
 				  softc->disk->d_devstat);
-
-	if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-		cam_release_devq(ccb->ccb_h.path,
-				 /*relsim_flags*/0,
-				 /*reduction*/0,
-				 /*timeout*/0,
-				 /*getcount_only*/0);
-
 	if (error == 0) {
 rc16ok:
 		block_len = scsi_4btoul(rcaplong->length);

Modified: head/sys/cam/scsi/scsi_sa.c
==============================================================================
--- head/sys/cam/scsi/scsi_sa.c	Mon Jan  2 16:54:21 2012	(r229287)
+++ head/sys/cam/scsi/scsi_sa.c	Mon Jan  2 17:02:45 2012	(r229288)
@@ -1853,14 +1853,12 @@ samount(struct cam_periph *periph, int o
 		    MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT);
 		error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT,
 		    softc->device_stats);
-		QFRLS(ccb);
 		if (error == ENXIO) {
 			softc->flags &= ~SA_FLAG_TAPE_MOUNTED;
 			scsi_test_unit_ready(&ccb->csio, 0, sadone,
 			    MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT);
 			error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT,
 			    softc->device_stats);
-			QFRLS(ccb);
 		} else if (error) {
 			/*
 			 * We don't need to freeze the tape because we
@@ -1882,7 +1880,6 @@ samount(struct cam_periph *periph, int o
 		    MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, IO_TIMEOUT);
 		error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT,
 		    softc->device_stats);
-		QFRLS(ccb);
 	}
 
 	if ((softc->flags & SA_FLAG_TAPE_MOUNTED) == 0) {
@@ -1905,7 +1902,6 @@ samount(struct cam_periph *periph, int o
 		    FALSE, FALSE, 1, SSD_FULL_SIZE, REWIND_TIMEOUT);
 		error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT,
 		    softc->device_stats);
-		QFRLS(ccb);
 
 		/*
 		 * In case this doesn't work, do a REWIND instead
@@ -1915,7 +1911,6 @@ samount(struct cam_periph *periph, int o
 			    FALSE, SSD_FULL_SIZE, REWIND_TIMEOUT);
 			error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT,
 				softc->device_stats);
-			QFRLS(ccb);
 		}
 		if (error) {
 			xpt_release_ccb(ccb);
@@ -1945,13 +1940,11 @@ samount(struct cam_periph *periph, int o
 			    IO_TIMEOUT);
 			(void) cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT,
 			    softc->device_stats);
-			QFRLS(ccb);
 			scsi_rewind(&ccb->csio, 1, sadone, MSG_SIMPLE_Q_TAG,
 			    FALSE, SSD_FULL_SIZE, REWIND_TIMEOUT);
 			error = cam_periph_runccb(ccb, saerror, CAM_RETRY_SELTO,
 			    SF_NO_PRINT | SF_RETRY_UA,
 			    softc->device_stats);
-			QFRLS(ccb);
 			if (error) {
 				xpt_print(periph->path,
 				    "unable to rewind after test read\n");
@@ -1969,7 +1962,6 @@ samount(struct cam_periph *periph, int o
 		error = cam_periph_runccb(ccb, saerror, CAM_RETRY_SELTO,
 		    SF_NO_PRINT | SF_RETRY_UA, softc->device_stats);
 
-		QFRLS(ccb);
 		xpt_release_ccb(ccb);
 
 		if (error != 0) {
@@ -2580,7 +2572,6 @@ retry:
 
 	error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT,
 	    softc->device_stats);
-	QFRLS(ccb);
 
 	status = ccb->ccb_h.status & CAM_STATUS_MASK;
 
@@ -2644,7 +2635,6 @@ retry:
 
 		error = cam_periph_runccb(ccb, saerror, 0, SF_NO_PRINT,
 		    softc->device_stats);
-		QFRLS(ccb);
 
 		if (error != 0)
 			goto sagetparamsexit;
@@ -2956,7 +2946,6 @@ retry:
 
 	error = cam_periph_runccb(ccb, saerror, 0,
 	    sense_flags, softc->device_stats);
-	QFRLS(ccb);
 
 	if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO)) {
 		int idx;
@@ -3014,7 +3003,6 @@ retry:
 		ccb->ccb_h.retry_count = 1;
 		cam_periph_runccb(ccb, saerror, 0, sense_flags,
 		    softc->device_stats);
-		QFRLS(ccb);
 	}
 
 	xpt_release_ccb(ccb);
@@ -3072,7 +3060,6 @@ saprevent(struct cam_periph *periph, int
 	    SSD_FULL_SIZE, SCSIOP_TIMEOUT);
 
 	error = cam_periph_runccb(ccb, saerror, 0, sf, softc->device_stats);
-	QFRLS(ccb);
 	if (error == 0) {
 		if (action == PR_ALLOW)
 			softc->flags &= ~SA_FLAG_TAPE_LOCKED;
@@ -3102,9 +3089,6 @@ sarewind(struct cam_periph *periph)
 	error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats);
 	softc->dsreg = MTIO_DSREG_REST;
 
-	if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-		cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
-
 	xpt_release_ccb(ccb);
 	if (error == 0)
 		softc->fileno = softc->blkno = (daddr_t) 0;
@@ -3138,9 +3122,6 @@ saspace(struct cam_periph *periph, int c
 	error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats);
 	softc->dsreg = MTIO_DSREG_REST;
 
-	if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-		cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
-
 	xpt_release_ccb(ccb);
 
 	/*
@@ -3212,9 +3193,6 @@ sawritefilemarks(struct cam_periph *peri
 
 	error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats);
 
-	if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-		cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
-
 	if (error == 0 && nmarks) {
 		struct sa_softc *softc = (struct sa_softc *)periph->softc;
 		nwm = nmarks - softc->last_ctl_resid;
@@ -3265,8 +3243,6 @@ sardpos(struct cam_periph *periph, int h
 	softc->dsreg = MTIO_DSREG_RBSY;
 	error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats);
 	softc->dsreg = MTIO_DSREG_REST;
-	if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-		cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
 
 	if (error == 0) {
 		if (loc.flags & SA_RPOS_UNCERTAIN) {
@@ -3306,8 +3282,6 @@ sasetpos(struct cam_periph *periph, int 
 	softc->dsreg = MTIO_DSREG_POS;
 	error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats);
 	softc->dsreg = MTIO_DSREG_REST;
-	if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-		cam_release_devq(ccb->ccb_h.path, 0, 0, 0, 0);
 	xpt_release_ccb(ccb);
 	/*
 	 * Note relative file && block number position as now unknown.
@@ -3335,8 +3309,6 @@ saretension(struct cam_periph *periph)
 	error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats);
 	softc->dsreg = MTIO_DSREG_REST;
 
-	if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-		cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
 	xpt_release_ccb(ccb);
 	if (error == 0)
 		softc->fileno = softc->blkno = (daddr_t) 0;
@@ -3362,7 +3334,6 @@ sareservereleaseunit(struct cam_periph *
 	error = cam_periph_runccb(ccb, saerror, 0,
 	    SF_RETRY_UA | SF_NO_PRINT, softc->device_stats);
 	softc->dsreg = MTIO_DSREG_REST;
-	QFRLS(ccb);
 	xpt_release_ccb(ccb);
 
 	/*
@@ -3394,7 +3365,6 @@ saloadunload(struct cam_periph *periph, 
 	softc->dsreg = (load)? MTIO_DSREG_LD : MTIO_DSREG_UNL;
 	error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats);
 	softc->dsreg = MTIO_DSREG_REST;
-	QFRLS(ccb);
 	xpt_release_ccb(ccb);
 
 	if (error || load == 0)
@@ -3425,8 +3395,6 @@ saerase(struct cam_periph *periph, int l
 	error = cam_periph_runccb(ccb, saerror, 0, 0, softc->device_stats);
 	softc->dsreg = MTIO_DSREG_REST;
 
-	if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-		cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
 	xpt_release_ccb(ccb);
 	return (error);
 }

Modified: head/sys/cam/scsi/scsi_ses.c
==============================================================================
--- head/sys/cam/scsi/scsi_ses.c	Mon Jan  2 16:54:21 2012	(r229287)
+++ head/sys/cam/scsi/scsi_ses.c	Mon Jan  2 17:02:45 2012	(r229288)
@@ -679,8 +679,6 @@ ses_runcmd(struct ses_softc *ssc, char *
 	bcopy(cdb, ccb->csio.cdb_io.cdb_bytes, cdbl);
 
 	error = cam_periph_runccb(ccb, seserror, SES_CFLAGS, SES_FLAGS, NULL);
-	if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
-		cam_release_devq(ccb->ccb_h.path, 0, 0, 0, FALSE);
 	if (error) {
 		if (dptr) {
 			*dlenp = dlen;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201021702.q02H2jct075917>