Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Sep 2015 05:09:18 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r287806 - head/sys/cam/scsi
Message-ID:  <201509150509.t8F59IhJ069637@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Sep 15 05:09:17 2015
New Revision: 287806
URL: https://svnweb.freebsd.org/changeset/base/287806

Log:
  Preserve the device queue status before retrying a sense request in
  chdone(). Previously, the retry could clear the CAM_DEV_QFRZN bit in the
  CCB status, leaving the queue frozen.
  
  Submitted by:	Jeff Miller <Jeff.Miller@isilon.com>
  Reviewed by:	ken
  MFC after:	2 weeks
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/cam/scsi/scsi_ch.c

Modified: head/sys/cam/scsi/scsi_ch.c
==============================================================================
--- head/sys/cam/scsi/scsi_ch.c	Tue Sep 15 05:01:44 2015	(r287805)
+++ head/sys/cam/scsi/scsi_ch.c	Tue Sep 15 05:09:17 2015	(r287806)
@@ -655,11 +655,13 @@ chdone(struct cam_periph *periph, union 
 				 */
 				return;
 			} else if (error != 0) {
-				int retry_scheduled;
 				struct scsi_mode_sense_6 *sms;
+				int frozen, retry_scheduled;
 
 				sms = (struct scsi_mode_sense_6 *)
 					done_ccb->csio.cdb_io.cdb_bytes;
+				frozen = (done_ccb->ccb_h.status &
+				    CAM_DEV_QFRZN) != 0;
 
 				/*
 				 * Check to see if block descriptors were
@@ -670,7 +672,8 @@ chdone(struct cam_periph *periph, union 
 				 * block descriptors were disabled, enable
 				 * them and re-send the command.
 				 */
-				if (sms->byte2 & SMS_DBD) {
+				if ((sms->byte2 & SMS_DBD) != 0 &&
+				    (periph->flags & CAM_PERIPH_INVALID) == 0) {
 					sms->byte2 &= ~SMS_DBD;
 					xpt_action(done_ccb);
 					softc->quirks |= CH_Q_NO_DBD;
@@ -679,7 +682,7 @@ chdone(struct cam_periph *periph, union 
 					retry_scheduled = 0;
 
 				/* Don't wedge this device's queue */
-				if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
+				if (frozen)
 					cam_release_devq(done_ccb->ccb_h.path,
 						 /*relsim_flags*/0,
 						 /*reduction*/0,



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